org.teatrove.tea.parsetree
Class TreeWalker

java.lang.Object
  extended by org.teatrove.tea.parsetree.TreeWalker
All Implemented Interfaces:
NodeVisitor
Direct Known Subclasses:
TypeChecker.Visitor

public abstract class TreeWalker
extends 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.

Author:
Brian S O'Neill

Constructor Summary
TreeWalker()
           
 
Method Summary
 Object visit(AndExpression node)
           
 Object visit(ArithmeticExpression node)
           
 Object visit(ArrayLookup node)
           
 Object visit(AssignmentStatement node)
           
 Object visit(Block node)
           
 Object visit(BooleanLiteral node)
           
 Object visit(BreakStatement node)
           
 Object visit(CompareExpression node)
           
 Object visit(ConcatenateExpression node)
           
 Object visit(ContinueStatement node)
           
 Object visit(ExceptionGuardStatement node)
           
 Object visit(Expression node)
           
 Object visit(ExpressionList node)
           
 Object visit(ExpressionStatement node)
           
 Object visit(ForeachStatement node)
           
 Object visit(FunctionCallExpression node)
           
 Object visit(IfStatement node)
           
 Object visit(ImportDirective node)
           
 Object visit(Lookup node)
           
 Object visit(Name node)
           
 Object visit(NegateExpression node)
           
 Object visit(NewArrayExpression node)
           
 Object visit(NoOpExpression node)
           
 Object visit(NotExpression node)
           
 Object visit(NullLiteral node)
           
 Object visit(NumberLiteral node)
           
 Object visit(OrExpression node)
           
 Object visit(ParenExpression node)
           
 Object visit(RelationalExpression node)
           
 Object visit(ReturnStatement node)
           
 Object visit(SpreadExpression node)
           
 Object visit(Statement node)
           
 Object visit(StatementList node)
           
 Object visit(StringLiteral node)
           
 Object visit(SubstitutionStatement node)
           
 Object visit(Template node)
           
 Object visit(TemplateCallExpression node)
           
 Object visit(TernaryExpression node)
           
 Object visit(TypeExpression node)
           
 Object visit(TypeName node)
           
 Object visit(Variable node)
           
 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 Object visit(Template node)
Specified by:
visit in interface NodeVisitor

visit

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

visit

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

visit

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

visit

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

visit

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

visit

public Object visit(ImportDirective node)
Specified by:
visit in interface NodeVisitor

visit

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

visit

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

visit

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

visit

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

visit

public Object visit(ContinueStatement node)
Specified by:
visit in interface NodeVisitor

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

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

visit

public Object visit(TernaryExpression node)
Specified by:
visit in interface NodeVisitor

visit

public Object visit(CompareExpression node)
Specified by:
visit in interface NodeVisitor

visit

public Object visit(NoOpExpression node)
Specified by:
visit in interface NodeVisitor

visit

public Object visit(TypeExpression node)
Specified by:
visit in interface NodeVisitor

visit

public Object visit(SpreadExpression node)
Specified by:
visit in interface NodeVisitor

visit

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

visit

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

visit

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

visit

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


Copyright © 1997-2012 TeaTrove.org. All Rights Reserved.