A custom error message provider. Can be used to override the default error messages. For example:
A custom lookahead strategy. Can be used to override the default LL(k) lookahead behavior.
Note that the default lookahead strategy is very well optimized and using a custom lookahead strategy might lead to massively reduced performance.
Maximum number of tokens the parser will use to choose between alternatives.
By default this value is
In the future it may be reduced to
3 due to performance considerations.
Enable computation of CST nodes location. By default this is set to "none", meaning this feature is disabled. See: http://chevrotain.io/docs/guide/concrete_syntax_tree.html#cstnode-location For more details.
Is the error recovery / fault tolerance of the Chevrotain Parser enabled.
This flag will avoid running the grammar validations during Parser initialization.
This can substantially improve the Parser's initialization (constructor) time.
IParserConfig.traceInitPerf to measure the grammar validations cost for your parser.
Note that the grammar validations are extremely useful during development time, e.g: detecting ambiguities / left recursion. So they should not be skipped during development flows.
Enabling this flag will print performance tracing logs during parser Initialization (constructor invocation), this is useful to narrow down the cause of the initialization performance problem.
You can also pass a numerical value which affects the verbosity of the traces, this number is the maximum nesting level of the traces, e.g: 0: Traces disabled === 'false' 1: Top Level traces only. 2: One level of nested inner traces. ...
Note that passing the boolean
true is identical to passing the numerical value
Generated using TypeDoc
Enable This Flag to to support Dynamically defined Tokens. This will disable performance optimizations which cannot work if the whole Token vocabulary is not known During Parser initialization.
See runnable example