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 Dims : {@link ASTNode} ::= <span class="component">[{@link Expr}]</span>;
015     * @ast node
016     * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/java.ast:134
017     */
018    public class Dims extends ASTNode<ASTNode> 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 Dims clone() throws CloneNotSupportedException {
034        Dims node = (Dims)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 Dims copy() {
044      
045      try {
046        Dims node = (Dims) 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 Dims fullCopy() {
064      
065      Dims tree = (Dims) 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 Dims() {
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        children = new ASTNode[1];
097        setChild(new Opt(), 0);
098      }
099      /**
100       * @ast method 
101       * 
102       */
103      public Dims(Opt<Expr> p0) {
104        setChild(p0, 0);
105      }
106      /**
107       * @apilevel low-level
108       * @ast method 
109       * 
110       */
111      protected int numChildren() {
112        return 1;
113      }
114      /**
115       * @apilevel internal
116       * @ast method 
117       * 
118       */
119      public boolean mayHaveRewrite() {
120        return false;
121      }
122      /**
123       * Replaces the optional node for the Expr child. This is the {@code Opt} node containing the child Expr, not the actual child!
124       * @param opt The new node to be used as the optional node for the Expr child.
125       * @apilevel low-level
126       * @ast method 
127       * 
128       */
129      public void setExprOpt(Opt<Expr> opt) {
130        setChild(opt, 0);
131      }
132      /**
133       * Check whether the optional Expr child exists.
134       * @return {@code true} if the optional Expr child exists, {@code false} if it does not.
135       * @apilevel high-level
136       * @ast method 
137       * 
138       */
139      public boolean hasExpr() {
140        return getExprOpt().getNumChild() != 0;
141      }
142      /**
143       * Retrieves the (optional) Expr child.
144       * @return The Expr child, if it exists. Returns {@code null} otherwise.
145       * @apilevel low-level
146       * @ast method 
147       * 
148       */
149      @SuppressWarnings({"unchecked", "cast"})
150      public Expr getExpr() {
151        return (Expr)getExprOpt().getChild(0);
152      }
153      /**
154       * Replaces the (optional) Expr child.
155       * @param node The new node to be used as the Expr child.
156       * @apilevel high-level
157       * @ast method 
158       * 
159       */
160      public void setExpr(Expr node) {
161        getExprOpt().setChild(node, 0);
162      }
163      /**
164       * @apilevel low-level
165       * @ast method 
166       * 
167       */
168      @SuppressWarnings({"unchecked", "cast"})
169      public Opt<Expr> getExprOpt() {
170        return (Opt<Expr>)getChild(0);
171      }
172      /**
173       * Retrieves the optional node for child Expr. This is the {@code Opt} node containing the child Expr, not the actual child!
174       * <p><em>This method does not invoke AST transformations.</em></p>
175       * @return The optional node for child Expr.
176       * @apilevel low-level
177       * @ast method 
178       * 
179       */
180      @SuppressWarnings({"unchecked", "cast"})
181      public Opt<Expr> getExprOptNoTransform() {
182        return (Opt<Expr>)getChildNoTransform(0);
183      }
184      /**
185       * @apilevel internal
186       */
187      public ASTNode rewriteTo() {
188        return super.rewriteTo();
189      }
190    }