pl.edu.pjwstk.yaod.yaql.visitors
Interface Visitor

All Known Implementing Classes:
EvalVisitor

public interface Visitor

The Visitor interface represents the visitor pattern used for traversing the abstract syntax tree. It consists of many visit methods - each for one main node in abstract syntax tree. The class which implements this interface, ought to implement all those methods, in order to define some other (than evaluation) interpretation.

Author:
Jakub Trzetrzelewski, jakub_trzetrzelewski@yahoo.com
See Also:
AbstractSyntaxTree, EvalVisitor, EvalException

Method Summary
 void visit(AlgebraicExpression n)
          Method responsible for traversing certain binary node in abstract syntax tree.
 void visit(BlockStatement n)
          Method responsible for traversing node representing block statement ({ ... }) in abstract syntax tree.
 void visit(BreakStatement n)
          Method responsible for traversing node representing break statement (break ;)in abstract syntax tree.
 void visit(DeleteStatement n)
          Method responsible for traversing node representing delete statement (delet ...
 void visit(DoWhileStatement n)
          Method responsible for traversing node representing do while statement (do ... while (...)
 void visit(EmptyBlockStatement n)
          Method responsible for traversing node representing empty block statement ({ }) in abstract syntax tree.
 void visit(EmptyProcedureDeclarationStatement n)
          Method responsible for traversing node representing empty procedure declaration statement (procedure without parameters) (procedure/function id() { ... }) in abstract syntax tree.
 void visit(EmptyReturnStatement n)
          Method responsible for traversing node representing empty return statement (return ;) in abstract syntax tree.
 void visit(EmptyStatement n)
          Method responsible for traversing node representing empty statement ( ;) in abstract syntax tree.
 void visit(ExpressionStatement n)
          Method responsible for traversing node representing expression statement (...
 void visit(ForEachStatement n)
          Method responsible for traversing node representing for each statement (for each ... do ...) in abstract syntax tree.
 void visit(ForStatement n)
          Method responsible for traversing node representing for statement (for (...; ...; ...)
 void visit(IfElseStatement n)
          Method responsible for traversing node representing if else statement (if (...)
 void visit(IfStatement n)
          Method responsible for traversing node representing if statement (if (...)
 void visit(InsertIntoStatement n)
          Method responsible for traversing node representing insert into statement (insert ... into ...
 void visit(LastStatementList n)
          Method responsible for traversing node representing last statement list (...
 void visit(NonAlgebraicExpression n)
          Method responsible for traversing certain binary node in abstract syntax tree.
 void visit(NonParametricExpression n)
          Method responsible for traversing certain unary node in abstract syntax tree.
 void visit(PairStatementList n)
          Method responsible for traversing node representing pair statement list (...
 void visit(ParametricExpression n)
          Method responsible for traversing certain unary node in abstract syntax tree.
 void visit(PrintStatement n)
          Method responsible for traversing node representing print statement (print (...)
 void visit(ProcedureDeclarationStatement n)
          Method responsible for traversing node representing procedure declaration statement (procedure/function id(...) {
 void visit(RenameToStatement n)
          Method responsible for traversing node representing rename to statement (rename ... to ...
 void visit(ReturnStatement n)
          Method responsible for traversing node representing return statement (return ...;) in abstract syntax tree.
 void visit(ShowStatement n)
          Method responsible for traversing node representing show statement (show (...)
 void visit(SingleExpression n)
          Method responsible for traversing certain single node in abstract syntax tree.
 void visit(TernaryExpression n)
          Method responsible for traversing certain ternary node in abstract syntax tree.
 void visit(UpdateToStatement n)
          Method responsible for traversing node representing update to statement (update ... to ...
 void visit(WhileStatement n)
          Method responsible for traversing node representing while statement (while (...)
 void visit(XmlPrintStatement n)
          Method responsible for traversing node representing xmlprint statement (xmlprint (...)
 

Method Detail

visit

public void visit(SingleExpression n)
           throws EvalException
Method responsible for traversing certain single node in abstract syntax tree.
Parameters:
n - is a certain single expression node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
SingleExpression

visit

public void visit(ParametricExpression n)
           throws EvalException
Method responsible for traversing certain unary node in abstract syntax tree.
Parameters:
n - is a certain unary expression node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
UnaryExpression, ParametricExpression

visit

public void visit(NonParametricExpression n)
           throws EvalException
Method responsible for traversing certain unary node in abstract syntax tree.
Parameters:
n - is a certain unary expression node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
UnaryExpression, NonParametricExpression

visit

public void visit(AlgebraicExpression n)
           throws EvalException
Method responsible for traversing certain binary node in abstract syntax tree.
Parameters:
n - is a certain binary expression node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
BinaryExpression, AlgebraicExpression

visit

public void visit(NonAlgebraicExpression n)
           throws EvalException
Method responsible for traversing certain binary node in abstract syntax tree.
Parameters:
n - is a certain binary expression node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
BinaryExpression, NonAlgebraicExpression

visit

public void visit(TernaryExpression n)
           throws EvalException
Method responsible for traversing certain ternary node in abstract syntax tree.
Parameters:
n - is a certain ternary expression node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
TernaryExpression

visit

public void visit(EmptyStatement n)
           throws EvalException
Method responsible for traversing node representing empty statement ( ;) in abstract syntax tree.
Parameters:
n - is a empty statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
EmptyStatement

visit

public void visit(ExpressionStatement n)
           throws EvalException
Method responsible for traversing node representing expression statement (... ;)in abstract syntax tree.
Parameters:
n - is a expression statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
ExpressionStatement

visit

public void visit(PrintStatement n)
           throws EvalException
Method responsible for traversing node representing print statement (print (...) ;) in abstract syntax tree.
Parameters:
n - is a print statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
PrintStatement

visit

public void visit(XmlPrintStatement n)
           throws EvalException
Method responsible for traversing node representing xmlprint statement (xmlprint (...) ;) in abstract syntax tree.
Parameters:
n - is a xmlprint statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
XmlPrintStatement

visit

public void visit(ShowStatement n)
           throws EvalException
Method responsible for traversing node representing show statement (show (...) ;) in abstract syntax tree.
Parameters:
n - is a show statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
ShowStatement

visit

public void visit(BlockStatement n)
           throws EvalException
Method responsible for traversing node representing block statement ({ ... }) in abstract syntax tree.
Parameters:
n - is a block statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
BlockStatement

visit

public void visit(EmptyBlockStatement n)
           throws EvalException
Method responsible for traversing node representing empty block statement ({ }) in abstract syntax tree.
Parameters:
n - is a empty block statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
EmptyBlockStatement

visit

public void visit(IfStatement n)
           throws EvalException
Method responsible for traversing node representing if statement (if (...) ...) in abstract syntax tree.
Parameters:
n - is a if statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
IfStatement

visit

public void visit(IfElseStatement n)
           throws EvalException
Method responsible for traversing node representing if else statement (if (...) ... else ...) in abstract syntax tree.
Parameters:
n - is a if else statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
IfElseStatement

visit

public void visit(WhileStatement n)
           throws EvalException
Method responsible for traversing node representing while statement (while (...) ...) in abstract syntax tree.
Parameters:
n - is a while statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
WhileStatement

visit

public void visit(ForStatement n)
           throws EvalException
Method responsible for traversing node representing for statement (for (...; ...; ...) ...) in abstract syntax tree.
Parameters:
n - is a for statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
ForStatement

visit

public void visit(DoWhileStatement n)
           throws EvalException
Method responsible for traversing node representing do while statement (do ... while (...) ;) in abstract syntax tree.
Parameters:
n - is a do while statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
DoWhileStatement

visit

public void visit(ForEachStatement n)
           throws EvalException
Method responsible for traversing node representing for each statement (for each ... do ...) in abstract syntax tree.
Parameters:
n - is a for each statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
ForEachStatement

visit

public void visit(DeleteStatement n)
           throws EvalException
Method responsible for traversing node representing delete statement (delet ... ;) in abstract syntax tree.
Parameters:
n - is a delete statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
DeleteStatement

visit

public void visit(RenameToStatement n)
           throws EvalException
Method responsible for traversing node representing rename to statement (rename ... to ... ;) in abstract syntax tree.
Parameters:
n - is a rename to statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
RenameToStatement

visit

public void visit(InsertIntoStatement n)
           throws EvalException
Method responsible for traversing node representing insert into statement (insert ... into ... ;) in abstract syntax tree.
Parameters:
n - is a insert into statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
InsertIntoStatement

visit

public void visit(UpdateToStatement n)
           throws EvalException
Method responsible for traversing node representing update to statement (update ... to ... ;)in abstract syntax tree.
Parameters:
n - is a update to statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
UpdateToStatement

visit

public void visit(EmptyProcedureDeclarationStatement n)
           throws EvalException
Method responsible for traversing node representing empty procedure declaration statement (procedure without parameters) (procedure/function id() { ... }) in abstract syntax tree.
Parameters:
n - is a empty procedure declaration statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
EmptyProcedureDeclarationStatement

visit

public void visit(ProcedureDeclarationStatement n)
           throws EvalException
Method responsible for traversing node representing procedure declaration statement (procedure/function id(...) { ... }) in abstract syntax tree.
Parameters:
n - is a procedure declaration statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
ProcedureDeclarationStatement

visit

public void visit(BreakStatement n)
           throws EvalException
Method responsible for traversing node representing break statement (break ;)in abstract syntax tree.
Parameters:
n - is a break statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
BreakStatement

visit

public void visit(ReturnStatement n)
           throws EvalException
Method responsible for traversing node representing return statement (return ...;) in abstract syntax tree.
Parameters:
n - is a return statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
ReturnStatement

visit

public void visit(EmptyReturnStatement n)
           throws EvalException
Method responsible for traversing node representing empty return statement (return ;) in abstract syntax tree.
Parameters:
n - is a empty return statement node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
EmptyReturnStatement

visit

public void visit(PairStatementList n)
           throws EvalException
Method responsible for traversing node representing pair statement list (... ; ... ;) in abstract syntax tree.
Parameters:
n - is a pair statement list node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
PairStatementList

visit

public void visit(LastStatementList n)
           throws EvalException
Method responsible for traversing node representing last statement list (... ;) in abstract syntax tree.
Parameters:
n - is a last statement list node in abstract syntax tree.
Throws:
EvalException - if evaluation in this node fails.
See Also:
LastStatementList