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     * 7.5.4 A static-import-on-demand declaration allows all accessible (\u00a76.6) static
015     * members declared in the type named by a canonical name to be imported as
016     * needed.
017     * @production StaticImportOnDemandDecl : {@link StaticImportDecl};
018     * @ast node
019     * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/StaticImports.ast:19
020     */
021    public class StaticImportOnDemandDecl extends StaticImportDecl implements Cloneable {
022      /**
023       * @apilevel low-level
024       */
025      public void flushCache() {
026      }
027      /**
028       * @apilevel internal
029       */
030      public void flushCollectionCache() {
031      }
032      /**
033       * @apilevel internal
034       */
035      @SuppressWarnings({"unchecked", "cast"})
036      public StaticImportOnDemandDecl clone() throws CloneNotSupportedException {
037        StaticImportOnDemandDecl node = (StaticImportOnDemandDecl)super.clone();
038        node.in$Circle(false);
039        node.is$Final(false);
040        return node;
041      }
042    /**
043     * @apilevel internal
044     */
045      @SuppressWarnings({"unchecked", "cast"})
046    public StaticImportOnDemandDecl copy() {
047      
048      try {
049        StaticImportOnDemandDecl node = (StaticImportOnDemandDecl) clone();
050        node.parent = null;
051        if(children != null)
052          node.children = (ASTNode[]) children.clone();
053        
054        return node;
055      } catch (CloneNotSupportedException e) {
056        throw new Error("Error: clone not supported for " + getClass().getName());
057      }
058      
059    }/**
060     * Create a deep copy of the AST subtree at this node.
061     * The copy is dangling, i.e. has no parent.
062     * @return dangling copy of the subtree at this node
063     * @apilevel low-level
064     */
065      @SuppressWarnings({"unchecked", "cast"})
066    public StaticImportOnDemandDecl fullCopy() {
067      
068      StaticImportOnDemandDecl tree = (StaticImportOnDemandDecl) copy();
069      if (children != null) {
070        for (int i = 0; i < children.length; ++i) {
071          
072          ASTNode child = (ASTNode) children[i];
073          if(child != null) {
074            child = child.fullCopy();
075            tree.setChild(child, i);
076          }
077        }
078      }
079      return tree;
080      
081    }  /**
082       * @ast method 
083       * @aspect StaticImports
084       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/StaticImports.jrag:213
085       */
086      public void toString(StringBuffer s) {
087        s.append("import static ");
088        getAccess().toString(s);
089        s.append(".*;\n");
090      }
091      /**
092       * @ast method 
093       * 
094       */
095      public StaticImportOnDemandDecl() {
096        super();
097    
098    
099      }
100      /**
101       * Initializes the child array to the correct size.
102       * Initializes List and Opt nta children.
103       * @apilevel internal
104       * @ast method
105       * @ast method 
106       * 
107       */
108      public void init$Children() {
109        children = new ASTNode[1];
110      }
111      /**
112       * @ast method 
113       * 
114       */
115      public StaticImportOnDemandDecl(Access p0) {
116        setChild(p0, 0);
117      }
118      /**
119       * @apilevel low-level
120       * @ast method 
121       * 
122       */
123      protected int numChildren() {
124        return 1;
125      }
126      /**
127       * @apilevel internal
128       * @ast method 
129       * 
130       */
131      public boolean mayHaveRewrite() {
132        return false;
133      }
134      /**
135       * Replaces the Access child.
136       * @param node The new node to replace the Access child.
137       * @apilevel high-level
138       * @ast method 
139       * 
140       */
141      public void setAccess(Access node) {
142        setChild(node, 0);
143      }
144      /**
145       * Retrieves the Access child.
146       * @return The current node used as the Access child.
147       * @apilevel high-level
148       * @ast method 
149       * 
150       */
151      public Access getAccess() {
152        return (Access)getChild(0);
153      }
154      /**
155       * Retrieves the Access child.
156       * <p><em>This method does not invoke AST transformations.</em></p>
157       * @return The current node used as the Access child.
158       * @apilevel low-level
159       * @ast method 
160       * 
161       */
162      public Access getAccessNoTransform() {
163        return (Access)getChildNoTransform(0);
164      }
165      /**
166       * @attribute syn
167       * @aspect StaticImports
168       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/StaticImports.jrag:53
169       */
170      public TypeDecl type() {
171        ASTNode$State state = state();
172        try {  return getAccess().type();  }
173        finally {
174        }
175      }
176      /**
177       * @attribute syn
178       * @aspect TypeScopePropagation
179       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/LookupType.jrag:351
180       */
181      public boolean isOnDemand() {
182        ASTNode$State state = state();
183        try {  return true;  }
184        finally {
185        }
186      }
187      /**
188       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/StaticImports.jrag:204
189       * @apilevel internal
190       */
191      public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
192        if(caller == getAccessNoTransform()) {
193          return NameType.TYPE_NAME;
194        }
195        else {      return getParent().Define_NameType_nameType(this, caller);
196        }
197      }
198      /**
199       * @apilevel internal
200       */
201      public ASTNode rewriteTo() {
202        return super.rewriteTo();
203      }
204    }