org.antlr.runtime.tree
Class TreeVisitor

java.lang.Object
  extended by org.antlr.runtime.tree.TreeVisitor

public class TreeVisitor
extends java.lang.Object

Do a depth first walk of a tree, applying pre() and post() actions we go.


Field Summary
protected  TreeAdaptor adaptor
           
 
Constructor Summary
TreeVisitor()
           
TreeVisitor(TreeAdaptor adaptor)
           
 
Method Summary
 java.lang.Object visit(java.lang.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
 

Field Detail

adaptor

protected TreeAdaptor adaptor
Constructor Detail

TreeVisitor

public TreeVisitor(TreeAdaptor adaptor)

TreeVisitor

public TreeVisitor()
Method Detail

visit

public java.lang.Object visit(java.lang.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. Bottom up walk. Execute both actions even if t has no children. Ignore return results from transforming children since they will have altered the child list of this node (their parent). Return result of applying post action to this node.



Copyright © 2009. All Rights Reserved.