public final class SyntaxTreeWalker<Tag extends java.lang.Enum<Tag>>
extends java.lang.Object
SyntaxTreeWalker
implements a walker that traverses an abstract syntax tree.SyntaxNode
,
SyntaxNodeVisitor
Constructor and Description |
---|
SyntaxTreeWalker(SyntaxNode<Tag> root,
SyntaxNodeVisitor<Tag> visitor)
Constructs a tree walker.
|
Modifier and Type | Method and Description |
---|---|
void |
start()
Starts traversal (depth-first exploration).
|
public SyntaxTreeWalker(SyntaxNode<Tag> root, SyntaxNodeVisitor<Tag> visitor)
root
- the root of the tree to be traversed.visitor
- the user-defined visitor of tree nodes.