//
// Generated by JTB 1.1.2
//

package jtb.cparser.syntaxtree;

/**
 * Represents an grammar optional node, e.g. ( A )? or [ A ]
 */
public class NodeOptional implements Node {
  static final long serialVersionUID = 20050923L;

   public NodeOptional() {
      node = null;
   }

   public NodeOptional(Node n) {
      addNode(n);
   }

   public void addNode(Node n)  {
      if ( node != null)                // Oh oh!
         throw new Error("Attempt to set optional node twice");

      node = n;
   }
   public void accept(jtb.cparser.visitor.Visitor v) {
      v.visit(this);
   }
   public boolean present()   { return node != null; }

   public Node node;
}

