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 AbstractWildcardType : {@link TypeDecl};
015     * @ast node
016     * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.ast:25
017     */
018    public abstract class AbstractWildcardType extends TypeDecl 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 AbstractWildcardType clone() throws CloneNotSupportedException {
034        AbstractWildcardType node = (AbstractWildcardType)super.clone();
035        node.needsSignatureAttribute_computed = false;
036        node.in$Circle(false);
037        node.is$Final(false);
038        return node;
039      }
040      /**
041       * Qualified access for wildcard types.
042       * Since they have no ordinary package and type name
043       * we just return the bound access.
044       * @ast method 
045       * @aspect Generics
046       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:17
047       */
048      public Access createQualifiedAccess() {
049        // this was suggested by Hyunik Na as a fix for bug
050        // http://svn.cs.lth.se/trac/jastadd-trac/ticket/60
051        return createBoundAccess();
052      }
053      /**
054       * @ast method 
055       * 
056       */
057      public AbstractWildcardType() {
058        super();
059    
060    
061      }
062      /**
063       * Initializes the child array to the correct size.
064       * Initializes List and Opt nta children.
065       * @apilevel internal
066       * @ast method
067       * @ast method 
068       * 
069       */
070      public void init$Children() {
071        children = new ASTNode[2];
072        setChild(new List(), 1);
073      }
074      /**
075       * @ast method 
076       * 
077       */
078      public AbstractWildcardType(Modifiers p0, String p1, List<BodyDecl> p2) {
079        setChild(p0, 0);
080        setID(p1);
081        setChild(p2, 1);
082      }
083      /**
084       * @ast method 
085       * 
086       */
087      public AbstractWildcardType(Modifiers p0, beaver.Symbol p1, List<BodyDecl> p2) {
088        setChild(p0, 0);
089        setID(p1);
090        setChild(p2, 1);
091      }
092      /**
093       * @apilevel low-level
094       * @ast method 
095       * 
096       */
097      protected int numChildren() {
098        return 2;
099      }
100      /**
101       * @apilevel internal
102       * @ast method 
103       * 
104       */
105      public boolean mayHaveRewrite() {
106        return false;
107      }
108      /**
109       * Replaces the Modifiers child.
110       * @param node The new node to replace the Modifiers child.
111       * @apilevel high-level
112       * @ast method 
113       * 
114       */
115      public void setModifiers(Modifiers node) {
116        setChild(node, 0);
117      }
118      /**
119       * Retrieves the Modifiers child.
120       * @return The current node used as the Modifiers child.
121       * @apilevel high-level
122       * @ast method 
123       * 
124       */
125      public Modifiers getModifiers() {
126        return (Modifiers)getChild(0);
127      }
128      /**
129       * Retrieves the Modifiers child.
130       * <p><em>This method does not invoke AST transformations.</em></p>
131       * @return The current node used as the Modifiers child.
132       * @apilevel low-level
133       * @ast method 
134       * 
135       */
136      public Modifiers getModifiersNoTransform() {
137        return (Modifiers)getChildNoTransform(0);
138      }
139      /**
140       * Replaces the lexeme ID.
141       * @param value The new value for the lexeme ID.
142       * @apilevel high-level
143       * @ast method 
144       * 
145       */
146      public void setID(String value) {
147        tokenString_ID = value;
148      }
149      /**
150       * JastAdd-internal setter for lexeme ID using the Beaver parser.
151       * @apilevel internal
152       * @ast method 
153       * 
154       */
155      public void setID(beaver.Symbol symbol) {
156        if(symbol.value != null && !(symbol.value instanceof String))
157          throw new UnsupportedOperationException("setID is only valid for String lexemes");
158        tokenString_ID = (String)symbol.value;
159        IDstart = symbol.getStart();
160        IDend = symbol.getEnd();
161      }
162      /**
163       * Retrieves the value for the lexeme ID.
164       * @return The value for the lexeme ID.
165       * @apilevel high-level
166       * @ast method 
167       * 
168       */
169      public String getID() {
170        return tokenString_ID != null ? tokenString_ID : "";
171      }
172      /**
173       * Replaces the BodyDecl list.
174       * @param list The new list node to be used as the BodyDecl list.
175       * @apilevel high-level
176       * @ast method 
177       * 
178       */
179      public void setBodyDeclList(List<BodyDecl> list) {
180        setChild(list, 1);
181      }
182      /**
183       * Retrieves the number of children in the BodyDecl list.
184       * @return Number of children in the BodyDecl list.
185       * @apilevel high-level
186       * @ast method 
187       * 
188       */
189      public int getNumBodyDecl() {
190        return getBodyDeclList().getNumChild();
191      }
192      /**
193       * Retrieves the number of children in the BodyDecl list.
194       * Calling this method will not trigger rewrites..
195       * @return Number of children in the BodyDecl list.
196       * @apilevel low-level
197       * @ast method 
198       * 
199       */
200      public int getNumBodyDeclNoTransform() {
201        return getBodyDeclListNoTransform().getNumChildNoTransform();
202      }
203      /**
204       * Retrieves the element at index {@code i} in the BodyDecl list..
205       * @param i Index of the element to return.
206       * @return The element at position {@code i} in the BodyDecl list.
207       * @apilevel high-level
208       * @ast method 
209       * 
210       */
211      @SuppressWarnings({"unchecked", "cast"})
212      public BodyDecl getBodyDecl(int i) {
213        return (BodyDecl)getBodyDeclList().getChild(i);
214      }
215      /**
216       * Append an element to the BodyDecl list.
217       * @param node The element to append to the BodyDecl list.
218       * @apilevel high-level
219       * @ast method 
220       * 
221       */
222      public void addBodyDecl(BodyDecl node) {
223        List<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
224        list.addChild(node);
225      }
226      /**
227       * @apilevel low-level
228       * @ast method 
229       * 
230       */
231      public void addBodyDeclNoTransform(BodyDecl node) {
232        List<BodyDecl> list = getBodyDeclListNoTransform();
233        list.addChild(node);
234      }
235      /**
236       * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}.
237       * @param node The new node to replace the old list element.
238       * @param i The list index of the node to be replaced.
239       * @apilevel high-level
240       * @ast method 
241       * 
242       */
243      public void setBodyDecl(BodyDecl node, int i) {
244        List<BodyDecl> list = getBodyDeclList();
245        list.setChild(node, i);
246      }
247      /**
248       * Retrieves the BodyDecl list.
249       * @return The node representing the BodyDecl list.
250       * @apilevel high-level
251       * @ast method 
252       * 
253       */
254      public List<BodyDecl> getBodyDecls() {
255        return getBodyDeclList();
256      }
257      /**
258       * Retrieves the BodyDecl list.
259       * <p><em>This method does not invoke AST transformations.</em></p>
260       * @return The node representing the BodyDecl list.
261       * @apilevel low-level
262       * @ast method 
263       * 
264       */
265      public List<BodyDecl> getBodyDeclsNoTransform() {
266        return getBodyDeclListNoTransform();
267      }
268      /**
269       * Retrieves the BodyDecl list.
270       * @return The node representing the BodyDecl list.
271       * @apilevel high-level
272       * @ast method 
273       * 
274       */
275      @SuppressWarnings({"unchecked", "cast"})
276      public List<BodyDecl> getBodyDeclList() {
277        List<BodyDecl> list = (List<BodyDecl>)getChild(1);
278        list.getNumChild();
279        return list;
280      }
281      /**
282       * Retrieves the BodyDecl list.
283       * <p><em>This method does not invoke AST transformations.</em></p>
284       * @return The node representing the BodyDecl list.
285       * @apilevel low-level
286       * @ast method 
287       * 
288       */
289      @SuppressWarnings({"unchecked", "cast"})
290      public List<BodyDecl> getBodyDeclListNoTransform() {
291        return (List<BodyDecl>)getChildNoTransform(1);
292      }
293      /**
294       * @attribute syn
295       * @aspect GenericsSubtype
296       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:102
297       */
298      public boolean isWildcard() {
299        ASTNode$State state = state();
300        try {  return true;  }
301        finally {
302        }
303      }
304      /**
305       * @apilevel internal
306       */
307      protected boolean needsSignatureAttribute_computed = false;
308      /**
309       * @apilevel internal
310       */
311      protected boolean needsSignatureAttribute_value;
312      /**
313       * @attribute syn
314       * @aspect GenericsCodegen
315       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/GenericsCodegen.jrag:344
316       */
317      @SuppressWarnings({"unchecked", "cast"})
318      public boolean needsSignatureAttribute() {
319        if(needsSignatureAttribute_computed) {
320          return needsSignatureAttribute_value;
321        }
322          ASTNode$State state = state();
323      int num = state.boundariesCrossed;
324      boolean isFinal = this.is$Final();
325        needsSignatureAttribute_value = needsSignatureAttribute_compute();
326      if(isFinal && num == state().boundariesCrossed){ needsSignatureAttribute_computed = true; }
327            return needsSignatureAttribute_value;
328      }
329      /**
330       * @apilevel internal
331       */
332      private boolean needsSignatureAttribute_compute() {  return true;  }
333      /**
334       * @apilevel internal
335       */
336      public ASTNode rewriteTo() {
337        return super.rewriteTo();
338      }
339    }