org.antlr.runtime.tree
Class TreeIterator
java.lang.Object
org.antlr.runtime.tree.TreeIterator
- All Implemented Interfaces:
- Iterator
public class TreeIterator
- extends Object
- implements Iterator
Return a node stream from a doubly-linked tree whose nodes
know what child index they are. No remove() is supported.
Emit navigation nodes (DOWN, UP, and EOF) to let show tree structure.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
adaptor
protected TreeAdaptor adaptor
root
protected Object root
tree
protected Object tree
firstTime
protected boolean firstTime
up
public Object up
down
public Object down
eof
public Object eof
nodes
protected FastQueue nodes
- If we emit UP/DOWN nodes, we need to spit out multiple nodes per
next() call.
TreeIterator
public TreeIterator(Object tree)
TreeIterator
public TreeIterator(TreeAdaptor adaptor,
Object tree)
reset
public void reset()
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator
next
public Object next()
- Specified by:
next
in interface Iterator
remove
public void remove()
- Specified by:
remove
in interface Iterator
Copyright © 2011. All Rights Reserved.