Class LookaheadIterator

java.lang.Object
io.github.treesitter.jtreesitter.LookaheadIterator
All Implemented Interfaces:
AutoCloseable, Iterator<LookaheadIterator.Symbol>

@NullMarked public final class LookaheadIterator extends Object implements AutoCloseable, Iterator<LookaheadIterator.Symbol>
A class that is used to look up valid symbols in a specific parse state.

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 MISSING nodes, a lookahead iterator created on the previous non-extra leaf node may be appropriate.