GJDepthFirst.java
//
// Generated by JTB 1.3.2
//
package net.metanotion.sqlc.parser.visitor;
import net.metanotion.sqlc.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 -> [ PkgDecl() ]
* f1 -> ( Import() )*
* f2 -> [ <KW_PUBLIC> ]
* f3 -> <KW_CLASS>
* f4 -> <ID>
* f5 -> <CL_CURLY>
* f6 -> ( Function() )*
* f7 -> <CR_CURLY>
* f8 -> <EOF>
*/
public R visit(Functions 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);
n.f5.accept(this, argu);
n.f6.accept(this, argu);
n.f7.accept(this, argu);
n.f8.accept(this, argu);
return _ret;
}
/**
* f0 -> <KW_PACKAGE>
* f1 -> QName()
* f2 -> <OP_SEMI>
*/
public R visit(PkgDecl n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
n.f2.accept(this, argu);
return _ret;
}
/**
* f0 -> <KW_IMPORT>
* f1 -> QName()
* f2 -> [ <KW_AS> <ID> ]
* f3 -> [ <KW_IMPLICIT> ]
* f4 -> <OP_SEMI>
*/
public R visit(Import 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 -> TypeExpr()
* f1 -> <C_ID>
* f2 -> ParamList()
* f3 -> Body()
*/
public R visit(Function 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);
return _ret;
}
/**
* f0 -> QCName()
* f1 -> [ <L_BRACE> TypeExpr() <R_BRACE> ]
*/
public R visit(TypeExpr n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
return _ret;
}
/**
* f0 -> TypeExpr()
* f1 -> ( <OP_COMMA> TypeExpr() )*
*/
public R visit(TypeList n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
return _ret;
}
/**
* f0 -> <L_PAREN>
* f1 -> [ Params() ]
* f2 -> <R_PAREN>
*/
public R visit(ParamList n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
n.f2.accept(this, argu);
return _ret;
}
/**
* f0 -> Param()
* f1 -> ( <OP_COMMA> Param() )*
*/
public R visit(Params n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
return _ret;
}
/**
* f0 -> QCName()
* f1 -> <C_ID>
*/
public R visit(Param n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
return _ret;
}
/**
* f0 -> <ID>
* f1 -> ( <OP_DOT> <ID> )*
*/
public R visit(QName n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
return _ret;
}
/**
* f0 -> <C_ID>
* f1 -> ( <COP_DOT> <C_ID> )*
*/
public R visit(QCName n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
return _ret;
}
/**
* f0 -> <VID>
* f1 -> ( <VDOT> <VID> )*
*/
public R visit(QVName n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
return _ret;
}
/**
* f0 -> <L_CURLY>
* f1 -> ( SQL() )*
* f2 -> <R_CURLY>
*/
public R visit(Body n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
n.f2.accept(this, argu);
return _ret;
}
/**
* f0 -> PassThru()
* | VarStmt()
*/
public R visit(SQL n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
return _ret;
}
/**
* f0 -> <SELECT>
* | <WITH>
* | <SQL_DS_ESC>
* | <SQL_BS_ESC>
* | <SQL_CHAR>
* | <SQL_OP_SEMI>
* | <SQL_STRING_LITERAL>
*/
public R visit(PassThru n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
return _ret;
}
/**
* f0 -> <VAR_BEG>
* f1 -> ( MacroVar() | InVar() | OutVar() )
*/
public R visit(VarStmt n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
return _ret;
}
/**
* f0 -> <VAT>
* f1 -> <VID>
* f2 -> <VAR_END>
*/
public R visit(MacroVar n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
n.f2.accept(this, argu);
return _ret;
}
/**
* f0 -> <VID>
* f1 -> <VAR_END>
*/
public R visit(InVar n, A argu) {
R _ret=null;
n.f0.accept(this, argu);
n.f1.accept(this, argu);
return _ret;
}
/**
* f0 -> <OUT>
* f1 -> <VID>
* f2 -> [ QVName() ]
* f3 -> <VAR_END>
*/
public R visit(OutVar 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);
return _ret;
}
}