hyperlark (TypeScript)
    Preparing search index...

    Class InteractiveParser

    A manually-driven LALR parse (Lark.parseInteractive), mirroring lark's InteractiveParser: feed tokens one at a time, inspect the live accepts() set, fork with copy(), finish with feedEof() / resumeParse(). Re-declared over the generated class to add the iterParse() generator sugar (interactive.js). Owns its grammar reference, so it stays valid even if the Lark handle is freed first.

    Indexable

    • [key: number]: () => void
    Index
    • The terminal names (incl. "$END") the current state accepts.

      Returns string[]

    • The full action map { name: [kind, id] }, kind "Shift" / "Reduce" (lark choices).

      Returns Record<string, [string, number]>

    • Feed every remaining lexer token; returns them (lark exhaust_lexer).

      Returns Token[]

    • Append $END, finishing the parse; returns the tree as a ParseHandle.

      Returns ParseHandle

    • Pull the next lexer token, feed it, and return it — or undefined at end of input (the lazy step iterParse() drives).

      Returns Token | undefined

    • Feed one token, advancing the parse (lark feed_token). A plain { type, value } literal works — positions are not consulted. Throws the mapped UnexpectedToken if the current state rejects it.

      Parameters

      • token: { type: string; value?: string }

      Returns void

    • Returns void

    • Generator over feedNext(): pulls-and-feeds each lexer token and yields it (lark iter_parse); break out of the loop to stop early.

      Returns IterableIterator<Token>

    • Human-readable dump of the current parser state.

      Returns string

    • Drive the built-in lexer over the remaining input to completion; returns the tree as a ParseHandle (lark resume_parse).

      Returns ParseHandle