visitor
Class Visitor

java.lang.Object
  extended by visitor.Visitor
Direct Known Subclasses:
PrintVisitor

public abstract class Visitor
extends java.lang.Object

Abstract visitor class for traversing the AST


Constructor Summary
Visitor()
           
 
Method Summary
 java.lang.Object visit(ArrayAssignExpr node)
          Visit an array assignment expression node
 java.lang.Object visit(ArrayExpr node)
          Visit an array expression node
 java.lang.Object visit(AssignExpr node)
          Visit an assignment expression node
 java.lang.Object visit(ASTNode node)
          Visit an AST node (should never be called)
 java.lang.Object visit(BinaryArithDivideExpr node)
          Visit a binary arithmetic divide expression node
 java.lang.Object visit(BinaryArithExpr node)
          Visit a binary arithmetic expression node (should never be called)
 java.lang.Object visit(BinaryArithMinusExpr node)
          Visit a binary arithmetic minus expression node
 java.lang.Object visit(BinaryArithModulusExpr node)
          Visit a binary arithmetic modulus expression node
 java.lang.Object visit(BinaryArithPlusExpr node)
          Visit a binary arithmetic plus expression node
 java.lang.Object visit(BinaryArithTimesExpr node)
          Visit a binary arithmetic times expression node
 java.lang.Object visit(BinaryCompEqExpr node)
          Visit a binary comparison equals expression node
 java.lang.Object visit(BinaryCompExpr node)
          Visit a binary comparison expression node (should never be called)
 java.lang.Object visit(BinaryCompGeqExpr node)
          Visit a binary comparison greater than or equal to expression node
 java.lang.Object visit(BinaryCompGtExpr node)
          Visit a binary comparison greater than expression node
 java.lang.Object visit(BinaryCompLeqExpr node)
          Visit a binary comparison less than or equal to expression node
 java.lang.Object visit(BinaryCompLtExpr node)
          Visit a binary comparison less than expression node
 java.lang.Object visit(BinaryCompNeExpr node)
          Visit a binary comparison not equals expression node
 java.lang.Object visit(BinaryExpr node)
          Visit a binary expression node (should never be called)
 java.lang.Object visit(BinaryLogicAndExpr node)
          Visit a binary logical AND expression node
 java.lang.Object visit(BinaryLogicExpr node)
          Visit a binary logical expression node (should never be called)
 java.lang.Object visit(BinaryLogicOrExpr node)
          Visit a binary logical OR expression node
 java.lang.Object visit(BlockStmt node)
          Visit a block statement node
 java.lang.Object visit(BreakStmt node)
          Visit a break statement node
 java.lang.Object visit(CastExpr node)
          Visit a cast expression node
 java.lang.Object visit(Class_ node)
          Visit a class node
 java.lang.Object visit(ClassList node)
          Visit a list node of classes
 java.lang.Object visit(ConstBooleanExpr node)
          Visit a boolean constant expression node
 java.lang.Object visit(ConstExpr node)
          Visit a constant expression node (should never be called)
 java.lang.Object visit(ConstIntExpr node)
          Visit an int constant expression node
 java.lang.Object visit(ConstStringExpr node)
          Visit a string constant expression node
 java.lang.Object visit(DeclStmt node)
          Visit a declaration statement node
 java.lang.Object visit(DispatchExpr node)
          Visit a dispatch expression node
 java.lang.Object visit(Expr node)
          Visit an expression node (should never be called)
 java.lang.Object visit(ExprList node)
          Visit a list node of expressions
 java.lang.Object visit(ExprStmt node)
          Visit an expression statement node
 java.lang.Object visit(Field node)
          Visit a field node
 java.lang.Object visit(Formal node)
          Visit a formal node
 java.lang.Object visit(FormalList node)
          Visit a list node of formals
 java.lang.Object visit(ForStmt node)
          Visit a for statement node
 java.lang.Object visit(IfStmt node)
          Visit an if statement node
 java.lang.Object visit(InstanceofExpr node)
          Visit an instanceof expression node
 java.lang.Object visit(ListNode node)
          Visit a list node (should never be called)
 java.lang.Object visit(Member node)
          Visit a member node (should never be calle)
 java.lang.Object visit(MemberList node)
          Visit a list node of members
 java.lang.Object visit(Method node)
          Visit a method node
 java.lang.Object visit(NewArrayExpr node)
          Visit a new array expression node
 java.lang.Object visit(NewExpr node)
          Visit a new expression node
 java.lang.Object visit(Program node)
          Visit a program node
 java.lang.Object visit(ReturnStmt node)
          Visit a return statement node
 java.lang.Object visit(Stmt node)
          Visit a statement node (should never be calle)
 java.lang.Object visit(StmtList node)
          Visit a list node of statements
 java.lang.Object visit(UnaryDecrExpr node)
          Visit a unary decrement expression node
 java.lang.Object visit(UnaryExpr node)
          Visit a unary expression node
 java.lang.Object visit(UnaryIncrExpr node)
          Visit a unary increment expression node
 java.lang.Object visit(UnaryNegExpr node)
          Visit a unary negation expression node
 java.lang.Object visit(UnaryNotExpr node)
          Visit a unary NOT expression node
 java.lang.Object visit(VarExpr node)
          Visit a variable expression node
 java.lang.Object visit(WhileStmt node)
          Visit a while statement node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Visitor

public Visitor()
Method Detail

visit

public java.lang.Object visit(ASTNode node)
Visit an AST node (should never be called)

Parameters:
node - the AST node
Returns:
result of the visit

visit

public java.lang.Object visit(ListNode node)
Visit a list node (should never be called)

Parameters:
node - the list node
Returns:
result of the visit

visit

public java.lang.Object visit(Program node)
Visit a program node

Parameters:
node - the program node
Returns:
result of the visit

visit

public java.lang.Object visit(ClassList node)
Visit a list node of classes

Parameters:
node - the class list node
Returns:
result of the visit

visit

public java.lang.Object visit(Class_ node)
Visit a class node

Parameters:
node - the class node
Returns:
result of the visit

visit

public java.lang.Object visit(MemberList node)
Visit a list node of members

Parameters:
node - the member list node
Returns:
result of the visit

visit

public java.lang.Object visit(Member node)
Visit a member node (should never be calle)

Parameters:
node - the member node
Returns:
result of the visit

visit

public java.lang.Object visit(Field node)
Visit a field node

Parameters:
node - the field node
Returns:
result of the visit

visit

public java.lang.Object visit(Method node)
Visit a method node

Parameters:
node - the method node
Returns:
result of the visit

visit

public java.lang.Object visit(FormalList node)
Visit a list node of formals

Parameters:
node - the formal list node
Returns:
result of the visit

visit

public java.lang.Object visit(Formal node)
Visit a formal node

Parameters:
node - the formal node
Returns:
result of the visit

visit

public java.lang.Object visit(StmtList node)
Visit a list node of statements

Parameters:
node - the statement list node
Returns:
result of the visit

visit

public java.lang.Object visit(Stmt node)
Visit a statement node (should never be calle)

Parameters:
node - the statement node
Returns:
result of the visit

visit

public java.lang.Object visit(DeclStmt node)
Visit a declaration statement node

Parameters:
node - the declaration statement node
Returns:
result of the visit

visit

public java.lang.Object visit(ExprStmt node)
Visit an expression statement node

Parameters:
node - the expression statement node
Returns:
result of the visit

visit

public java.lang.Object visit(IfStmt node)
Visit an if statement node

Parameters:
node - the if statement node
Returns:
result of the visit

visit

public java.lang.Object visit(WhileStmt node)
Visit a while statement node

Parameters:
node - the while statement node
Returns:
result of the visit

visit

public java.lang.Object visit(ForStmt node)
Visit a for statement node

Parameters:
node - the for statement node
Returns:
result of the visit

visit

public java.lang.Object visit(BreakStmt node)
Visit a break statement node

Parameters:
node - the break statement node
Returns:
result of the visit

visit

public java.lang.Object visit(BlockStmt node)
Visit a block statement node

Parameters:
node - the block statement node
Returns:
result of the visit

visit

public java.lang.Object visit(ReturnStmt node)
Visit a return statement node

Parameters:
node - the return statement node
Returns:
result of the visit

visit

public java.lang.Object visit(ExprList node)
Visit a list node of expressions

Parameters:
node - the expression list node
Returns:
result of the visit

visit

public java.lang.Object visit(Expr node)
Visit an expression node (should never be called)

Parameters:
node - the expression node
Returns:
result of the visit

visit

public java.lang.Object visit(DispatchExpr node)
Visit a dispatch expression node

Parameters:
node - the dispatch expression node
Returns:
result of the visit

visit

public java.lang.Object visit(NewExpr node)
Visit a new expression node

Parameters:
node - the new expression node
Returns:
result of the visit

visit

public java.lang.Object visit(NewArrayExpr node)
Visit a new array expression node

Parameters:
node - the new array expression node
Returns:
result of the visit

visit

public java.lang.Object visit(InstanceofExpr node)
Visit an instanceof expression node

Parameters:
node - the instanceof expression node
Returns:
result of the visit

visit

public java.lang.Object visit(CastExpr node)
Visit a cast expression node

Parameters:
node - the cast expression node
Returns:
result of the visit

visit

public java.lang.Object visit(AssignExpr node)
Visit an assignment expression node

Parameters:
node - the assignment expression node
Returns:
result of the visit

visit

public java.lang.Object visit(ArrayAssignExpr node)
Visit an array assignment expression node

Parameters:
node - the array assignment expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryExpr node)
Visit a binary expression node (should never be called)

Parameters:
node - the binary expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryCompExpr node)
Visit a binary comparison expression node (should never be called)

Parameters:
node - the binary comparison expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryCompEqExpr node)
Visit a binary comparison equals expression node

Parameters:
node - the binary comparison equals expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryCompNeExpr node)
Visit a binary comparison not equals expression node

Parameters:
node - the binary comparison not equals expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryCompLtExpr node)
Visit a binary comparison less than expression node

Parameters:
node - the binary comparison less than expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryCompLeqExpr node)
Visit a binary comparison less than or equal to expression node

Parameters:
node - the binary comparison less than or equal to expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryCompGtExpr node)
Visit a binary comparison greater than expression node

Parameters:
node - the binary comparison greater than expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryCompGeqExpr node)
Visit a binary comparison greater than or equal to expression node

Parameters:
node - the binary comparison greater to or equal to expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryArithExpr node)
Visit a binary arithmetic expression node (should never be called)

Parameters:
node - the binary arithmetic expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryArithPlusExpr node)
Visit a binary arithmetic plus expression node

Parameters:
node - the binary arithmetic plus expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryArithMinusExpr node)
Visit a binary arithmetic minus expression node

Parameters:
node - the binary arithmetic minus expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryArithTimesExpr node)
Visit a binary arithmetic times expression node

Parameters:
node - the binary arithmetic times expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryArithDivideExpr node)
Visit a binary arithmetic divide expression node

Parameters:
node - the binary arithmetic divide expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryArithModulusExpr node)
Visit a binary arithmetic modulus expression node

Parameters:
node - the binary arithmetic modulus expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryLogicExpr node)
Visit a binary logical expression node (should never be called)

Parameters:
node - the binary logical expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryLogicAndExpr node)
Visit a binary logical AND expression node

Parameters:
node - the binary logical AND expression node
Returns:
result of the visit

visit

public java.lang.Object visit(BinaryLogicOrExpr node)
Visit a binary logical OR expression node

Parameters:
node - the binary logical OR expression node
Returns:
result of the visit

visit

public java.lang.Object visit(UnaryExpr node)
Visit a unary expression node

Parameters:
node - the unary expression node
Returns:
result of the visit

visit

public java.lang.Object visit(UnaryNegExpr node)
Visit a unary negation expression node

Parameters:
node - the unary negation expression node
Returns:
result of the visit

visit

public java.lang.Object visit(UnaryNotExpr node)
Visit a unary NOT expression node

Parameters:
node - the unary NOT expression node
Returns:
result of the visit

visit

public java.lang.Object visit(UnaryIncrExpr node)
Visit a unary increment expression node

Parameters:
node - the unary increment expression node
Returns:
result of the visit

visit

public java.lang.Object visit(UnaryDecrExpr node)
Visit a unary decrement expression node

Parameters:
node - the unary decrement expression node
Returns:
result of the visit

visit

public java.lang.Object visit(VarExpr node)
Visit a variable expression node

Parameters:
node - the variable expression node
Returns:
result of the visit

visit

public java.lang.Object visit(ArrayExpr node)
Visit an array expression node

Parameters:
node - the array expression node
Returns:
result of the visit

visit

public java.lang.Object visit(ConstExpr node)
Visit a constant expression node (should never be called)

Parameters:
node - the constant expression node
Returns:
result of the visit

visit

public java.lang.Object visit(ConstIntExpr node)
Visit an int constant expression node

Parameters:
node - the int constant expression node
Returns:
result of the visit

visit

public java.lang.Object visit(ConstBooleanExpr node)
Visit a boolean constant expression node

Parameters:
node - the boolean constant expression node
Returns:
result of the visit

visit

public java.lang.Object visit(ConstStringExpr node)
Visit a string constant expression node

Parameters:
node - the string constant expression node
Returns:
result of the visit