/* This file was generated with JastAdd2 (http://jastadd.org) version jenkins-JastAdd2-430 */
package AST;

/**
 * @production Opt : {@link ASTNode};
 * @ast node
 * 
 */
public class Opt<T extends ASTNode> extends ASTNode<T> implements Cloneable {
  /**
   * @apilevel internal
   */
  @SuppressWarnings({"unchecked", "cast"})
  public Opt<T> clone() throws CloneNotSupportedException {
    Opt node = (Opt) super.clone();
    node.in$Circle(false);
    node.is$Final(false);
    return node;
  }
  /**
   * @apilevel internal
   */
  @SuppressWarnings({"unchecked", "cast"})
  public Opt<T> copy() {
    try {
      Opt node = (Opt) clone();
      node.parent = null;
      if(children != null) {
        node.children = (ASTNode[]) children.clone();
      }
      return node;
    } catch (CloneNotSupportedException e) {
      throw new Error("Error: clone not supported for " + getClass().getName());
    }
  }
  /**
   * Create a deep copy of the AST subtree at this node.
   * The copy is dangling, i.e. has no parent.
   * @return dangling copy of the subtree at this node
   * @apilevel low-level
   */
  @SuppressWarnings({"unchecked", "cast"})
  public Opt<T> fullCopy() {
    Opt tree = (Opt) copy();
    if (children != null) {
      for (int i = 0; i < children.length; ++i) {
        ASTNode child = (ASTNode) children[i];
        if(child != null) {
          child = child.fullCopy();
          tree.setChild(child, i);
        }
      }
    }
    return tree;
  }
  /**
   * 
   * @ast method
   * 
   */

  public Opt() {
    super();
  }
  /**
   * 
     * Initializes the child array to the correct size.
     * Initializes List and Opt nta children.
     * @apilevel internal
     * @ast method
     
   * @ast method
   * 
   */

  public void init$Children() {
  }
  /**
   * 
   * @ast method
   * 
   */

  public Opt(T opt) {
    setChild(opt, 0);
  }
  /**
   * 
     * @apilevel internal
     
   * @ast method
   * 
   */

  public boolean mayHaveRewrite() {
    return false;
  }
  /**
   * 
      * @apilevel low-level
      
   * @ast method
   * 
   */

  public void flushCache() {
    super.flushCache();
      }
  /**
   * 
      * @apilevel internal
      
   * @ast method
   * 
   */

  public void flushCollectionCache() {
    super.flushCollectionCache();
      }
  /**
   * @apilevel internal
   */
  public ASTNode rewriteTo() {    return super.rewriteTo();
  }}
