//
// Generated by JTB 1.2.1
//

package jde.parser.syntaxtree;

/**
 * Grammar production:
 * <PRE>
 * nodeToken -> "try"
 * block -> Block()
 * nodeListOptional -> ( "catch" "(" FormalParameter() ")" Block() )*
 * nodeOptional -> [ "finally" Block() ]
 * </PRE>
 */
public class TryStatement implements Node {
   private Node parent;
   public NodeToken nodeToken;
   public Block block;
   public NodeListOptional nodeListOptional;
   public NodeOptional nodeOptional;

   public TryStatement(NodeToken n0, Block n1, NodeListOptional n2, NodeOptional n3) {
      nodeToken = n0;
      if ( nodeToken != null ) nodeToken.setParent(this);
      block = n1;
      if ( block != null ) block.setParent(this);
      nodeListOptional = n2;
      if ( nodeListOptional != null ) nodeListOptional.setParent(this);
      nodeOptional = n3;
      if ( nodeOptional != null ) nodeOptional.setParent(this);
   }

   public TryStatement(Block n0, NodeListOptional n1, NodeOptional n2) {
      nodeToken = new NodeToken("try");
      if ( nodeToken != null ) nodeToken.setParent(this);
      block = n0;
      if ( block != null ) block.setParent(this);
      nodeListOptional = n1;
      if ( nodeListOptional != null ) nodeListOptional.setParent(this);
      nodeOptional = n2;
      if ( nodeOptional != null ) nodeOptional.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; }
}

