//
// Generated by JTB 1.3.2 DIT@UoA patched
//

package visitor;
import 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 GJVoidDepthFirst<A> implements GJVoidVisitor<A> {
   //
   // Auto class visitors--probably don't need to be overridden.
   //
   public void visit(NodeList n, A argu) {
      int _count=0;
      for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
         e.nextElement().accept(this,argu);
         _count++;
      }
   }

   public void visit(NodeListOptional n, A argu) {
      if ( n.present() ) {
         int _count=0;
         for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
            e.nextElement().accept(this,argu);
            _count++;
         }
      }
   }

   public void visit(NodeOptional n, A argu) {
      if ( n.present() )
         n.node.accept(this,argu);
   }

   public void visit(NodeSequence n, A argu) {
      int _count=0;
      for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); ) {
         e.nextElement().accept(this,argu);
         _count++;
      }
   }

   public void visit(NodeToken n, A argu) {}

   //
   // User-generated visitor methods below
   //

   /**
    * f0 -> AdditiveExpression()
    * f1 -> <EOF>
    */
   public void visit(Goal n, A argu) {
      n.f0.accept(this, argu);
      n.f1.accept(this, argu);
   }

   /**
    * f0 -> MultiplicativeExpression()
    * f1 -> AdditiveExpressionTail()
    */
   public void visit(AdditiveExpression n, A argu) {
      n.f0.accept(this, argu);
      n.f1.accept(this, argu);
   }

   /**
    * f0 -> ( AdditiveExpressionTerm() )*
    */
   public void visit(AdditiveExpressionTail n, A argu) {
      n.f0.accept(this, argu);
   }

   /**
    * f0 -> PlusExpression()
    *       | MinusExpression()
    */
   public void visit(AdditiveExpressionTerm n, A argu) {
      n.f0.accept(this, argu);
   }

   /**
    * f0 -> "+"
    * f1 -> MultiplicativeExpression()
    */
   public void visit(PlusExpression n, A argu) {
      n.f0.accept(this, argu);
      n.f1.accept(this, argu);
   }

   /**
    * f0 -> "-"
    * f1 -> MultiplicativeExpression()
    */
   public void visit(MinusExpression n, A argu) {
      n.f0.accept(this, argu);
      n.f1.accept(this, argu);
   }

   /**
    * f0 -> PrimaryExpression()
    * f1 -> MultiplicativeExpressionTail()
    */
   public void visit(MultiplicativeExpression n, A argu) {
      n.f0.accept(this, argu);
      n.f1.accept(this, argu);
   }

   /**
    * f0 -> ( MultiplicativeExpressionTerm() )*
    */
   public void visit(MultiplicativeExpressionTail n, A argu) {
      n.f0.accept(this, argu);
   }

   /**
    * f0 -> MultExpression()
    *       | DivExpression()
    */
   public void visit(MultiplicativeExpressionTerm n, A argu) {
      n.f0.accept(this, argu);
   }

   /**
    * f0 -> "*"
    * f1 -> PrimaryExpression()
    */
   public void visit(MultExpression n, A argu) {
      n.f0.accept(this, argu);
      n.f1.accept(this, argu);
   }

   /**
    * f0 -> "/"
    * f1 -> PrimaryExpression()
    */
   public void visit(DivExpression n, A argu) {
      n.f0.accept(this, argu);
      n.f1.accept(this, argu);
   }

   /**
    * f0 -> Constant()
    *       | BracketExpression()
    */
   public void visit(PrimaryExpression n, A argu) {
      n.f0.accept(this, argu);
   }

   /**
    * f0 -> "("
    * f1 -> AdditiveExpression()
    * f2 -> ")"
    */
   public void visit(BracketExpression n, A argu) {
      n.f0.accept(this, argu);
      n.f1.accept(this, argu);
      n.f2.accept(this, argu);
   }

   /**
    * f0 -> <NUMBER>
    */
   public void visit(Constant n, A argu) {
      n.f0.accept(this, argu);
   }

}
