org.antlr.runtime.tree
Class TreeVisitor
java.lang.Object
org.antlr.runtime.tree.TreeVisitor
public class TreeVisitor
- extends Object
Do a depth first walk of a tree, applying pre() and post() actions
as we discover and finish nodes.
Method Summary |
Object |
visit(Object t,
TreeVisitorAction action)
Visit every node in tree t and trigger an action for each node
before/after having visited all of its children. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
adaptor
protected TreeAdaptor adaptor
TreeVisitor
public TreeVisitor(TreeAdaptor adaptor)
TreeVisitor
public TreeVisitor()
visit
public Object visit(Object t,
TreeVisitorAction action)
- Visit every node in tree t and trigger an action for each node
before/after having visited all of its children.
Execute both actions even if t has no children.
If a child visit yields a new child, it can update its
parent's child list or just return the new child. The
child update code works even if the child visit alters its parent
and returns the new tree.
Return result of applying post action to this node.
Copyright © 2011. All Rights Reserved.