//
// Generated by JTB 1.2.1
//

package jde.parser.syntaxtree;

/**
 * Grammar production:
 * <PRE>
 * nodeToken -> "for"
 * nodeToken1 -> "("
 * nodeOptional -> [ ForInit() ]
 * nodeToken2 -> ";"
 * nodeOptional1 -> [ Expression() ]
 * nodeToken3 -> ";"
 * nodeOptional2 -> [ ForUpdate() ]
 * nodeToken4 -> ")"
 * statement -> Statement()
 * </PRE>
 */
public class ForStatement implements Node {
   private Node parent;
   public NodeToken nodeToken;
   public NodeToken nodeToken1;
   public NodeOptional nodeOptional;
   public NodeToken nodeToken2;
   public NodeOptional nodeOptional1;
   public NodeToken nodeToken3;
   public NodeOptional nodeOptional2;
   public NodeToken nodeToken4;
   public Statement statement;

   public ForStatement(NodeToken n0, NodeToken n1, NodeOptional n2, NodeToken n3, NodeOptional n4, NodeToken n5, NodeOptional n6, NodeToken n7, Statement n8) {
      nodeToken = n0;
      if ( nodeToken != null ) nodeToken.setParent(this);
      nodeToken1 = n1;
      if ( nodeToken1 != null ) nodeToken1.setParent(this);
      nodeOptional = n2;
      if ( nodeOptional != null ) nodeOptional.setParent(this);
      nodeToken2 = n3;
      if ( nodeToken2 != null ) nodeToken2.setParent(this);
      nodeOptional1 = n4;
      if ( nodeOptional1 != null ) nodeOptional1.setParent(this);
      nodeToken3 = n5;
      if ( nodeToken3 != null ) nodeToken3.setParent(this);
      nodeOptional2 = n6;
      if ( nodeOptional2 != null ) nodeOptional2.setParent(this);
      nodeToken4 = n7;
      if ( nodeToken4 != null ) nodeToken4.setParent(this);
      statement = n8;
      if ( statement != null ) statement.setParent(this);
   }

   public ForStatement(NodeOptional n0, NodeOptional n1, NodeOptional n2, Statement n3) {
      nodeToken = new NodeToken("for");
      if ( nodeToken != null ) nodeToken.setParent(this);
      nodeToken1 = new NodeToken("(");
      if ( nodeToken1 != null ) nodeToken1.setParent(this);
      nodeOptional = n0;
      if ( nodeOptional != null ) nodeOptional.setParent(this);
      nodeToken2 = new NodeToken(";");
      if ( nodeToken2 != null ) nodeToken2.setParent(this);
      nodeOptional1 = n1;
      if ( nodeOptional1 != null ) nodeOptional1.setParent(this);
      nodeToken3 = new NodeToken(";");
      if ( nodeToken3 != null ) nodeToken3.setParent(this);
      nodeOptional2 = n2;
      if ( nodeOptional2 != null ) nodeOptional2.setParent(this);
      nodeToken4 = new NodeToken(")");
      if ( nodeToken4 != null ) nodeToken4.setParent(this);
      statement = n3;
      if ( statement != null ) statement.setParent(this);
   }

   public void accept(jde.parser.visitor.Visitor v) {
      v.visit(this);
   }
   public Object accept(jde.parser.visitor.ObjectVisitor v, Object argu) {
      return v.visit(this,argu);
   }
   public void setParent(Node n) { parent = n; }
   public Node getParent()       { return parent; }
}

