Traqula
    Preparing search index...

    Class LexerBuilder<NAMES>

    Builder for constructing Chevrotain lexers with type-safe token management. Token ordering matters — the lexer matches the first token that fits, so more specific tokens (e.g., keywords) must be positioned before more general ones (e.g., identifiers).

    Builders mutate internal state and return this. Always start by copying an existing builder with LexerBuilder.create(existingBuilder).

    Type Parameters

    • NAMES extends string = string
    Index

    Accessors

    Methods

    • Construct a Chevrotain Lexer from the current token ordering.

      Parameters

      • OptionallexerConfig: ILexerConfig

        Optional Chevrotain lexer configuration overrides.

      Returns Lexer

    • Create a new LexerBuilder, optionally copying from an existing one.

      Type Parameters

      Parameters

      • Optionalstarter: U

        An existing builder to copy tokens from. If omitted, starts empty.

      Returns U