001    /* This file was generated with JastAdd2 (http://jastadd.org) version 2.1.13-12-g880e696 */
002    package org.extendj.ast;
003    
004    import java.util.HashSet;
005    import java.io.File;
006    import java.util.Set;
007    import java.util.Collections;
008    import java.util.Collection;
009    import java.util.ArrayList;
010    import beaver.*;
011    import java.util.*;
012    import java.io.ByteArrayOutputStream;
013    import java.io.PrintStream;
014    import java.lang.reflect.InvocationTargetException;
015    import java.lang.reflect.Method;
016    import org.jastadd.util.*;
017    import java.util.zip.*;
018    import java.io.*;
019    import org.jastadd.util.PrettyPrintable;
020    import org.jastadd.util.PrettyPrinter;
021    import java.io.FileNotFoundException;
022    import java.io.BufferedInputStream;
023    import java.io.DataInputStream;
024    /**
025     * @ast node
026     * @declaredat /home/jesper/git/extendj/java5/grammar/Generics.ast:44
027     * @production GenericInterfaceDeclSubstituted : {@link GenericInterfaceDecl} ::= <span class="component">&lt;Original:TypeDecl&gt;</span> <span class="component">{@link BodyDecl}*</span>;
028    
029     */
030    public class GenericInterfaceDeclSubstituted extends GenericInterfaceDecl implements Cloneable, MemberSubstitutor {
031      /**
032       * @declaredat ASTNode:1
033       */
034      public GenericInterfaceDeclSubstituted() {
035        super();
036      }
037      /**
038       * Initializes the child array to the correct size.
039       * Initializes List and Opt nta children.
040       * @apilevel internal
041       * @ast method
042       * @declaredat ASTNode:10
043       */
044      public void init$Children() {
045        children = new ASTNode[4];
046        setChild(new List(), 1);
047        setChild(new List(), 2);
048        setChild(new List(), 3);
049      }
050      /**
051       * @declaredat ASTNode:16
052       */
053      public GenericInterfaceDeclSubstituted(Modifiers p0, String p1, List<Access> p2, List<TypeVariable> p3, TypeDecl p4) {
054        setChild(p0, 0);
055        setID(p1);
056        setChild(p2, 1);
057        setChild(p3, 2);
058        setOriginal(p4);
059      }
060      /**
061       * @declaredat ASTNode:23
062       */
063      public GenericInterfaceDeclSubstituted(Modifiers p0, beaver.Symbol p1, List<Access> p2, List<TypeVariable> p3, TypeDecl p4) {
064        setChild(p0, 0);
065        setID(p1);
066        setChild(p2, 1);
067        setChild(p3, 2);
068        setOriginal(p4);
069      }
070      /**
071       * @apilevel low-level
072       * @declaredat ASTNode:33
073       */
074      protected int numChildren() {
075        return 3;
076      }
077      /**
078       * @apilevel internal
079       * @declaredat ASTNode:39
080       */
081      public boolean mayHaveRewrite() {
082        return false;
083      }
084      /**
085       * @apilevel internal
086       * @declaredat ASTNode:45
087       */
088      public void flushAttrCache() {
089        super.flushAttrCache();
090        getBodyDeclList_reset();
091        sourceTypeDecl_reset();
092        instanceOf_TypeDecl_reset();
093        subtype_TypeDecl_reset();
094        typeDescriptor_reset();
095        constantPoolName_reset();
096        uniqueIndex_reset();
097        strictSubtype_TypeDecl_reset();
098        localMethodsSignatureMap_reset();
099        localFields_String_reset();
100        localTypeDecls_String_reset();
101        constructors_reset();
102      }
103      /**
104       * @apilevel internal
105       * @declaredat ASTNode:63
106       */
107      public void flushCollectionCache() {
108        super.flushCollectionCache();
109      }
110      /**
111       * @apilevel internal
112       * @declaredat ASTNode:69
113       */
114      public void flushRewriteCache() {
115        super.flushRewriteCache();
116      }
117      /**
118       * @apilevel internal
119       * @declaredat ASTNode:75
120       */
121      public GenericInterfaceDeclSubstituted clone() throws CloneNotSupportedException {
122        GenericInterfaceDeclSubstituted node = (GenericInterfaceDeclSubstituted) super.clone();
123        return node;
124      }
125      /**
126       * @apilevel internal
127       * @declaredat ASTNode:82
128       */
129      public GenericInterfaceDeclSubstituted copy() {
130        try {
131          GenericInterfaceDeclSubstituted node = (GenericInterfaceDeclSubstituted) clone();
132          node.parent = null;
133          if (children != null) {
134            node.children = (ASTNode[]) children.clone();
135          }
136          return node;
137        } catch (CloneNotSupportedException e) {
138          throw new Error("Error: clone not supported for " + getClass().getName());
139        }
140      }
141      /**
142       * Create a deep copy of the AST subtree at this node.
143       * The copy is dangling, i.e. has no parent.
144       * @return dangling copy of the subtree at this node
145       * @apilevel low-level
146       * @deprecated Please use treeCopy or treeCopyNoTransform instead
147       * @declaredat ASTNode:101
148       */
149      @Deprecated
150      public GenericInterfaceDeclSubstituted fullCopy() {
151        return treeCopyNoTransform();
152      }
153      /**
154       * Create a deep copy of the AST subtree at this node.
155       * The copy is dangling, i.e. has no parent.
156       * @return dangling copy of the subtree at this node
157       * @apilevel low-level
158       * @declaredat ASTNode:111
159       */
160      public GenericInterfaceDeclSubstituted treeCopyNoTransform() {
161        GenericInterfaceDeclSubstituted tree = (GenericInterfaceDeclSubstituted) copy();
162        if (children != null) {
163          for (int i = 0; i < children.length; ++i) {
164            switch (i) {
165            case 3:
166              tree.children[i] = new List();
167              continue;
168            }
169            ASTNode child = (ASTNode) children[i];
170            if (child != null) {
171              child = child.treeCopyNoTransform();
172              tree.setChild(child, i);
173            }
174          }
175        }
176        return tree;
177      }
178      /**
179       * Create a deep copy of the AST subtree at this node.
180       * The subtree of this node is traversed to trigger rewrites before copy.
181       * The copy is dangling, i.e. has no parent.
182       * @return dangling copy of the subtree at this node
183       * @apilevel low-level
184       * @declaredat ASTNode:136
185       */
186      public GenericInterfaceDeclSubstituted treeCopy() {
187        doFullTraversal();
188        return treeCopyNoTransform();
189      }
190      /**
191       * @apilevel internal
192       * @declaredat ASTNode:143
193       */
194      protected boolean is$Equal(ASTNode node) {
195        return super.is$Equal(node) && (tokenString_ID == ((GenericInterfaceDeclSubstituted)node).tokenString_ID) && (tokenTypeDecl_Original == ((GenericInterfaceDeclSubstituted)node).tokenTypeDecl_Original);    
196      }
197      /**
198       * Replaces the Modifiers child.
199       * @param node The new node to replace the Modifiers child.
200       * @apilevel high-level
201       */
202      public void setModifiers(Modifiers node) {
203        setChild(node, 0);
204      }
205      /**
206       * Retrieves the Modifiers child.
207       * @return The current node used as the Modifiers child.
208       * @apilevel high-level
209       */
210      @ASTNodeAnnotation.Child(name="Modifiers")
211      public Modifiers getModifiers() {
212        return (Modifiers) getChild(0);
213      }
214      /**
215       * Retrieves the Modifiers child.
216       * <p><em>This method does not invoke AST transformations.</em></p>
217       * @return The current node used as the Modifiers child.
218       * @apilevel low-level
219       */
220      public Modifiers getModifiersNoTransform() {
221        return (Modifiers) getChildNoTransform(0);
222      }
223      /**
224       * Replaces the lexeme ID.
225       * @param value The new value for the lexeme ID.
226       * @apilevel high-level
227       */
228      public void setID(String value) {
229        tokenString_ID = value;
230      }
231      /**
232       * JastAdd-internal setter for lexeme ID using the Beaver parser.
233       * @param symbol Symbol containing the new value for the lexeme ID
234       * @apilevel internal
235       */
236      public void setID(beaver.Symbol symbol) {
237        if (symbol.value != null && !(symbol.value instanceof String))
238        throw new UnsupportedOperationException("setID is only valid for String lexemes");
239        tokenString_ID = (String)symbol.value;
240        IDstart = symbol.getStart();
241        IDend = symbol.getEnd();
242      }
243      /**
244       * Retrieves the value for the lexeme ID.
245       * @return The value for the lexeme ID.
246       * @apilevel high-level
247       */
248      @ASTNodeAnnotation.Token(name="ID")
249      public String getID() {
250        return tokenString_ID != null ? tokenString_ID : "";
251      }
252      /**
253       * Replaces the SuperInterface list.
254       * @param list The new list node to be used as the SuperInterface list.
255       * @apilevel high-level
256       */
257      public void setSuperInterfaceList(List<Access> list) {
258        setChild(list, 1);
259      }
260      /**
261       * Retrieves the number of children in the SuperInterface list.
262       * @return Number of children in the SuperInterface list.
263       * @apilevel high-level
264       */
265      public int getNumSuperInterface() {
266        return getSuperInterfaceList().getNumChild();
267      }
268      /**
269       * Retrieves the number of children in the SuperInterface list.
270       * Calling this method will not trigger rewrites.
271       * @return Number of children in the SuperInterface list.
272       * @apilevel low-level
273       */
274      public int getNumSuperInterfaceNoTransform() {
275        return getSuperInterfaceListNoTransform().getNumChildNoTransform();
276      }
277      /**
278       * Retrieves the element at index {@code i} in the SuperInterface list.
279       * @param i Index of the element to return.
280       * @return The element at position {@code i} in the SuperInterface list.
281       * @apilevel high-level
282       */
283      public Access getSuperInterface(int i) {
284        return (Access) getSuperInterfaceList().getChild(i);
285      }
286      /**
287       * Check whether the SuperInterface list has any children.
288       * @return {@code true} if it has at least one child, {@code false} otherwise.
289       * @apilevel high-level
290       */
291      public boolean hasSuperInterface() {
292        return getSuperInterfaceList().getNumChild() != 0;
293      }
294      /**
295       * Append an element to the SuperInterface list.
296       * @param node The element to append to the SuperInterface list.
297       * @apilevel high-level
298       */
299      public void addSuperInterface(Access node) {
300        List<Access> list = (parent == null) ? getSuperInterfaceListNoTransform() : getSuperInterfaceList();
301        list.addChild(node);
302      }
303      /**
304       * @apilevel low-level
305       */
306      public void addSuperInterfaceNoTransform(Access node) {
307        List<Access> list = getSuperInterfaceListNoTransform();
308        list.addChild(node);
309      }
310      /**
311       * Replaces the SuperInterface list element at index {@code i} with the new node {@code node}.
312       * @param node The new node to replace the old list element.
313       * @param i The list index of the node to be replaced.
314       * @apilevel high-level
315       */
316      public void setSuperInterface(Access node, int i) {
317        List<Access> list = getSuperInterfaceList();
318        list.setChild(node, i);
319      }
320      /**
321       * Retrieves the SuperInterface list.
322       * @return The node representing the SuperInterface list.
323       * @apilevel high-level
324       */
325      @ASTNodeAnnotation.ListChild(name="SuperInterface")
326      public List<Access> getSuperInterfaceList() {
327        List<Access> list = (List<Access>) getChild(1);
328        return list;
329      }
330      /**
331       * Retrieves the SuperInterface list.
332       * <p><em>This method does not invoke AST transformations.</em></p>
333       * @return The node representing the SuperInterface list.
334       * @apilevel low-level
335       */
336      public List<Access> getSuperInterfaceListNoTransform() {
337        return (List<Access>) getChildNoTransform(1);
338      }
339      /**
340       * Retrieves the SuperInterface list.
341       * @return The node representing the SuperInterface list.
342       * @apilevel high-level
343       */
344      public List<Access> getSuperInterfaces() {
345        return getSuperInterfaceList();
346      }
347      /**
348       * Retrieves the SuperInterface list.
349       * <p><em>This method does not invoke AST transformations.</em></p>
350       * @return The node representing the SuperInterface list.
351       * @apilevel low-level
352       */
353      public List<Access> getSuperInterfacesNoTransform() {
354        return getSuperInterfaceListNoTransform();
355      }
356      /**
357       * Replaces the TypeParameter list.
358       * @param list The new list node to be used as the TypeParameter list.
359       * @apilevel high-level
360       */
361      public void setTypeParameterList(List<TypeVariable> list) {
362        setChild(list, 2);
363      }
364      /**
365       * Retrieves the number of children in the TypeParameter list.
366       * @return Number of children in the TypeParameter list.
367       * @apilevel high-level
368       */
369      public int getNumTypeParameter() {
370        return getTypeParameterList().getNumChild();
371      }
372      /**
373       * Retrieves the number of children in the TypeParameter list.
374       * Calling this method will not trigger rewrites.
375       * @return Number of children in the TypeParameter list.
376       * @apilevel low-level
377       */
378      public int getNumTypeParameterNoTransform() {
379        return getTypeParameterListNoTransform().getNumChildNoTransform();
380      }
381      /**
382       * Retrieves the element at index {@code i} in the TypeParameter list.
383       * @param i Index of the element to return.
384       * @return The element at position {@code i} in the TypeParameter list.
385       * @apilevel high-level
386       */
387      public TypeVariable getTypeParameter(int i) {
388        return (TypeVariable) getTypeParameterList().getChild(i);
389      }
390      /**
391       * Check whether the TypeParameter list has any children.
392       * @return {@code true} if it has at least one child, {@code false} otherwise.
393       * @apilevel high-level
394       */
395      public boolean hasTypeParameter() {
396        return getTypeParameterList().getNumChild() != 0;
397      }
398      /**
399       * Append an element to the TypeParameter list.
400       * @param node The element to append to the TypeParameter list.
401       * @apilevel high-level
402       */
403      public void addTypeParameter(TypeVariable node) {
404        List<TypeVariable> list = (parent == null) ? getTypeParameterListNoTransform() : getTypeParameterList();
405        list.addChild(node);
406      }
407      /**
408       * @apilevel low-level
409       */
410      public void addTypeParameterNoTransform(TypeVariable node) {
411        List<TypeVariable> list = getTypeParameterListNoTransform();
412        list.addChild(node);
413      }
414      /**
415       * Replaces the TypeParameter list element at index {@code i} with the new node {@code node}.
416       * @param node The new node to replace the old list element.
417       * @param i The list index of the node to be replaced.
418       * @apilevel high-level
419       */
420      public void setTypeParameter(TypeVariable node, int i) {
421        List<TypeVariable> list = getTypeParameterList();
422        list.setChild(node, i);
423      }
424      /**
425       * Retrieves the TypeParameter list.
426       * @return The node representing the TypeParameter list.
427       * @apilevel high-level
428       */
429      @ASTNodeAnnotation.ListChild(name="TypeParameter")
430      public List<TypeVariable> getTypeParameterList() {
431        List<TypeVariable> list = (List<TypeVariable>) getChild(2);
432        return list;
433      }
434      /**
435       * Retrieves the TypeParameter list.
436       * <p><em>This method does not invoke AST transformations.</em></p>
437       * @return The node representing the TypeParameter list.
438       * @apilevel low-level
439       */
440      public List<TypeVariable> getTypeParameterListNoTransform() {
441        return (List<TypeVariable>) getChildNoTransform(2);
442      }
443      /**
444       * Retrieves the TypeParameter list.
445       * @return The node representing the TypeParameter list.
446       * @apilevel high-level
447       */
448      public List<TypeVariable> getTypeParameters() {
449        return getTypeParameterList();
450      }
451      /**
452       * Retrieves the TypeParameter list.
453       * <p><em>This method does not invoke AST transformations.</em></p>
454       * @return The node representing the TypeParameter list.
455       * @apilevel low-level
456       */
457      public List<TypeVariable> getTypeParametersNoTransform() {
458        return getTypeParameterListNoTransform();
459      }
460      /**
461       * Replaces the lexeme Original.
462       * @param value The new value for the lexeme Original.
463       * @apilevel high-level
464       */
465      public void setOriginal(TypeDecl value) {
466        tokenTypeDecl_Original = value;
467      }
468      /**
469       * @apilevel internal
470       */
471      protected TypeDecl tokenTypeDecl_Original;
472      /**
473       * Retrieves the value for the lexeme Original.
474       * @return The value for the lexeme Original.
475       * @apilevel high-level
476       */
477      @ASTNodeAnnotation.Token(name="Original")
478      public TypeDecl getOriginal() {
479        return tokenTypeDecl_Original;
480      }
481      /**
482       * This method should not be called. This method throws an exception due to
483       * the corresponding child being an NTA shadowing a non-NTA child.
484       * @param node
485       * @apilevel internal
486       */
487      public void setBodyDeclList(List<BodyDecl> node) {
488        throw new Error("Can not replace NTA child BodyDeclList in GenericInterfaceDeclSubstituted!");
489      }
490      /**
491       * Retrieves the number of children in the BodyDecl list.
492       * @return Number of children in the BodyDecl list.
493       * @apilevel high-level
494       */
495      public int getNumBodyDecl() {
496        return getBodyDeclList().getNumChild();
497      }
498      /**
499       * Retrieves the number of children in the BodyDecl list.
500       * Calling this method will not trigger rewrites.
501       * @return Number of children in the BodyDecl list.
502       * @apilevel low-level
503       */
504      public int getNumBodyDeclNoTransform() {
505        return getBodyDeclListNoTransform().getNumChildNoTransform();
506      }
507      /**
508       * Retrieves the element at index {@code i} in the BodyDecl list.
509       * @param i Index of the element to return.
510       * @return The element at position {@code i} in the BodyDecl list.
511       * @apilevel high-level
512       */
513      public BodyDecl getBodyDecl(int i) {
514        return (BodyDecl) getBodyDeclList().getChild(i);
515      }
516      /**
517       * Check whether the BodyDecl list has any children.
518       * @return {@code true} if it has at least one child, {@code false} otherwise.
519       * @apilevel high-level
520       */
521      public boolean hasBodyDecl() {
522        return getBodyDeclList().getNumChild() != 0;
523      }
524      /**
525       * Append an element to the BodyDecl list.
526       * @param node The element to append to the BodyDecl list.
527       * @apilevel high-level
528       */
529      public void addBodyDecl(BodyDecl node) {
530        List<BodyDecl> list = (parent == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
531        list.addChild(node);
532      }
533      /**
534       * @apilevel low-level
535       */
536      public void addBodyDeclNoTransform(BodyDecl node) {
537        List<BodyDecl> list = getBodyDeclListNoTransform();
538        list.addChild(node);
539      }
540      /**
541       * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}.
542       * @param node The new node to replace the old list element.
543       * @param i The list index of the node to be replaced.
544       * @apilevel high-level
545       */
546      public void setBodyDecl(BodyDecl node, int i) {
547        List<BodyDecl> list = getBodyDeclList();
548        list.setChild(node, i);
549      }
550      /**
551       * Retrieves the child position of the BodyDecl list.
552       * @return The the child position of the BodyDecl list.
553       * @apilevel low-level
554       */
555      protected int getBodyDeclListChildPosition() {
556        return 3;
557      }
558      /**
559       * Retrieves the BodyDecl list.
560       * <p><em>This method does not invoke AST transformations.</em></p>
561       * @return The node representing the BodyDecl list.
562       * @apilevel low-level
563       */
564      public List<BodyDecl> getBodyDeclListNoTransform() {
565        return (List<BodyDecl>) getChildNoTransform(3);
566      }
567      /**
568       * Retrieves the BodyDecl list.
569       * @return The node representing the BodyDecl list.
570       * @apilevel high-level
571       */
572      public List<BodyDecl> getBodyDecls() {
573        return getBodyDeclList();
574      }
575      /**
576       * Retrieves the BodyDecl list.
577       * <p><em>This method does not invoke AST transformations.</em></p>
578       * @return The node representing the BodyDecl list.
579       * @apilevel low-level
580       */
581      public List<BodyDecl> getBodyDeclsNoTransform() {
582        return getBodyDeclListNoTransform();
583      }
584      /**
585       * @attribute syn
586       * @aspect NestedTypes
587       * @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:624
588       */
589      @ASTNodeAnnotation.Attribute
590      public TypeDecl hostType() {
591        TypeDecl hostType_value = getOriginal();
592    
593        return hostType_value;
594      }
595      /**
596       * @apilevel internal
597       */
598      protected boolean getBodyDeclList_computed = false;
599      /**
600       * @apilevel internal
601       */
602      protected List getBodyDeclList_value;
603      /**
604       * @apilevel internal
605       */
606      private void getBodyDeclList_reset() {
607        getBodyDeclList_computed = false;
608        getBodyDeclList_value = null;
609      }
610      /**
611       * @attribute syn nta
612       * @aspect LookupParTypeDecl
613       * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1237
614       */
615      @ASTNodeAnnotation.Attribute
616      public List getBodyDeclList() {
617        ASTNode$State state = state();
618        if (getBodyDeclList_computed) {
619          return (List) getChild(getBodyDeclListChildPosition());
620        }
621        boolean intermediate = state.INTERMEDIATE_VALUE;
622        state.INTERMEDIATE_VALUE = false;
623        int num = state.boundariesCrossed;
624        boolean isFinal = this.is$Final();
625        getBodyDeclList_value = new BodyDeclList();
626        setChild(getBodyDeclList_value, getBodyDeclListChildPosition());
627        if (isFinal && num == state().boundariesCrossed) {
628          getBodyDeclList_computed = true;
629        } else {
630        }
631        state.INTERMEDIATE_VALUE |= intermediate;
632    
633        List node = (List) this.getChild(getBodyDeclListChildPosition());
634        return node;
635      }
636      /**
637       * @attribute syn
638       * @aspect LookupParTypeDecl
639       * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1417
640       */
641      @ASTNodeAnnotation.Attribute
642      public TypeDecl original() {
643        TypeDecl original_value = getOriginal().original();
644    
645        return original_value;
646      }
647      /**
648       * @apilevel internal
649       */
650      protected boolean sourceTypeDecl_computed = false;
651      /**
652       * @apilevel internal
653       */
654      protected TypeDecl sourceTypeDecl_value;
655      /**
656       * @apilevel internal
657       */
658      private void sourceTypeDecl_reset() {
659        sourceTypeDecl_computed = false;
660        sourceTypeDecl_value = null;
661      }
662      /**
663       * @attribute syn
664       * @aspect SourceDeclarations
665       * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1618
666       */
667      @ASTNodeAnnotation.Attribute
668      public TypeDecl sourceTypeDecl() {
669        ASTNode$State state = state();
670        if (sourceTypeDecl_computed) {
671          return sourceTypeDecl_value;
672        }
673        boolean intermediate = state.INTERMEDIATE_VALUE;
674        state.INTERMEDIATE_VALUE = false;
675        int num = state.boundariesCrossed;
676        boolean isFinal = this.is$Final();
677        sourceTypeDecl_value = original().sourceTypeDecl();
678        if (isFinal && num == state().boundariesCrossed) {
679          sourceTypeDecl_computed = true;
680        } else {
681        }
682        state.INTERMEDIATE_VALUE |= intermediate;
683    
684        return sourceTypeDecl_value;
685      }
686      /**
687       * @apilevel internal
688       */
689      protected java.util.Map instanceOf_TypeDecl_values;
690      /**
691       * @apilevel internal
692       */
693      private void instanceOf_TypeDecl_reset() {
694        instanceOf_TypeDecl_values = null;
695      }
696      /**
697       * @attribute syn
698       * @aspect TypeWideningAndIdentity
699       * @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:442
700       */
701      @ASTNodeAnnotation.Attribute
702      public boolean instanceOf(TypeDecl type) {
703        Object _parameters = type;
704        if (instanceOf_TypeDecl_values == null) instanceOf_TypeDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap());
705        ASTNode$State state = state();
706        if (instanceOf_TypeDecl_values.containsKey(_parameters)) {
707          return (Boolean) instanceOf_TypeDecl_values.get(_parameters);
708        }
709        boolean intermediate = state.INTERMEDIATE_VALUE;
710        state.INTERMEDIATE_VALUE = false;
711        int num = state.boundariesCrossed;
712        boolean isFinal = this.is$Final();
713        boolean instanceOf_TypeDecl_value = subtype(type);
714        if (isFinal && num == state().boundariesCrossed) {
715          instanceOf_TypeDecl_values.put(_parameters, instanceOf_TypeDecl_value);
716        } else {
717        }
718        state.INTERMEDIATE_VALUE |= intermediate;
719    
720        return instanceOf_TypeDecl_value;
721      }
722      /**
723       * @apilevel internal
724       */
725      private void subtype_TypeDecl_reset() {
726        subtype_TypeDecl_values = null;
727      }
728      protected java.util.Map subtype_TypeDecl_values;
729      @ASTNodeAnnotation.Attribute
730      public boolean subtype(TypeDecl type) {
731        Object _parameters = type;
732        if (subtype_TypeDecl_values == null) subtype_TypeDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap());
733        ASTNode$State.CircularValue _value;
734        if (subtype_TypeDecl_values.containsKey(_parameters)) {
735          Object _o = subtype_TypeDecl_values.get(_parameters);
736          if (!(_o instanceof ASTNode$State.CircularValue)) {
737            return (Boolean) _o;
738          } else {
739            _value = (ASTNode$State.CircularValue) _o;
740          }
741        } else {
742          _value = new ASTNode$State.CircularValue();
743          subtype_TypeDecl_values.put(_parameters, _value);
744          _value.value = true;
745        }
746        ASTNode$State state = state();
747        boolean new_subtype_TypeDecl_value;
748        if (!state.IN_CIRCLE) {
749          state.IN_CIRCLE = true;
750          int num = state.boundariesCrossed;
751          boolean isFinal = this.is$Final();
752          // TODO: fixme
753          // state().CIRCLE_INDEX = 1;
754          do {
755            _value.visited = state.CIRCLE_INDEX;
756            state.CHANGE = false;
757            new_subtype_TypeDecl_value = type.supertypeGenericInterfaceDeclSubstituted(this);
758            if (new_subtype_TypeDecl_value != ((Boolean)_value.value)) {
759              state.CHANGE = true;
760              _value.value = new_subtype_TypeDecl_value;
761            }
762            state.CIRCLE_INDEX++;
763          } while (state.CHANGE);
764          if (isFinal && num == state().boundariesCrossed) {
765            subtype_TypeDecl_values.put(_parameters, new_subtype_TypeDecl_value);
766          } else {
767            subtype_TypeDecl_values.remove(_parameters);
768            state.RESET_CYCLE = true;
769            boolean $tmp = type.supertypeGenericInterfaceDeclSubstituted(this);
770            state.RESET_CYCLE = false;
771          }
772          state.IN_CIRCLE = false;
773          state.INTERMEDIATE_VALUE = false;
774          return new_subtype_TypeDecl_value;
775        }
776        if (state.CIRCLE_INDEX != _value.visited) {
777          _value.visited = state.CIRCLE_INDEX;
778          new_subtype_TypeDecl_value = type.supertypeGenericInterfaceDeclSubstituted(this);
779          if (state.RESET_CYCLE) {
780            subtype_TypeDecl_values.remove(_parameters);
781          }
782          else if (new_subtype_TypeDecl_value != ((Boolean)_value.value)) {
783            state.CHANGE = true;
784            _value.value = new_subtype_TypeDecl_value;
785          }
786          state.INTERMEDIATE_VALUE = true;
787          return new_subtype_TypeDecl_value;
788        }
789        state.INTERMEDIATE_VALUE = true;
790        return (Boolean) _value.value;
791      }
792      /**
793       * @attribute syn
794       * @aspect GenericsSubtype
795       * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsSubtype.jrag:559
796       */
797      @ASTNodeAnnotation.Attribute
798      public boolean supertypeGenericInterfaceDeclSubstituted(GenericInterfaceDeclSubstituted type) {
799        boolean supertypeGenericInterfaceDeclSubstituted_GenericInterfaceDeclSubstituted_value = original() == type.original() && type.enclosingType().subtype(enclosingType())
800              || super.supertypeGenericInterfaceDeclSubstituted(type);
801    
802        return supertypeGenericInterfaceDeclSubstituted_GenericInterfaceDeclSubstituted_value;
803      }
804      /**
805       * @attribute syn
806       * @aspect GenericsSubtype
807       * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsSubtype.jrag:40
808       */
809      @ASTNodeAnnotation.Attribute
810      public boolean supertypeGenericInterfaceDecl(GenericInterfaceDecl type) {
811        boolean supertypeGenericInterfaceDecl_GenericInterfaceDecl_value = super.supertypeGenericInterfaceDecl(type) || original().supertypeGenericInterfaceDecl(type);
812    
813        return supertypeGenericInterfaceDecl_GenericInterfaceDecl_value;
814      }
815      /**
816       * @apilevel internal
817       */
818      protected boolean typeDescriptor_computed = false;
819      /**
820       * @apilevel internal
821       */
822      protected String typeDescriptor_value;
823      /**
824       * @apilevel internal
825       */
826      private void typeDescriptor_reset() {
827        typeDescriptor_computed = false;
828        typeDescriptor_value = null;
829      }
830      /**
831       * @attribute syn
832       * @aspect ConstantPoolNames
833       * @declaredat /home/jesper/git/extendj/java4/backend/ConstantPoolNames.jrag:77
834       */
835      @ASTNodeAnnotation.Attribute
836      public String typeDescriptor() {
837        ASTNode$State state = state();
838        if (typeDescriptor_computed) {
839          return typeDescriptor_value;
840        }
841        boolean intermediate = state.INTERMEDIATE_VALUE;
842        state.INTERMEDIATE_VALUE = false;
843        int num = state.boundariesCrossed;
844        boolean isFinal = this.is$Final();
845        typeDescriptor_value = original().typeDescriptor();
846        if (isFinal && num == state().boundariesCrossed) {
847          typeDescriptor_computed = true;
848        } else {
849        }
850        state.INTERMEDIATE_VALUE |= intermediate;
851    
852        return typeDescriptor_value;
853      }
854      /**
855       * @apilevel internal
856       */
857      protected boolean constantPoolName_computed = false;
858      /**
859       * @apilevel internal
860       */
861      protected String constantPoolName_value;
862      /**
863       * @apilevel internal
864       */
865      private void constantPoolName_reset() {
866        constantPoolName_computed = false;
867        constantPoolName_value = null;
868      }
869      /**
870       * For a top-level type the constant pool name of the type is the same as the
871       * canonical name but with dots replaced by solidus.
872       * 
873       * <p>For nested types the constant pool name is based on the enclosing top-level
874       * types constant pool name followed by a dollar sign and a unique index and/or
875       * the type name.
876       * 
877       * @return constant pool name of this type
878       * @attribute syn
879       * @aspect ConstantPoolNames
880       * @declaredat /home/jesper/git/extendj/java4/backend/ConstantPoolNames.jrag:44
881       */
882      @ASTNodeAnnotation.Attribute
883      public String constantPoolName() {
884        ASTNode$State state = state();
885        if (constantPoolName_computed) {
886          return constantPoolName_value;
887        }
888        boolean intermediate = state.INTERMEDIATE_VALUE;
889        state.INTERMEDIATE_VALUE = false;
890        int num = state.boundariesCrossed;
891        boolean isFinal = this.is$Final();
892        constantPoolName_value = original().constantPoolName();
893        if (isFinal && num == state().boundariesCrossed) {
894          constantPoolName_computed = true;
895        } else {
896        }
897        state.INTERMEDIATE_VALUE |= intermediate;
898    
899        return constantPoolName_value;
900      }
901      /**
902       * @apilevel internal
903       */
904      protected boolean uniqueIndex_computed = false;
905      /**
906       * @apilevel internal
907       */
908      protected int uniqueIndex_value;
909      /**
910       * @apilevel internal
911       */
912      private void uniqueIndex_reset() {
913        uniqueIndex_computed = false;
914      }
915      /**
916       * @attribute syn
917       * @aspect Java2Rewrites
918       * @declaredat /home/jesper/git/extendj/java4/backend/Java2Rewrites.jrag:33
919       */
920      @ASTNodeAnnotation.Attribute
921      public int uniqueIndex() {
922        ASTNode$State state = state();
923        if (uniqueIndex_computed) {
924          return uniqueIndex_value;
925        }
926        boolean intermediate = state.INTERMEDIATE_VALUE;
927        state.INTERMEDIATE_VALUE = false;
928        int num = state.boundariesCrossed;
929        boolean isFinal = this.is$Final();
930        uniqueIndex_value = original().uniqueIndex();
931        if (isFinal && num == state().boundariesCrossed) {
932          uniqueIndex_computed = true;
933        } else {
934        }
935        state.INTERMEDIATE_VALUE |= intermediate;
936    
937        return uniqueIndex_value;
938      }
939      /**
940       * @attribute syn
941       * @aspect CreateBCode
942       * @declaredat /home/jesper/git/extendj/java4/backend/CreateBCode.jrag:900
943       */
944      @ASTNodeAnnotation.Attribute
945      public String arrayTypeDescriptor() {
946        String arrayTypeDescriptor_value = original().arrayTypeDescriptor();
947    
948        return arrayTypeDescriptor_value;
949      }
950      /**
951       * @apilevel internal
952       */
953      private void strictSubtype_TypeDecl_reset() {
954        strictSubtype_TypeDecl_values = null;
955      }
956      protected java.util.Map strictSubtype_TypeDecl_values;
957      @ASTNodeAnnotation.Attribute
958      public boolean strictSubtype(TypeDecl type) {
959        Object _parameters = type;
960        if (strictSubtype_TypeDecl_values == null) strictSubtype_TypeDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap());
961        ASTNode$State.CircularValue _value;
962        if (strictSubtype_TypeDecl_values.containsKey(_parameters)) {
963          Object _o = strictSubtype_TypeDecl_values.get(_parameters);
964          if (!(_o instanceof ASTNode$State.CircularValue)) {
965            return (Boolean) _o;
966          } else {
967            _value = (ASTNode$State.CircularValue) _o;
968          }
969        } else {
970          _value = new ASTNode$State.CircularValue();
971          strictSubtype_TypeDecl_values.put(_parameters, _value);
972          _value.value = true;
973        }
974        ASTNode$State state = state();
975        boolean new_strictSubtype_TypeDecl_value;
976        if (!state.IN_CIRCLE) {
977          state.IN_CIRCLE = true;
978          int num = state.boundariesCrossed;
979          boolean isFinal = this.is$Final();
980          // TODO: fixme
981          // state().CIRCLE_INDEX = 1;
982          do {
983            _value.visited = state.CIRCLE_INDEX;
984            state.CHANGE = false;
985            new_strictSubtype_TypeDecl_value = type.strictSupertypeGenericInterfaceDeclSubstituted(this);
986            if (new_strictSubtype_TypeDecl_value != ((Boolean)_value.value)) {
987              state.CHANGE = true;
988              _value.value = new_strictSubtype_TypeDecl_value;
989            }
990            state.CIRCLE_INDEX++;
991          } while (state.CHANGE);
992          if (isFinal && num == state().boundariesCrossed) {
993            strictSubtype_TypeDecl_values.put(_parameters, new_strictSubtype_TypeDecl_value);
994          } else {
995            strictSubtype_TypeDecl_values.remove(_parameters);
996            state.RESET_CYCLE = true;
997            boolean $tmp = type.strictSupertypeGenericInterfaceDeclSubstituted(this);
998            state.RESET_CYCLE = false;
999          }
1000          state.IN_CIRCLE = false;
1001          state.INTERMEDIATE_VALUE = false;
1002          return new_strictSubtype_TypeDecl_value;
1003        }
1004        if (state.CIRCLE_INDEX != _value.visited) {
1005          _value.visited = state.CIRCLE_INDEX;
1006          new_strictSubtype_TypeDecl_value = type.strictSupertypeGenericInterfaceDeclSubstituted(this);
1007          if (state.RESET_CYCLE) {
1008            strictSubtype_TypeDecl_values.remove(_parameters);
1009          }
1010          else if (new_strictSubtype_TypeDecl_value != ((Boolean)_value.value)) {
1011            state.CHANGE = true;
1012            _value.value = new_strictSubtype_TypeDecl_value;
1013          }
1014          state.INTERMEDIATE_VALUE = true;
1015          return new_strictSubtype_TypeDecl_value;
1016        }
1017        state.INTERMEDIATE_VALUE = true;
1018        return (Boolean) _value.value;
1019      }
1020      /**
1021       * @attribute syn
1022       * @aspect StrictSubtype
1023       * @declaredat /home/jesper/git/extendj/java8/frontend/GenericsSubtype.jrag:492
1024       */
1025      @ASTNodeAnnotation.Attribute
1026      public boolean strictSupertypeGenericInterfaceDeclSubstituted(GenericInterfaceDeclSubstituted type) {
1027        boolean strictSupertypeGenericInterfaceDeclSubstituted_GenericInterfaceDeclSubstituted_value = original() == type.original() && type.enclosingType().strictSubtype(enclosingType())
1028              || super.strictSupertypeGenericInterfaceDeclSubstituted(type);
1029    
1030        return strictSupertypeGenericInterfaceDeclSubstituted_GenericInterfaceDeclSubstituted_value;
1031      }
1032      /**
1033       * @attribute syn
1034       * @aspect StrictSubtype
1035       * @declaredat /home/jesper/git/extendj/java8/frontend/GenericsSubtype.jrag:46
1036       */
1037      @ASTNodeAnnotation.Attribute
1038      public boolean strictSupertypeGenericInterfaceDecl(GenericInterfaceDecl type) {
1039        boolean strictSupertypeGenericInterfaceDecl_GenericInterfaceDecl_value = super.strictSupertypeGenericInterfaceDecl(type)
1040              || original().strictSupertypeGenericInterfaceDecl(type);
1041    
1042        return strictSupertypeGenericInterfaceDecl_GenericInterfaceDecl_value;
1043      }
1044      /**
1045       * @apilevel internal
1046       */
1047      protected boolean localMethodsSignatureMap_computed = false;
1048      /**
1049       * @apilevel internal
1050       */
1051      protected Map<String,SimpleSet> localMethodsSignatureMap_value;
1052      /**
1053       * @apilevel internal
1054       */
1055      private void localMethodsSignatureMap_reset() {
1056        localMethodsSignatureMap_computed = false;
1057        localMethodsSignatureMap_value = null;
1058      }
1059      /**
1060       * @attribute syn
1061       * @aspect LookupParTypeDecl
1062       * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1278
1063       */
1064      @ASTNodeAnnotation.Attribute
1065      public Map<String,SimpleSet> localMethodsSignatureMap() {
1066        ASTNode$State state = state();
1067        if (localMethodsSignatureMap_computed) {
1068          return localMethodsSignatureMap_value;
1069        }
1070        boolean intermediate = state.INTERMEDIATE_VALUE;
1071        state.INTERMEDIATE_VALUE = false;
1072        int num = state.boundariesCrossed;
1073        boolean isFinal = this.is$Final();
1074        localMethodsSignatureMap_value = localMethodsSignatureMap_compute();
1075        if (true) {
1076          localMethodsSignatureMap_computed = true;
1077        } else {
1078        }
1079        state.INTERMEDIATE_VALUE |= intermediate;
1080    
1081        return localMethodsSignatureMap_value;
1082      }
1083      /**
1084       * @apilevel internal
1085       */
1086      private Map<String,SimpleSet> localMethodsSignatureMap_compute() {
1087          Map<String,SimpleSet> map = new HashMap<String,SimpleSet>();
1088          for (Iterator<MethodDecl> iter = original().localMethodsIterator(); iter.hasNext(); ) {
1089            MethodDecl decl = iter.next();
1090      
1091            if (!decl.isStatic() && (decl.usesTypeVariable() || isRawType())) {
1092              BodyDecl copyDecl = ((BodyDeclList) getBodyDeclList()).localMethodSignatureCopy(decl, this);
1093              decl = (MethodDecl) copyDecl;
1094            }
1095            putSimpleSetElement(map, decl.signature(), decl);
1096      
1097          }
1098          return map;
1099        }
1100      /**
1101       * @apilevel internal
1102       */
1103      protected java.util.Map localFields_String_values;
1104      /**
1105       * @apilevel internal
1106       */
1107      private void localFields_String_reset() {
1108        localFields_String_values = null;
1109      }
1110      /**
1111       * @attribute syn
1112       * @aspect LookupParTypeDecl
1113       * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1296
1114       */
1115      @ASTNodeAnnotation.Attribute
1116      public SimpleSet localFields(String name) {
1117        Object _parameters = name;
1118        if (localFields_String_values == null) localFields_String_values = new org.jastadd.util.RobustMap(new java.util.HashMap());
1119        ASTNode$State state = state();
1120        if (localFields_String_values.containsKey(_parameters)) {
1121          return (SimpleSet) localFields_String_values.get(_parameters);
1122        }
1123        boolean intermediate = state.INTERMEDIATE_VALUE;
1124        state.INTERMEDIATE_VALUE = false;
1125        int num = state.boundariesCrossed;
1126        boolean isFinal = this.is$Final();
1127        SimpleSet localFields_String_value = localFields_compute(name);
1128        if (true) {
1129          localFields_String_values.put(_parameters, localFields_String_value);
1130        } else {
1131        }
1132        state.INTERMEDIATE_VALUE |= intermediate;
1133    
1134        return localFields_String_value;
1135      }
1136      /**
1137       * @apilevel internal
1138       */
1139      private SimpleSet localFields_compute(String name) {
1140          SimpleSet set = SimpleSet.emptySet;
1141          for (Iterator iter = original().localFields(name).iterator(); iter.hasNext(); ) {
1142            FieldDeclaration f = (FieldDeclaration) iter.next();
1143      
1144            if (!f.isStatic() && (f.usesTypeVariable() || isRawType())) {
1145              BodyDecl fCopy = ((BodyDeclList) getBodyDeclList()).localFieldCopy(f, this);
1146              f = (FieldDeclaration) fCopy;
1147            }
1148            set = set.add(f);
1149      
1150          }
1151          return set;
1152        }
1153      /**
1154       * @apilevel internal
1155       */
1156      private void localTypeDecls_String_reset() {
1157        localTypeDecls_String_values = null;
1158      }
1159      protected java.util.Map localTypeDecls_String_values;
1160      @ASTNodeAnnotation.Attribute
1161      public SimpleSet localTypeDecls(String name) {
1162        Object _parameters = name;
1163        if (localTypeDecls_String_values == null) localTypeDecls_String_values = new org.jastadd.util.RobustMap(new java.util.HashMap());
1164        ASTNode$State.CircularValue _value;
1165        if (localTypeDecls_String_values.containsKey(_parameters)) {
1166          Object _o = localTypeDecls_String_values.get(_parameters);
1167          if (!(_o instanceof ASTNode$State.CircularValue)) {
1168            return (SimpleSet) _o;
1169          } else {
1170            _value = (ASTNode$State.CircularValue) _o;
1171          }
1172        } else {
1173          _value = new ASTNode$State.CircularValue();
1174          localTypeDecls_String_values.put(_parameters, _value);
1175          _value.value = SimpleSet.emptySet;
1176        }
1177        ASTNode$State state = state();
1178        SimpleSet new_localTypeDecls_String_value;
1179        if (!state.IN_CIRCLE) {
1180          state.IN_CIRCLE = true;
1181          int num = state.boundariesCrossed;
1182          boolean isFinal = this.is$Final();
1183          // TODO: fixme
1184          // state().CIRCLE_INDEX = 1;
1185          do {
1186            _value.visited = state.CIRCLE_INDEX;
1187            state.CHANGE = false;
1188            new_localTypeDecls_String_value = localTypeDecls_compute(name);
1189            if ((new_localTypeDecls_String_value==null && (SimpleSet)_value.value!=null) || (new_localTypeDecls_String_value!=null && !new_localTypeDecls_String_value.equals((SimpleSet)_value.value))) {
1190              state.CHANGE = true;
1191              _value.value = new_localTypeDecls_String_value;
1192            }
1193            state.CIRCLE_INDEX++;
1194          } while (state.CHANGE);
1195          if (true) {
1196            localTypeDecls_String_values.put(_parameters, new_localTypeDecls_String_value);
1197          } else {
1198            localTypeDecls_String_values.remove(_parameters);
1199            state.RESET_CYCLE = true;
1200            SimpleSet $tmp = localTypeDecls_compute(name);
1201            state.RESET_CYCLE = false;
1202          }
1203          state.IN_CIRCLE = false;
1204          state.INTERMEDIATE_VALUE = false;
1205          return new_localTypeDecls_String_value;
1206        }
1207        if (state.CIRCLE_INDEX != _value.visited) {
1208          _value.visited = state.CIRCLE_INDEX;
1209          new_localTypeDecls_String_value = localTypeDecls_compute(name);
1210          if (state.RESET_CYCLE) {
1211            localTypeDecls_String_values.remove(_parameters);
1212          }
1213          else if ((new_localTypeDecls_String_value==null && (SimpleSet)_value.value!=null) || (new_localTypeDecls_String_value!=null && !new_localTypeDecls_String_value.equals((SimpleSet)_value.value))) {
1214            state.CHANGE = true;
1215            _value.value = new_localTypeDecls_String_value;
1216          }
1217          state.INTERMEDIATE_VALUE = true;
1218          return new_localTypeDecls_String_value;
1219        }
1220        state.INTERMEDIATE_VALUE = true;
1221        return (SimpleSet) _value.value;
1222      }
1223      /**
1224       * @apilevel internal
1225       */
1226      private SimpleSet localTypeDecls_compute(String name) {
1227          SimpleSet set = SimpleSet.emptySet;
1228          for (Iterator iter = original().localTypeDecls(name).iterator(); iter.hasNext(); ) {
1229            TypeDecl t = (TypeDecl) iter.next();
1230      
1231            if (t.isStatic()) {
1232              set = set.add(t);
1233            } else if (t instanceof ClassDecl) {
1234              MemberClassDecl copy =
1235                ((BodyDeclList) getBodyDeclList()).localClassDeclCopy((ClassDecl) t, this);
1236              set = set.add(copy.getClassDecl());
1237            } else if (t instanceof InterfaceDecl) {
1238              MemberInterfaceDecl copy =
1239                ((BodyDeclList) getBodyDeclList()).localInterfaceDeclCopy((InterfaceDecl) t, this);
1240              set = set.add(copy.getInterfaceDecl());
1241            }
1242          }
1243          return set;
1244        }
1245      /**
1246       * @apilevel internal
1247       */
1248      protected boolean constructors_computed = false;
1249      /**
1250       * @apilevel internal
1251       */
1252      protected Collection<ConstructorDecl> constructors_value;
1253      /**
1254       * @apilevel internal
1255       */
1256      private void constructors_reset() {
1257        constructors_computed = false;
1258        constructors_value = null;
1259      }
1260      /**
1261       * @attribute syn
1262       * @aspect LookupParTypeDecl
1263       * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1347
1264       */
1265      @ASTNodeAnnotation.Attribute
1266      public Collection<ConstructorDecl> constructors() {
1267        ASTNode$State state = state();
1268        if (constructors_computed) {
1269          return constructors_value;
1270        }
1271        boolean intermediate = state.INTERMEDIATE_VALUE;
1272        state.INTERMEDIATE_VALUE = false;
1273        int num = state.boundariesCrossed;
1274        boolean isFinal = this.is$Final();
1275        constructors_value = constructors_compute();
1276        if (isFinal && num == state().boundariesCrossed) {
1277          constructors_computed = true;
1278        } else {
1279        }
1280        state.INTERMEDIATE_VALUE |= intermediate;
1281    
1282        return constructors_value;
1283      }
1284      /**
1285       * @apilevel internal
1286       */
1287      private Collection<ConstructorDecl> constructors_compute() {
1288          Collection<ConstructorDecl> constructors = new ArrayList<ConstructorDecl>();
1289          for (Iterator iter = original().constructors().iterator(); iter.hasNext(); ) {
1290            ConstructorDecl c = (ConstructorDecl) iter.next();
1291      
1292            ConstructorDecl b = ((BodyDeclList) getBodyDeclList()).constructorCopy(c, this);
1293            constructors.add(b);
1294          }
1295          return constructors;
1296        }
1297      /**
1298       * @apilevel internal
1299       */
1300      public ASTNode rewriteTo() {
1301        return super.rewriteTo();
1302      }
1303    }