/* Generated by JTB 1.5.1 */
package grammars.fm.visitor;

import static grammars.fm.syntaxtree.NodeConstants.*;
import grammars.fm.Token;
import grammars.fm.syntaxtree.*;
import grammars.fm.visitor.signature.NodeFieldsSignature;

@SuppressWarnings("javadoc")
public class DepthFirstVis2Visitor implements IVis2Visitor {


  @Override
  public int visit(final NodeChoice n, final String argu) {
    /* You have to adapt which data is returned (result variables below are just examples) */
    final int nRes = n.choice.accept(this, argu);
    return nRes;
  }

  @Override
  public int visit(final NodeList n, final String argu) {
    /* You have to adapt which data is returned (result variables below are just examples) */
    int nRes = 0;
    for (INode e : n.nodes) {
      @SuppressWarnings("unused")
      final int sRes = e.accept(this, argu);
    }
    return nRes;
  }

  @Override
  public int visit(final NodeListOptional n, final String argu) {
    /* You have to adapt which data is returned (result variables below are just examples) */
    if (n.present()) {
      int nRes = 0;
      for (INode e : n.nodes) {
        @SuppressWarnings("unused")
        int sRes = e.accept(this, argu);
      }
      return nRes;
    }
    return 0;
  }

  @Override
  public int visit(final NodeOptional n, final String argu) {
    /* You have to adapt which data is returned (result variables below are just examples) */
    if (n.present()) {
      final int nRes = n.node.accept(this, argu);
      return nRes;
    }
    return 0;
  }

  @Override
  public int visit(final NodeSequence n, final String argu) {
    /* You have to adapt which data is returned (result variables below are just examples) */
    int nRes = 0;
    for (INode e : n.nodes) {
      @SuppressWarnings("unused")
      int subRet = e.accept(this, argu);
    }
    return nRes;
  }

  @Override
  public int visit(final Token n, @SuppressWarnings("unused") final String argu) {
    /* You have to adapt which data is returned (result variables below are just examples) */
    int nRes = 0;
    @SuppressWarnings("unused")
    final String tkIm = n.image;
    return nRes;
  }

  @Override
  @NodeFieldsSignature({ 0, JTB_SIG_CLASSDECLARATION, JTB_USER_CLASSDECLARATION })
  public int visit(final classDeclaration n, final String argu) {
    int nRes = 0;
    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);
    return nRes;
  }

  @Override
  @NodeFieldsSignature({ 0, JTB_SIG_CLASSNAME, JTB_USER_CLASSNAME })
  public int visit(final className n, final String argu) {
    int nRes = 0;
    n.f0.accept(this, argu);
    return nRes;
  }

  @Override
  @NodeFieldsSignature({ 0, JTB_SIG_METHOD, JTB_USER_METHOD })
  public int visit(final method n, final String argu) {
    int nRes = 0;
    n.f0.accept(this, argu);
    n.f1.accept(this, argu);
    n.f2.accept(this, argu);
    n.f3.accept(this, argu);
    return nRes;
  }

  @Override
  @NodeFieldsSignature({ 0, JTB_SIG_METHODNAME, JTB_USER_METHODNAME })
  public int visit(final methodName n, final String argu) {
    int nRes = 0;
    n.f0.accept(this, argu);
    return nRes;
  }

  @Override
  @NodeFieldsSignature({ 0, JTB_SIG_INSTRUCTION, JTB_USER_INSTRUCTION })
  public int visit(final instruction n, final String argu) {
    int nRes = 0;
    n.f0.accept(this, argu);
    n.f1.accept(this, argu);
    return nRes;
  }

  @SuppressWarnings("unused")
  @Override
  @NodeFieldsSignature({ 0, JTB_SIG_SKIP, JTB_USER_SKIP })
  public int visit(final skip n, final String argu) {
    int nRes = 0;
    /* empty node, nothing that can be generated so far */
    return nRes;
  }

}
