/* Generated by JTB 1.5.1 */
package examples.java.ex1jtb.visitor;

import static examples.java.ex1jtb.syntaxtree.NodeConstants.*;
import examples.java.ex1jtb.Token;
import examples.java.ex1jtb.syntaxtree.*;
import examples.java.ex1jtb.visitor.signature.NodeFieldsSignature;

@SuppressWarnings("javadoc")
public class DepthFirstGenVisitor implements IGenVisitor {


  @Override
  public void visit(final NodeChoice n, final String argu) {
    n.choice.accept(this, argu);
    return;
  }

  @Override
  public void visit(final NodeList n, final String argu) {
    for (INode e : n.nodes) {
      e.accept(this, argu);
    }
    return;
  }

  @Override
  public void visit(final NodeListOptional n, final String argu) {
    if (n.present()) {
      for (INode e : n.nodes) {
        e.accept(this, argu);
      }
      return;
    }
    return;
  }

  @Override
  public void visit(final NodeOptional n, final String argu) {
    if (n.present()) {
      n.node.accept(this, argu);
      return;
    }
    return;
  }

  @Override
  public void visit(final NodeSequence n, final String argu) {
    for (INode e : n.nodes) {
      e.accept(this, argu);
    }
    return;
  }

  @Override
  public void visit(final Token n, @SuppressWarnings("unused") final String argu) {
    @SuppressWarnings("unused")
    final String tkIm = n.image;
    return;
  }

  @Override
  @NodeFieldsSignature({ 0, JTB_SIG_START, JTB_USER_START })
  public void visit(final Start n, final String argu) {
    n.f0.accept(this, argu);
    n.f1.accept(this, argu);
  }

  @Override
  @NodeFieldsSignature({ 0, JTB_SIG_EXPRESSION, JTB_USER_EXPRESSION })
  public void visit(final Expression n, final String argu) {
    n.f0.accept(this, argu);
  }

  @Override
  @NodeFieldsSignature({ 0, JTB_SIG_ADDITIVEEXPRESSION, JTB_USER_ADDITIVEEXPRESSION })
  public void visit(final AdditiveExpression n, final String argu) {
    n.f0.accept(this, argu);
    n.f1.accept(this, argu);
  }

  @Override
  @NodeFieldsSignature({ 0, JTB_SIG_MULTIPLICATIVEEXPRESSION, JTB_USER_MULTIPLICATIVEEXPRESSION })
  public void visit(final MultiplicativeExpression n, final String argu) {
    n.f0.accept(this, argu);
    n.f1.accept(this, argu);
  }

  @Override
  @NodeFieldsSignature({ 0, JTB_SIG_UNARYEXPRESSION, JTB_USER_UNARYEXPRESSION })
  public void visit(final UnaryExpression n, final String argu) {
    n.f0.accept(this, argu);
  }

  @Override
  @NodeFieldsSignature({ 0, JTB_SIG_IDENTIFIER, JTB_USER_IDENTIFIER })
  public void visit(final Identifier n, final String argu) {
    n.f0.accept(this, argu);
  }

  @Override
  @NodeFieldsSignature({ 0, JTB_SIG_EGINTEGER, JTB_USER_EGINTEGER })
  public void visit(final EgInteger n, final String argu) {
    n.f0.accept(this, argu);
    n.f1.accept(this, argu);
  }

  @SuppressWarnings("unused")
  @Override
  @NodeFieldsSignature({ 0, JTB_SIG_JC_1, JTB_USER_JC_1 })
  public void visit(final jc_1 n, final String argu) {
    /* empty node, nothing that can be generated so far */
  }

}
