001    /* This file was generated with JastAdd2 (http://jastadd.org) version R20130213 */
002    package AST;
003    
004    import java.util.HashSet;
005    import java.io.File;
006    import java.util.*;
007    import beaver.*;
008    import java.util.ArrayList;
009    import java.util.zip.*;
010    import java.io.*;
011    import java.io.FileNotFoundException;
012    import java.util.Collection;
013    /**
014     * @production Opt : {@link ASTNode};
015     * @ast node
016     * 
017     */
018    public class Opt<T extends ASTNode> extends ASTNode<T> implements Cloneable {
019      /**
020       * @apilevel low-level
021       */
022      public void flushCache() {
023      }
024      /**
025       * @apilevel internal
026       */
027      public void flushCollectionCache() {
028      }
029      /**
030       * @apilevel internal
031       */
032      @SuppressWarnings({"unchecked", "cast"})
033      public Opt<T> clone() throws CloneNotSupportedException {
034        Opt node = (Opt)super.clone();
035        node.in$Circle(false);
036        node.is$Final(false);
037        return node;
038      }
039    /**
040     * @apilevel internal
041     */
042      @SuppressWarnings({"unchecked", "cast"})
043    public Opt<T> copy() {
044      
045      try {
046        Opt node = (Opt) clone();
047        node.parent = null;
048        if(children != null)
049          node.children = (ASTNode[]) children.clone();
050        
051        return node;
052      } catch (CloneNotSupportedException e) {
053        throw new Error("Error: clone not supported for " + getClass().getName());
054      }
055      
056    }/**
057     * Create a deep copy of the AST subtree at this node.
058     * The copy is dangling, i.e. has no parent.
059     * @return dangling copy of the subtree at this node
060     * @apilevel low-level
061     */
062      @SuppressWarnings({"unchecked", "cast"})
063    public Opt<T> fullCopy() {
064      
065      Opt tree = (Opt) copy();
066      if (children != null) {
067        for (int i = 0; i < children.length; ++i) {
068          
069          ASTNode child = (ASTNode) children[i];
070          if(child != null) {
071            child = child.fullCopy();
072            tree.setChild(child, i);
073          }
074        }
075      }
076      return tree;
077      
078    }  /**
079       * @ast method 
080       * 
081       */
082      public Opt() {
083        super();
084    
085    
086      }
087      /**
088       * Initializes the child array to the correct size.
089       * Initializes List and Opt nta children.
090       * @apilevel internal
091       * @ast method
092       * @ast method 
093       * 
094       */
095      public void init$Children() {
096      }
097      /**
098       * @ast method 
099       * 
100       */
101      public Opt(T opt) {
102        setChild(opt, 0);
103      }
104      /**
105       * @apilevel internal
106       * @ast method 
107       * 
108       */
109      public boolean mayHaveRewrite() {
110        return false;
111      }
112      /**
113       * @attribute syn
114       * @aspect CreateBCode
115       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CreateBCode.jrag:946
116       */
117      public boolean definesLabel() {
118        ASTNode$State state = state();
119        try {  return getParent().definesLabel();  }
120        finally {
121        }
122      }
123      /**
124       * @apilevel internal
125       */
126      public ASTNode rewriteTo() {
127        return super.rewriteTo();
128      }
129    }