Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IParserConfig

Hierarchy

  • IParserConfig

Index

Properties

Optional dynamicTokensEnabled

dynamicTokensEnabled: boolean

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

Optional errorMessageProvider

errorMessageProvider: IParserErrorMessageProvider

A custom error message provider. Can be used to override the default error messages. For example:

  • Translating the error messages to a different languages.
  • Changing the formatting.
  • Providing special error messages under certain conditions, e.g: missing semicolons.

Optional ignoredIssues

ignoredIssues: IgnoredParserIssues
deprecated
  • use the IGNORE_AMBIGUITIES flag on the relevant DSL method instead
            - <a href="ioralt.html#ignore_ambiguities">IOrAlt.IGNORE_AMBIGUITIES</a>
            - <a href="ormethodopts.html#ignore_ambiguities">OrMethodOpts.IGNORE_AMBIGUITIES</a>

Used to mark parser definition errors that should be ignored. For example:

   {
     myCustomRule : {
                     OR3 : true
                    },
     myOtherRule : {
                    OPTION1 : true,
                    OR4 : true
                   }
   }

Be careful when ignoring errors, they are usually there for a reason :).

Optional maxLookahead

maxLookahead: number

Maximum number of tokens the parser will use to choose between alternatives. By default this value is 4. In the future it may be reduced to 3 due to performance considerations.

Optional nodeLocationTracking

nodeLocationTracking: nodeLocationTrackingOptions

Enable computation of CST nodes location. By default this is set to "none", meaning this feature is disabled. See: http://sap.github.io/chevrotain/docs/guide/concrete_syntax_tree.html#cstnode-location For more details.

Optional outputCst

outputCst: boolean
deprecated
  • extend either CstParser or EmbeddedActionsParser to control this flag instead
            - @see CstParser
            - @see EmbeddedActionsParser

Enable automatic Concrete Syntax Tree creation For in-depth docs on Concrete Syntax Trees:

Optional recoveryEnabled

recoveryEnabled: boolean

Is the error recovery / fault tolerance of the Chevrotain Parser enabled.

Optional skipValidations

skipValidations: boolean

This flag will avoid running the grammar validations during Parser initialization.

This can substantially improve the Parser's initialization (constructor) time.

see

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.

  • For example: via a conditional that checks an env variable.

Optional traceInitPerf

traceInitPerf: boolean | number

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 infinity

Generated using TypeDoc