public class AstInorderTraversal extends Object implements Iterator<antlr.collections.AST>
Constructor and Description |
---|
AstInorderTraversal(antlr.collections.AST ast)
Creates a new traversal of the given AST.
|
Modifier and Type | Method and Description |
---|---|
Deque<antlr.collections.AST> |
context()
Returns the stack of AST nodes that lead from the root of the AST down to
the current node that this traverser is positioned on.
|
antlr.collections.AST |
fastForwardTo(antlr.collections.AST node) |
antlr.collections.AST |
fastForwardTo(int nodeType) |
void |
fastForwardToNextSiblingOf(antlr.collections.AST node)
Advances this iterator past the subtree rooted at the given node.
|
boolean |
hasNext() |
antlr.collections.AST |
next() |
void |
remove()
Not implemented.
|
public AstInorderTraversal(antlr.collections.AST ast)
ast
- The AST to traverse. Must not be null.public antlr.collections.AST next()
public Deque<antlr.collections.AST> context()
p
is the
parent of the node at position p + 1
.public void fastForwardToNextSiblingOf(antlr.collections.AST node)
hasNext()
will return false).
node
- The node to fast-forward past.public antlr.collections.AST fastForwardTo(int nodeType)
public antlr.collections.AST fastForwardTo(antlr.collections.AST node)
public void remove()
remove
in interface Iterator<antlr.collections.AST>
UnsupportedOperationException
- when calledCopyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.