The language to use for the lookahead iterator
The parse state to use for the lookahead iterator
ReadonlycurrentThe current symbol name of the lookahead iterator.
ReadonlycurrentThe current symbol of the lookahead iterator.
Reset the lookahead iterator.
This returns true if the language was set successfully and false
otherwise.
The language to use for the lookahead iterator
The parse state to use for the lookahead iterator
Create a new lookahead iterator for this language and parse state.
This returns
nullif the state is invalid for this language.Iterating LookaheadIterator will yield valid symbols in the given parse state. Newly created lookahead iterators will have currentType populated with the
ERRORsymbol.Lookahead iterators can be useful to generate suggestions and improve syntax error diagnostics. To get symbols valid in an ERROR node, use the lookahead iterator on its first leaf node state. For
MISSINGnodes, a lookahead iterator created on the previous non-extra leaf node may be appropriate.