Returns the executable rule function for the specified rule name
Parameters
name: string
Returns undefined | RuleResult
getRuleStack
getRuleStack(): number[]
The rule stack indicates the indices of rules that are currently invoked,
in order of their invocation.
Returns number[]
isRecording
isRecording(): boolean
Whether the parser is currently actually in use or in "recording mode".
Recording mode is activated once when the parser is analyzing itself.
During this phase, no input exists and therefore no AST should be constructed
Returns boolean
many
many(idx, callback): void
Parses the callback 0 or more times (the * operation in EBNF/Langium)
Parameters
idx: number
callback: DSLMethodOpts<unknown>
Returns void
optional
optional(idx, callback): void
Parses the callback as optional (the ? operation in EBNF/Langium)
Invokes the executable function for a given parser rule.
Requires a unique index within the rule for a specific sub rule.
Arguments can be supplied to the rule invocation for semantic predicates
Base interface for all parsers. Mainly used by the
parser-builder-base.ts
to perform work on different kinds of parsers. The main use cases are: