com.go.tea.parsetree
Class TreeWalker

java.lang.Object
  |
  +--com.go.tea.parsetree.TreeWalker
All Implemented Interfaces:
NodeVisitor

public abstract class TreeWalker
extends java.lang.Object
implements NodeVisitor

A TreeWalker traverses a parse tree in its canonical order. By overriding a visit method, individual nodes can be captured and processed based on their type. Call super.visit inside the overriden visit method to ensure that the node's children are properly traversed.

Version:
18 , 5/31/01
Author:
Brian S O'Neill

Constructor Summary
TreeWalker()
           
 
Method Summary
 java.lang.Object visit(AndExpression node)
           
 java.lang.Object visit(ArithmeticExpression node)
           
 java.lang.Object visit(ArrayLookup node)
           
 java.lang.Object visit(AssignmentStatement node)
           
 java.lang.Object visit(Block node)
           
 java.lang.Object visit(BooleanLiteral node)
           
 java.lang.Object visit(BreakStatement node)
           
 java.lang.Object visit(ConcatenateExpression node)
           
 java.lang.Object visit(ExceptionGuardStatement node)
           
 java.lang.Object visit(Expression node)
           
 java.lang.Object visit(ExpressionList node)
           
 java.lang.Object visit(ExpressionStatement node)
           
 java.lang.Object visit(ForeachStatement node)
           
 java.lang.Object visit(FunctionCallExpression node)
           
 java.lang.Object visit(IfStatement node)
           
 java.lang.Object visit(Lookup node)
           
 java.lang.Object visit(Name node)
           
 java.lang.Object visit(NegateExpression node)
           
 java.lang.Object visit(NewArrayExpression node)
           
 java.lang.Object visit(NotExpression node)
           
 java.lang.Object visit(NullLiteral node)
           
 java.lang.Object visit(NumberLiteral node)
           
 java.lang.Object visit(OrExpression node)
           
 java.lang.Object visit(ParenExpression node)
           
 java.lang.Object visit(RelationalExpression node)
           
 java.lang.Object visit(ReturnStatement node)
           
 java.lang.Object visit(Statement node)
           
 java.lang.Object visit(StatementList node)
           
 java.lang.Object visit(StringLiteral node)
           
 java.lang.Object visit(SubstitutionStatement node)
           
 java.lang.Object visit(Template node)
           
 java.lang.Object visit(TemplateCallExpression node)
           
 java.lang.Object visit(TypeName node)
           
 java.lang.Object visit(Variable node)
           
 java.lang.Object visit(VariableRef node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeWalker

public TreeWalker()
Method Detail

visit

public java.lang.Object visit(Template node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(Name node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(TypeName node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(Variable node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(ExpressionList node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(Statement node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(StatementList node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(Block node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(AssignmentStatement node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(BreakStatement node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(ForeachStatement node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(IfStatement node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(SubstitutionStatement node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(ExpressionStatement node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(ReturnStatement node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(ExceptionGuardStatement node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(Expression node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(ParenExpression node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(NewArrayExpression node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(FunctionCallExpression node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(TemplateCallExpression node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(VariableRef node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(Lookup node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(ArrayLookup node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(NegateExpression node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(NotExpression node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(ConcatenateExpression node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(ArithmeticExpression node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(RelationalExpression node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(AndExpression node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(OrExpression node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(NullLiteral node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(BooleanLiteral node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(StringLiteral node)
Specified by:
visit in interface NodeVisitor

visit

public java.lang.Object visit(NumberLiteral node)
Specified by:
visit in interface NodeVisitor