//
// Generated by JTB 1.2.1
//

package jde.parser.syntaxtree;

/**
 * Grammar production:
 * <PRE>
 * nodeToken -> "switch"
 * nodeToken1 -> "("
 * expression -> Expression()
 * nodeToken2 -> ")"
 * nodeToken3 -> "{"
 * nodeListOptional -> ( SwitchLabel() ( BlockStatement() )* )*
 * nodeToken4 -> "}"
 * </PRE>
 */
public class SwitchStatement implements Node {
   private Node parent;
   public NodeToken nodeToken;
   public NodeToken nodeToken1;
   public Expression expression;
   public NodeToken nodeToken2;
   public NodeToken nodeToken3;
   public NodeListOptional nodeListOptional;
   public NodeToken nodeToken4;

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

   public SwitchStatement(Expression n0, NodeListOptional n1) {
      nodeToken = new NodeToken("switch");
      if ( nodeToken != null ) nodeToken.setParent(this);
      nodeToken1 = new NodeToken("(");
      if ( nodeToken1 != null ) nodeToken1.setParent(this);
      expression = n0;
      if ( expression != null ) expression.setParent(this);
      nodeToken2 = new NodeToken(")");
      if ( nodeToken2 != null ) nodeToken2.setParent(this);
      nodeToken3 = new NodeToken("{");
      if ( nodeToken3 != null ) nodeToken3.setParent(this);
      nodeListOptional = n1;
      if ( nodeListOptional != null ) nodeListOptional.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; }
}

