//
// Generated by JTB 1.2.1
//

package jde.parser.syntaxtree;

/**
 * Grammar production:
 * <PRE>
 * nodeToken -> "do"
 * statement -> Statement()
 * nodeToken1 -> "while"
 * nodeToken2 -> "("
 * expression -> Expression()
 * nodeToken3 -> ")"
 * nodeToken4 -> ";"
 * </PRE>
 */
public class DoStatement implements Node {
   private Node parent;
   public NodeToken nodeToken;
   public Statement statement;
   public NodeToken nodeToken1;
   public NodeToken nodeToken2;
   public Expression expression;
   public NodeToken nodeToken3;
   public NodeToken nodeToken4;

   public DoStatement(NodeToken n0, Statement n1, NodeToken n2, NodeToken n3, Expression n4, NodeToken n5, NodeToken n6) {
      nodeToken = n0;
      if ( nodeToken != null ) nodeToken.setParent(this);
      statement = n1;
      if ( statement != null ) statement.setParent(this);
      nodeToken1 = n2;
      if ( nodeToken1 != null ) nodeToken1.setParent(this);
      nodeToken2 = n3;
      if ( nodeToken2 != null ) nodeToken2.setParent(this);
      expression = n4;
      if ( expression != null ) expression.setParent(this);
      nodeToken3 = n5;
      if ( nodeToken3 != null ) nodeToken3.setParent(this);
      nodeToken4 = n6;
      if ( nodeToken4 != null ) nodeToken4.setParent(this);
   }

   public DoStatement(Statement n0, Expression n1) {
      nodeToken = new NodeToken("do");
      if ( nodeToken != null ) nodeToken.setParent(this);
      statement = n0;
      if ( statement != null ) statement.setParent(this);
      nodeToken1 = new NodeToken("while");
      if ( nodeToken1 != null ) nodeToken1.setParent(this);
      nodeToken2 = new NodeToken("(");
      if ( nodeToken2 != null ) nodeToken2.setParent(this);
      expression = n1;
      if ( expression != null ) expression.setParent(this);
      nodeToken3 = new NodeToken(")");
      if ( nodeToken3 != null ) nodeToken3.setParent(this);
      nodeToken4 = new NodeToken(";");
      if ( nodeToken4 != null ) nodeToken4.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; }
}

