Package ch.usi.si.seart.treesitter
Class LookaheadIterator
- java.lang.Object
-
- ch.usi.si.seart.treesitter.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 anERRORnode, use the lookahead iterator on its first leaf node state. ForMISSINGnodes, a lookahead iterator created on the previous non-extra leaf node may be appropriate.- Since:
- 1.12.0
- Author:
- Ozren Dabić
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Delete the external resource, freeing all the memory that it used.booleanequals(Object obj)inthashCode()booleanhasNext()booleanisNull()Checks whether the memory address associated with this external resource isnullptr.Symbolnext()-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Method Detail
-
isNull
public final boolean isNull()
Checks whether the memory address associated with this external resource isnullptr.- Returns:
trueif the memory address is 0, otherwisefalse
-
close
public void close()
Delete the external resource, freeing all the memory that it used.- Specified by:
closein interfaceAutoCloseable
-
-