GJNoArguDepthFirst.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 GJNoArguDepthFirst<R> implements GJNoArguVisitor<R> {
   //
   // Auto class visitors--probably don't need to be overridden.
   //
   public R visit(NodeList n) {
      R _ret=null;
      int _count=0;
      for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
         e.nextElement().accept(this);
         _count++;
      }
      return _ret;
   }

   public R visit(NodeListOptional n) {
      if ( n.present() ) {
         R _ret=null;
         int _count=0;
         for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
            e.nextElement().accept(this);
            _count++;
         }
         return _ret;
      }
      else
         return null;
   }

   public R visit(NodeOptional n) {
      if ( n.present() )
         return n.node.accept(this);
      else
         return null;
   }

   public R visit(NodeSequence n) {
      R _ret=null;
      int _count=0;
      for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
         e.nextElement().accept(this);
         _count++;
      }
      return _ret;
   }

   public R visit(NodeToken n) { 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) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      n.f2.accept(this);
      n.f3.accept(this);
      n.f4.accept(this);
      n.f5.accept(this);
      n.f6.accept(this);
      n.f7.accept(this);
      n.f8.accept(this);
      return _ret;
   }

   /**
    * f0 -> <KW_PACKAGE>
    * f1 -> QName()
    * f2 -> <OP_SEMI>
    */
   public R visit(PkgDecl n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      n.f2.accept(this);
      return _ret;
   }

   /**
    * f0 -> <KW_IMPORT>
    * f1 -> QName()
    * f2 -> [ <KW_AS> <ID> ]
    * f3 -> [ <KW_IMPLICIT> ]
    * f4 -> <OP_SEMI>
    */
   public R visit(Import n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      n.f2.accept(this);
      n.f3.accept(this);
      n.f4.accept(this);
      return _ret;
   }

   /**
    * f0 -> TypeExpr()
    * f1 -> <C_ID>
    * f2 -> ParamList()
    * f3 -> Body()
    */
   public R visit(Function n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      n.f2.accept(this);
      n.f3.accept(this);
      return _ret;
   }

   /**
    * f0 -> QCName()
    * f1 -> [ <L_BRACE> TypeExpr() <R_BRACE> ]
    */
   public R visit(TypeExpr n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      return _ret;
   }

   /**
    * f0 -> TypeExpr()
    * f1 -> ( <OP_COMMA> TypeExpr() )*
    */
   public R visit(TypeList n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      return _ret;
   }

   /**
    * f0 -> <L_PAREN>
    * f1 -> [ Params() ]
    * f2 -> <R_PAREN>
    */
   public R visit(ParamList n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      n.f2.accept(this);
      return _ret;
   }

   /**
    * f0 -> Param()
    * f1 -> ( <OP_COMMA> Param() )*
    */
   public R visit(Params n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      return _ret;
   }

   /**
    * f0 -> QCName()
    * f1 -> <C_ID>
    */
   public R visit(Param n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      return _ret;
   }

   /**
    * f0 -> <ID>
    * f1 -> ( <OP_DOT> <ID> )*
    */
   public R visit(QName n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      return _ret;
   }

   /**
    * f0 -> <C_ID>
    * f1 -> ( <COP_DOT> <C_ID> )*
    */
   public R visit(QCName n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      return _ret;
   }

   /**
    * f0 -> <VID>
    * f1 -> ( <VDOT> <VID> )*
    */
   public R visit(QVName n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      return _ret;
   }

   /**
    * f0 -> <L_CURLY>
    * f1 -> ( SQL() )*
    * f2 -> <R_CURLY>
    */
   public R visit(Body n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      n.f2.accept(this);
      return _ret;
   }

   /**
    * f0 -> PassThru()
    *       | VarStmt()
    */
   public R visit(SQL n) {
      R _ret=null;
      n.f0.accept(this);
      return _ret;
   }

   /**
    * f0 -> <SELECT>
    *       | <WITH>
    *       | <SQL_DS_ESC>
    *       | <SQL_BS_ESC>
    *       | <SQL_CHAR>
    *       | <SQL_OP_SEMI>
    *       | <SQL_STRING_LITERAL>
    */
   public R visit(PassThru n) {
      R _ret=null;
      n.f0.accept(this);
      return _ret;
   }

   /**
    * f0 -> <VAR_BEG>
    * f1 -> ( MacroVar() | InVar() | OutVar() )
    */
   public R visit(VarStmt n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      return _ret;
   }

   /**
    * f0 -> <VAT>
    * f1 -> <VID>
    * f2 -> <VAR_END>
    */
   public R visit(MacroVar n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      n.f2.accept(this);
      return _ret;
   }

   /**
    * f0 -> <VID>
    * f1 -> <VAR_END>
    */
   public R visit(InVar n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      return _ret;
   }

   /**
    * f0 -> <OUT>
    * f1 -> <VID>
    * f2 -> [ QVName() ]
    * f3 -> <VAR_END>
    */
   public R visit(OutVar n) {
      R _ret=null;
      n.f0.accept(this);
      n.f1.accept(this);
      n.f2.accept(this);
      n.f3.accept(this);
      return _ret;
   }

}