GJDepthFirst.java
//
// Generated by JTB 1.3.2
//
package net.metanotion.sqltest.parser.visitor;
import net.metanotion.sqltest.parser.syntaxtree.*;
import java.util.*;
/**
* Provides default methods which visit each node in the tree in depth-first
* order. Your visitors may extend this class.
*/
public class GJDepthFirst<R,A> implements GJVisitor<R,A> {
//
// Auto class visitors--probably don't need to be overridden.
//
public R visit(NodeList n, A argu) {
R _ret=null;
int _count=0;
for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
e.nextElement().accept(this,argu);
_count++;
}
return _ret;
}
public R visit(NodeListOptional n, A argu) {
if ( n.present() ) {
R _ret=null;
int _count=0;
for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
e.nextElement().accept(this,argu);
_count++;
}
return _ret;
}
else
return null;
}
public R visit(NodeOptional n, A argu) {
if ( n.present() )
return n.node.accept(this,argu);
else
return null;
}
public R visit(NodeSequence n, A argu) {
R _ret=null;
int _count=0;
for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
e.nextElement().accept(this,argu);
_count++;
}
return _ret;
}
public R visit(NodeToken n, A argu) { return null; }
//
// User-generated visitor methods below
//
/**
* f0 -> ( TestStatement() )*
*/
public R visit(Expressions n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
return _ret;
}
/**
* f0 -> SideEffect()
* | TestExpression()
* | Capture()
* | Imports()
*/
public R visit(TestStatement n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
return _ret;
}
/**
* f0 -> Apply()
* | <STRING_LITERAL>
* | <SQSTRING_LITERAL>
*/
public R visit(Executable n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
return _ret;
}
/**
* f0 -> <EXECUTE>
* f1 -> Executable()
* f2 -> <OP_SEMI>
*/
public R visit(SideEffect n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
n.f2.accept(this, argu);
return _ret;
}
/**
* f0 -> <LET>
* f1 -> <ID>
* f2 -> <OP_EQ>
* f3 -> Executable()
* f4 -> <OP_SEMI>
*/
public R visit(Capture n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
n.f2.accept(this, argu);
n.f3.accept(this, argu);
n.f4.accept(this, argu);
return _ret;
}
/**
* f0 -> <CHECK>
* f1 -> Executable()
* f2 -> <OP_EQ>
* f3 -> ValueExpr()
* f4 -> <OP_SEMI>
*/
public R visit(TestExpression n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
n.f2.accept(this, argu);
n.f3.accept(this, argu);
n.f4.accept(this, argu);
return _ret;
}
/**
* f0 -> <IMPORT>
* f1 -> <ID>
* f2 -> ( <OP_DOT> <ID> )*
* f3 -> [ <AS> <ID> ]
* f4 -> <OP_SEMI>
*/
public R visit(Imports n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
n.f2.accept(this, argu);
n.f3.accept(this, argu);
n.f4.accept(this, argu);
return _ret;
}
/**
* f0 -> Literal()
* | <ID>
*/
public R visit(SimpleValue n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
return _ret;
}
/**
* f0 -> [ <ID> <OP_DOT> ]
* f1 -> <ID>
* f2 -> <L_PAREN>
* f3 -> [ Params() ]
* f4 -> <R_PAREN>
*/
public R visit(Apply n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
n.f2.accept(this, argu);
n.f3.accept(this, argu);
n.f4.accept(this, argu);
return _ret;
}
/**
* f0 -> SimpleValue()
* f1 -> ( <OP_COMMA> SimpleValue() )*
*/
public R visit(Params n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
return _ret;
}
/**
* f0 -> <DECIMAL_LITERAL>
* | <FLOAT_LITERAL>
* | <STRING_LITERAL>
* | <SQSTRING_LITERAL>
* | <BOOLEAN_LITERAL>
* | <NULL_LITERAL>
* | <ERROR_LITERAL>
* | <ANY_LITERAL>
*/
public R visit(Literal n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
return _ret;
}
/**
* f0 -> Literal()
* | Obj()
* | Arr()
* | <ID>
*/
public R visit(ValueExpr n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
return _ret;
}
/**
* f0 -> <L_CURLY>
* f1 -> [ WithParams() ]
* f2 -> <R_CURLY>
*/
public R visit(Obj n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
n.f2.accept(this, argu);
return _ret;
}
/**
* f0 -> <L_BRACE>
* f1 -> [ ValueList() ]
* f2 -> <R_BRACE>
*/
public R visit(Arr n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
n.f2.accept(this, argu);
return _ret;
}
/**
* f0 -> ValueExpr()
* f1 -> ( <OP_COMMA> ValueExpr() )*
*/
public R visit(ValueList n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
return _ret;
}
/**
* f0 -> WithParam()
* f1 -> ( <OP_COMMA> WithParam() )*
*/
public R visit(WithParams n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
return _ret;
}
/**
* f0 -> <ID>
* | <STRING_LITERAL>
* | <SQSTRING_LITERAL>
*/
public R visit(Key n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
return _ret;
}
/**
* f0 -> Key()
* f1 -> <OP_WITH>
* f2 -> SimpleValue()
*/
public R visit(WithParam n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
n.f2.accept(this, argu);
return _ret;
}
}