Class LookaheadIterator

  • All Implemented Interfaces:
    AutoCloseable, Iterator<Symbol>

    public class LookaheadIterator
    extends Object
    implements Iterator<Symbol>
    Specialized iterator that can be used 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.
    Since:
    1.12.0
    Author:
    Ozren Dabić
    • Method Detail

      • isNull

        public final boolean isNull()
        Checks whether the memory address associated with this external resource is nullptr.
        Returns:
        true if the memory address is 0, otherwise false
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • close

        public void close()
        Delete the external resource, freeing all the memory that it used.
        Specified by:
        close in interface AutoCloseable