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/java4/grammar/Java.ast:42
027     * @production PrimitiveType : {@link TypeDecl} ::= <span class="component">{@link Modifiers}</span> <span class="component">&lt;ID:String&gt;</span> <span class="component">[SuperClass:{@link Access}]</span> <span class="component">{@link BodyDecl}*</span>;
028    
029     */
030    public class PrimitiveType extends TypeDecl implements Cloneable {
031      /**
032       * @aspect CreateQualifiedAccesses
033       * @declaredat /home/jesper/git/extendj/java4/frontend/QualifiedNames.jrag:120
034       */
035      public Access createQualifiedAccess() {
036        return new PrimitiveTypeAccess(name());
037      }
038      /**
039       * @aspect SuperClasses
040       * @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:661
041       */
042      public boolean hasSuperclass() {
043        return !isObject();
044      }
045      /**
046       * @aspect CodeGeneration
047       * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:242
048       */
049      public void emitReturn(CodeGeneration gen) { gen.emit(Bytecode.IRETURN);}
050      /**
051       * @aspect CodeGeneration
052       * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:263
053       */
054      public void emitLoadLocal(CodeGeneration gen, int pos) {
055        gen.maxLocals = Math.max(gen.maxLocals, pos+1);
056        if (pos == 0) {
057          gen.emit(Bytecode.ILOAD_0);
058        } else if (pos == 1) {
059          gen.emit(Bytecode.ILOAD_1);
060        } else if (pos == 2) {
061          gen.emit(Bytecode.ILOAD_2);
062        } else if (pos == 3) {
063          gen.emit(Bytecode.ILOAD_3);
064        } else if (pos < 256) {
065          gen.emit(Bytecode.ILOAD).add(pos);
066        } else {
067          gen.emit(Bytecode.WIDE).emit(Bytecode.ILOAD).add2(pos);
068        }
069      }
070      /**
071       * @aspect CodeGeneration
072       * @declaredat /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag:406
073       */
074      public void emitStoreLocal(CodeGeneration gen, int pos) {
075        gen.maxLocals = Math.max(gen.maxLocals, pos+1);
076        if (pos == 0) {
077          gen.emit(Bytecode.ISTORE_0);
078        } else if (pos == 1) {
079          gen.emit(Bytecode.ISTORE_1);
080        } else if (pos == 2) {
081          gen.emit(Bytecode.ISTORE_2);
082        } else if (pos == 3) {
083          gen.emit(Bytecode.ISTORE_3);
084        } else if (pos < 256) {
085          gen.emit(Bytecode.ISTORE).add(pos);
086        } else {
087          gen.emit(Bytecode.WIDE).emit(Bytecode.ISTORE).add2(pos);
088        }
089      }
090      /**
091       * @declaredat ASTNode:1
092       */
093      public PrimitiveType() {
094        super();
095      }
096      /**
097       * Initializes the child array to the correct size.
098       * Initializes List and Opt nta children.
099       * @apilevel internal
100       * @ast method
101       * @declaredat ASTNode:10
102       */
103      public void init$Children() {
104        children = new ASTNode[3];
105        setChild(new Opt(), 1);
106        setChild(new List(), 2);
107      }
108      /**
109       * @declaredat ASTNode:15
110       */
111      public PrimitiveType(Modifiers p0, String p1, Opt<Access> p2, List<BodyDecl> p3) {
112        setChild(p0, 0);
113        setID(p1);
114        setChild(p2, 1);
115        setChild(p3, 2);
116      }
117      /**
118       * @declaredat ASTNode:21
119       */
120      public PrimitiveType(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<BodyDecl> p3) {
121        setChild(p0, 0);
122        setID(p1);
123        setChild(p2, 1);
124        setChild(p3, 2);
125      }
126      /**
127       * @apilevel low-level
128       * @declaredat ASTNode:30
129       */
130      protected int numChildren() {
131        return 3;
132      }
133      /**
134       * @apilevel internal
135       * @declaredat ASTNode:36
136       */
137      public boolean mayHaveRewrite() {
138        return false;
139      }
140      /**
141       * @apilevel internal
142       * @declaredat ASTNode:42
143       */
144      public void flushAttrCache() {
145        super.flushAttrCache();
146        narrowingConversionTo_TypeDecl_reset();
147        instanceOf_TypeDecl_reset();
148        subtype_TypeDecl_reset();
149        fieldTypeSignature_reset();
150        classTypeSignature_reset();
151        strictSubtype_TypeDecl_reset();
152      }
153      /**
154       * @apilevel internal
155       * @declaredat ASTNode:54
156       */
157      public void flushCollectionCache() {
158        super.flushCollectionCache();
159      }
160      /**
161       * @apilevel internal
162       * @declaredat ASTNode:60
163       */
164      public void flushRewriteCache() {
165        super.flushRewriteCache();
166      }
167      /**
168       * @apilevel internal
169       * @declaredat ASTNode:66
170       */
171      public PrimitiveType clone() throws CloneNotSupportedException {
172        PrimitiveType node = (PrimitiveType) super.clone();
173        return node;
174      }
175      /**
176       * @apilevel internal
177       * @declaredat ASTNode:73
178       */
179      public PrimitiveType copy() {
180        try {
181          PrimitiveType node = (PrimitiveType) clone();
182          node.parent = null;
183          if (children != null) {
184            node.children = (ASTNode[]) children.clone();
185          }
186          return node;
187        } catch (CloneNotSupportedException e) {
188          throw new Error("Error: clone not supported for " + getClass().getName());
189        }
190      }
191      /**
192       * Create a deep copy of the AST subtree at this node.
193       * The copy is dangling, i.e. has no parent.
194       * @return dangling copy of the subtree at this node
195       * @apilevel low-level
196       * @deprecated Please use treeCopy or treeCopyNoTransform instead
197       * @declaredat ASTNode:92
198       */
199      @Deprecated
200      public PrimitiveType fullCopy() {
201        return treeCopyNoTransform();
202      }
203      /**
204       * Create a deep copy of the AST subtree at this node.
205       * The copy is dangling, i.e. has no parent.
206       * @return dangling copy of the subtree at this node
207       * @apilevel low-level
208       * @declaredat ASTNode:102
209       */
210      public PrimitiveType treeCopyNoTransform() {
211        PrimitiveType tree = (PrimitiveType) copy();
212        if (children != null) {
213          for (int i = 0; i < children.length; ++i) {
214            ASTNode child = (ASTNode) children[i];
215            if (child != null) {
216              child = child.treeCopyNoTransform();
217              tree.setChild(child, i);
218            }
219          }
220        }
221        return tree;
222      }
223      /**
224       * Create a deep copy of the AST subtree at this node.
225       * The subtree of this node is traversed to trigger rewrites before copy.
226       * The copy is dangling, i.e. has no parent.
227       * @return dangling copy of the subtree at this node
228       * @apilevel low-level
229       * @declaredat ASTNode:122
230       */
231      public PrimitiveType treeCopy() {
232        doFullTraversal();
233        return treeCopyNoTransform();
234      }
235      /**
236       * @apilevel internal
237       * @declaredat ASTNode:129
238       */
239      protected boolean is$Equal(ASTNode node) {
240        return super.is$Equal(node) && (tokenString_ID == ((PrimitiveType)node).tokenString_ID);    
241      }
242      /**
243       * Replaces the Modifiers child.
244       * @param node The new node to replace the Modifiers child.
245       * @apilevel high-level
246       */
247      public void setModifiers(Modifiers node) {
248        setChild(node, 0);
249      }
250      /**
251       * Retrieves the Modifiers child.
252       * @return The current node used as the Modifiers child.
253       * @apilevel high-level
254       */
255      @ASTNodeAnnotation.Child(name="Modifiers")
256      public Modifiers getModifiers() {
257        return (Modifiers) getChild(0);
258      }
259      /**
260       * Retrieves the Modifiers child.
261       * <p><em>This method does not invoke AST transformations.</em></p>
262       * @return The current node used as the Modifiers child.
263       * @apilevel low-level
264       */
265      public Modifiers getModifiersNoTransform() {
266        return (Modifiers) getChildNoTransform(0);
267      }
268      /**
269       * Replaces the lexeme ID.
270       * @param value The new value for the lexeme ID.
271       * @apilevel high-level
272       */
273      public void setID(String value) {
274        tokenString_ID = value;
275      }
276      /**
277       * JastAdd-internal setter for lexeme ID using the Beaver parser.
278       * @param symbol Symbol containing the new value for the lexeme ID
279       * @apilevel internal
280       */
281      public void setID(beaver.Symbol symbol) {
282        if (symbol.value != null && !(symbol.value instanceof String))
283        throw new UnsupportedOperationException("setID is only valid for String lexemes");
284        tokenString_ID = (String)symbol.value;
285        IDstart = symbol.getStart();
286        IDend = symbol.getEnd();
287      }
288      /**
289       * Retrieves the value for the lexeme ID.
290       * @return The value for the lexeme ID.
291       * @apilevel high-level
292       */
293      @ASTNodeAnnotation.Token(name="ID")
294      public String getID() {
295        return tokenString_ID != null ? tokenString_ID : "";
296      }
297      /**
298       * Replaces the optional node for the SuperClass child. This is the <code>Opt</code>
299       * node containing the child SuperClass, not the actual child!
300       * @param opt The new node to be used as the optional node for the SuperClass child.
301       * @apilevel low-level
302       */
303      public void setSuperClassOpt(Opt<Access> opt) {
304        setChild(opt, 1);
305      }
306      /**
307       * Replaces the (optional) SuperClass child.
308       * @param node The new node to be used as the SuperClass child.
309       * @apilevel high-level
310       */
311      public void setSuperClass(Access node) {
312        getSuperClassOpt().setChild(node, 0);
313      }
314      /**
315       * Check whether the optional SuperClass child exists.
316       * @return {@code true} if the optional SuperClass child exists, {@code false} if it does not.
317       * @apilevel high-level
318       */
319      public boolean hasSuperClass() {
320        return getSuperClassOpt().getNumChild() != 0;
321      }
322      /**
323       * Retrieves the (optional) SuperClass child.
324       * @return The SuperClass child, if it exists. Returns {@code null} otherwise.
325       * @apilevel low-level
326       */
327      public Access getSuperClass() {
328        return (Access) getSuperClassOpt().getChild(0);
329      }
330      /**
331       * Retrieves the optional node for the SuperClass child. This is the <code>Opt</code> node containing the child SuperClass, not the actual child!
332       * @return The optional node for child the SuperClass child.
333       * @apilevel low-level
334       */
335      @ASTNodeAnnotation.OptChild(name="SuperClass")
336      public Opt<Access> getSuperClassOpt() {
337        return (Opt<Access>) getChild(1);
338      }
339      /**
340       * Retrieves the optional node for child SuperClass. This is the <code>Opt</code> node containing the child SuperClass, not the actual child!
341       * <p><em>This method does not invoke AST transformations.</em></p>
342       * @return The optional node for child SuperClass.
343       * @apilevel low-level
344       */
345      public Opt<Access> getSuperClassOptNoTransform() {
346        return (Opt<Access>) getChildNoTransform(1);
347      }
348      /**
349       * Replaces the BodyDecl list.
350       * @param list The new list node to be used as the BodyDecl list.
351       * @apilevel high-level
352       */
353      public void setBodyDeclList(List<BodyDecl> list) {
354        setChild(list, 2);
355      }
356      /**
357       * Retrieves the number of children in the BodyDecl list.
358       * @return Number of children in the BodyDecl list.
359       * @apilevel high-level
360       */
361      public int getNumBodyDecl() {
362        return getBodyDeclList().getNumChild();
363      }
364      /**
365       * Retrieves the number of children in the BodyDecl list.
366       * Calling this method will not trigger rewrites.
367       * @return Number of children in the BodyDecl list.
368       * @apilevel low-level
369       */
370      public int getNumBodyDeclNoTransform() {
371        return getBodyDeclListNoTransform().getNumChildNoTransform();
372      }
373      /**
374       * Retrieves the element at index {@code i} in the BodyDecl list.
375       * @param i Index of the element to return.
376       * @return The element at position {@code i} in the BodyDecl list.
377       * @apilevel high-level
378       */
379      public BodyDecl getBodyDecl(int i) {
380        return (BodyDecl) getBodyDeclList().getChild(i);
381      }
382      /**
383       * Check whether the BodyDecl list has any children.
384       * @return {@code true} if it has at least one child, {@code false} otherwise.
385       * @apilevel high-level
386       */
387      public boolean hasBodyDecl() {
388        return getBodyDeclList().getNumChild() != 0;
389      }
390      /**
391       * Append an element to the BodyDecl list.
392       * @param node The element to append to the BodyDecl list.
393       * @apilevel high-level
394       */
395      public void addBodyDecl(BodyDecl node) {
396        List<BodyDecl> list = (parent == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
397        list.addChild(node);
398      }
399      /**
400       * @apilevel low-level
401       */
402      public void addBodyDeclNoTransform(BodyDecl node) {
403        List<BodyDecl> list = getBodyDeclListNoTransform();
404        list.addChild(node);
405      }
406      /**
407       * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}.
408       * @param node The new node to replace the old list element.
409       * @param i The list index of the node to be replaced.
410       * @apilevel high-level
411       */
412      public void setBodyDecl(BodyDecl node, int i) {
413        List<BodyDecl> list = getBodyDeclList();
414        list.setChild(node, i);
415      }
416      /**
417       * Retrieves the BodyDecl list.
418       * @return The node representing the BodyDecl list.
419       * @apilevel high-level
420       */
421      @ASTNodeAnnotation.ListChild(name="BodyDecl")
422      public List<BodyDecl> getBodyDeclList() {
423        List<BodyDecl> list = (List<BodyDecl>) getChild(2);
424        return list;
425      }
426      /**
427       * Retrieves the BodyDecl list.
428       * <p><em>This method does not invoke AST transformations.</em></p>
429       * @return The node representing the BodyDecl list.
430       * @apilevel low-level
431       */
432      public List<BodyDecl> getBodyDeclListNoTransform() {
433        return (List<BodyDecl>) getChildNoTransform(2);
434      }
435      /**
436       * Retrieves the BodyDecl list.
437       * @return The node representing the BodyDecl list.
438       * @apilevel high-level
439       */
440      public List<BodyDecl> getBodyDecls() {
441        return getBodyDeclList();
442      }
443      /**
444       * Retrieves the BodyDecl list.
445       * <p><em>This method does not invoke AST transformations.</em></p>
446       * @return The node representing the BodyDecl list.
447       * @apilevel low-level
448       */
449      public List<BodyDecl> getBodyDeclsNoTransform() {
450        return getBodyDeclListNoTransform();
451      }
452      /**
453       * @attribute syn
454       * @aspect TypeConversion
455       * @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:38
456       */
457      @ASTNodeAnnotation.Attribute
458      public boolean wideningConversionTo(TypeDecl type) {
459        boolean wideningConversionTo_TypeDecl_value = instanceOf(type);
460    
461        return wideningConversionTo_TypeDecl_value;
462      }
463      /**
464       * @apilevel internal
465       */
466      protected java.util.Map narrowingConversionTo_TypeDecl_values;
467      /**
468       * @apilevel internal
469       */
470      private void narrowingConversionTo_TypeDecl_reset() {
471        narrowingConversionTo_TypeDecl_values = null;
472      }
473      /**
474       * @attribute syn
475       * @aspect TypeConversion
476       * @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:39
477       */
478      @ASTNodeAnnotation.Attribute
479      public boolean narrowingConversionTo(TypeDecl type) {
480        Object _parameters = type;
481        if (narrowingConversionTo_TypeDecl_values == null) narrowingConversionTo_TypeDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap());
482        ASTNode$State state = state();
483        if (narrowingConversionTo_TypeDecl_values.containsKey(_parameters)) {
484          return (Boolean) narrowingConversionTo_TypeDecl_values.get(_parameters);
485        }
486        boolean intermediate = state.INTERMEDIATE_VALUE;
487        state.INTERMEDIATE_VALUE = false;
488        int num = state.boundariesCrossed;
489        boolean isFinal = this.is$Final();
490        boolean narrowingConversionTo_TypeDecl_value = type.instanceOf(this);
491        if (isFinal && num == state().boundariesCrossed) {
492          narrowingConversionTo_TypeDecl_values.put(_parameters, narrowingConversionTo_TypeDecl_value);
493        } else {
494        }
495        state.INTERMEDIATE_VALUE |= intermediate;
496    
497        return narrowingConversionTo_TypeDecl_value;
498      }
499      /**
500       * @attribute syn
501       * @aspect TypeAnalysis
502       * @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:190
503       */
504      @ASTNodeAnnotation.Attribute
505      public boolean isPrimitiveType() {
506        boolean isPrimitiveType_value = true;
507    
508        return isPrimitiveType_value;
509      }
510      /**
511       * @attribute syn
512       * @aspect TypeAnalysis
513       * @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:245
514       */
515      @ASTNodeAnnotation.Attribute
516      public boolean isPrimitive() {
517        boolean isPrimitive_value = true;
518    
519        return isPrimitive_value;
520      }
521      /**
522       * @apilevel internal
523       */
524      protected java.util.Map instanceOf_TypeDecl_values;
525      /**
526       * @apilevel internal
527       */
528      private void instanceOf_TypeDecl_reset() {
529        instanceOf_TypeDecl_values = null;
530      }
531      /**
532       * @attribute syn
533       * @aspect TypeWideningAndIdentity
534       * @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:442
535       */
536      @ASTNodeAnnotation.Attribute
537      public boolean instanceOf(TypeDecl type) {
538        Object _parameters = type;
539        if (instanceOf_TypeDecl_values == null) instanceOf_TypeDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap());
540        ASTNode$State state = state();
541        if (instanceOf_TypeDecl_values.containsKey(_parameters)) {
542          return (Boolean) instanceOf_TypeDecl_values.get(_parameters);
543        }
544        boolean intermediate = state.INTERMEDIATE_VALUE;
545        state.INTERMEDIATE_VALUE = false;
546        int num = state.boundariesCrossed;
547        boolean isFinal = this.is$Final();
548        boolean instanceOf_TypeDecl_value = instanceOf_compute(type);
549        if (isFinal && num == state().boundariesCrossed) {
550          instanceOf_TypeDecl_values.put(_parameters, instanceOf_TypeDecl_value);
551        } else {
552        }
553        state.INTERMEDIATE_VALUE |= intermediate;
554    
555        return instanceOf_TypeDecl_value;
556      }
557      /**
558       * @apilevel internal
559       */
560      private boolean instanceOf_compute(TypeDecl type) { return subtype(type); }
561      /**
562       * @attribute syn
563       * @aspect TypeWideningAndIdentity
564       * @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:519
565       */
566      @ASTNodeAnnotation.Attribute
567      public boolean isSupertypeOfPrimitiveType(PrimitiveType type) {
568        {
569            if (super.isSupertypeOfPrimitiveType(type)) {
570              return true;
571            }
572            return type.hasSuperclass() && type.superclass().isPrimitive() && type.superclass().instanceOf(this);
573          }
574      }
575      /**
576       * @attribute syn
577       * @aspect SuperClasses
578       * @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:665
579       */
580      @ASTNodeAnnotation.Attribute
581      public TypeDecl superclass() {
582        TypeDecl superclass_value = getSuperClass().type();
583    
584        return superclass_value;
585      }
586      /**
587       * @attribute syn
588       * @aspect LocalNum
589       * @declaredat /home/jesper/git/extendj/java4/backend/LocalNum.jrag:199
590       */
591      @ASTNodeAnnotation.Attribute
592      public int variableSize() {
593        int variableSize_value = 1;
594    
595        return variableSize_value;
596      }
597      /**
598       * @attribute syn
599       * @aspect Annotations
600       * @declaredat /home/jesper/git/extendj/java5/frontend/Annotations.jrag:151
601       */
602      @ASTNodeAnnotation.Attribute
603      public boolean isValidAnnotationMethodReturnType() {
604        boolean isValidAnnotationMethodReturnType_value = true;
605    
606        return isValidAnnotationMethodReturnType_value;
607      }
608      /**
609       * @attribute syn
610       * @aspect AutoBoxing
611       * @declaredat /home/jesper/git/extendj/java5/frontend/AutoBoxing.jrag:52
612       */
613      @ASTNodeAnnotation.Attribute
614      public boolean boxingConversionTo(TypeDecl typeDecl) {
615        boolean boxingConversionTo_TypeDecl_value = boxed() == typeDecl;
616    
617        return boxingConversionTo_TypeDecl_value;
618      }
619      /**
620       * @apilevel internal
621       */
622      private void subtype_TypeDecl_reset() {
623        subtype_TypeDecl_values = null;
624      }
625      protected java.util.Map subtype_TypeDecl_values;
626      @ASTNodeAnnotation.Attribute
627      public boolean subtype(TypeDecl type) {
628        Object _parameters = type;
629        if (subtype_TypeDecl_values == null) subtype_TypeDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap());
630        ASTNode$State.CircularValue _value;
631        if (subtype_TypeDecl_values.containsKey(_parameters)) {
632          Object _o = subtype_TypeDecl_values.get(_parameters);
633          if (!(_o instanceof ASTNode$State.CircularValue)) {
634            return (Boolean) _o;
635          } else {
636            _value = (ASTNode$State.CircularValue) _o;
637          }
638        } else {
639          _value = new ASTNode$State.CircularValue();
640          subtype_TypeDecl_values.put(_parameters, _value);
641          _value.value = true;
642        }
643        ASTNode$State state = state();
644        boolean new_subtype_TypeDecl_value;
645        if (!state.IN_CIRCLE) {
646          state.IN_CIRCLE = true;
647          int num = state.boundariesCrossed;
648          boolean isFinal = this.is$Final();
649          // TODO: fixme
650          // state().CIRCLE_INDEX = 1;
651          do {
652            _value.visited = state.CIRCLE_INDEX;
653            state.CHANGE = false;
654            new_subtype_TypeDecl_value = type.supertypePrimitiveType(this);
655            if (new_subtype_TypeDecl_value != ((Boolean)_value.value)) {
656              state.CHANGE = true;
657              _value.value = new_subtype_TypeDecl_value;
658            }
659            state.CIRCLE_INDEX++;
660          } while (state.CHANGE);
661          if (isFinal && num == state().boundariesCrossed) {
662            subtype_TypeDecl_values.put(_parameters, new_subtype_TypeDecl_value);
663          } else {
664            subtype_TypeDecl_values.remove(_parameters);
665            state.RESET_CYCLE = true;
666            boolean $tmp = type.supertypePrimitiveType(this);
667            state.RESET_CYCLE = false;
668          }
669          state.IN_CIRCLE = false;
670          state.INTERMEDIATE_VALUE = false;
671          return new_subtype_TypeDecl_value;
672        }
673        if (state.CIRCLE_INDEX != _value.visited) {
674          _value.visited = state.CIRCLE_INDEX;
675          new_subtype_TypeDecl_value = type.supertypePrimitiveType(this);
676          if (state.RESET_CYCLE) {
677            subtype_TypeDecl_values.remove(_parameters);
678          }
679          else if (new_subtype_TypeDecl_value != ((Boolean)_value.value)) {
680            state.CHANGE = true;
681            _value.value = new_subtype_TypeDecl_value;
682          }
683          state.INTERMEDIATE_VALUE = true;
684          return new_subtype_TypeDecl_value;
685        }
686        state.INTERMEDIATE_VALUE = true;
687        return (Boolean) _value.value;
688      }
689      /**
690       * @attribute syn
691       * @aspect GenericsSubtype
692       * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsSubtype.jrag:506
693       */
694      @ASTNodeAnnotation.Attribute
695      public boolean supertypePrimitiveType(PrimitiveType type) {
696        {
697            if (super.supertypePrimitiveType(type)) {
698              return true;
699            }
700            return type.hasSuperclass() && type.superclass().isPrimitive() && type.superclass().subtype(this);
701          }
702      }
703      /**
704       * @apilevel internal
705       */
706      protected boolean fieldTypeSignature_computed = false;
707      /**
708       * @apilevel internal
709       */
710      protected String fieldTypeSignature_value;
711      /**
712       * @apilevel internal
713       */
714      private void fieldTypeSignature_reset() {
715        fieldTypeSignature_computed = false;
716        fieldTypeSignature_value = null;
717      }
718      /**
719       * @attribute syn
720       * @aspect GenericsCodegen
721       * @declaredat /home/jesper/git/extendj/java5/backend/GenericsCodegen.jrag:467
722       */
723      @ASTNodeAnnotation.Attribute
724      public String fieldTypeSignature() {
725        ASTNode$State state = state();
726        if (fieldTypeSignature_computed) {
727          return fieldTypeSignature_value;
728        }
729        boolean intermediate = state.INTERMEDIATE_VALUE;
730        state.INTERMEDIATE_VALUE = false;
731        int num = state.boundariesCrossed;
732        boolean isFinal = this.is$Final();
733        fieldTypeSignature_value = classTypeSignature();
734        if (isFinal && num == state().boundariesCrossed) {
735          fieldTypeSignature_computed = true;
736        } else {
737        }
738        state.INTERMEDIATE_VALUE |= intermediate;
739    
740        return fieldTypeSignature_value;
741      }
742      /**
743       * @apilevel internal
744       */
745      protected boolean classTypeSignature_computed = false;
746      /**
747       * @apilevel internal
748       */
749      protected String classTypeSignature_value;
750      /**
751       * @apilevel internal
752       */
753      private void classTypeSignature_reset() {
754        classTypeSignature_computed = false;
755        classTypeSignature_value = null;
756      }
757      /**
758       * @attribute syn
759       * @aspect GenericsCodegen
760       * @declaredat /home/jesper/git/extendj/java5/backend/GenericsCodegen.jrag:476
761       */
762      @ASTNodeAnnotation.Attribute
763      public String classTypeSignature() {
764        ASTNode$State state = state();
765        if (classTypeSignature_computed) {
766          return classTypeSignature_value;
767        }
768        boolean intermediate = state.INTERMEDIATE_VALUE;
769        state.INTERMEDIATE_VALUE = false;
770        int num = state.boundariesCrossed;
771        boolean isFinal = this.is$Final();
772        classTypeSignature_value = typeDescriptor();
773        if (isFinal && num == state().boundariesCrossed) {
774          classTypeSignature_computed = true;
775        } else {
776        }
777        state.INTERMEDIATE_VALUE |= intermediate;
778    
779        return classTypeSignature_value;
780      }
781      /**
782       * @apilevel internal
783       */
784      private void strictSubtype_TypeDecl_reset() {
785        strictSubtype_TypeDecl_values = null;
786      }
787      protected java.util.Map strictSubtype_TypeDecl_values;
788      @ASTNodeAnnotation.Attribute
789      public boolean strictSubtype(TypeDecl type) {
790        Object _parameters = type;
791        if (strictSubtype_TypeDecl_values == null) strictSubtype_TypeDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap());
792        ASTNode$State.CircularValue _value;
793        if (strictSubtype_TypeDecl_values.containsKey(_parameters)) {
794          Object _o = strictSubtype_TypeDecl_values.get(_parameters);
795          if (!(_o instanceof ASTNode$State.CircularValue)) {
796            return (Boolean) _o;
797          } else {
798            _value = (ASTNode$State.CircularValue) _o;
799          }
800        } else {
801          _value = new ASTNode$State.CircularValue();
802          strictSubtype_TypeDecl_values.put(_parameters, _value);
803          _value.value = true;
804        }
805        ASTNode$State state = state();
806        boolean new_strictSubtype_TypeDecl_value;
807        if (!state.IN_CIRCLE) {
808          state.IN_CIRCLE = true;
809          int num = state.boundariesCrossed;
810          boolean isFinal = this.is$Final();
811          // TODO: fixme
812          // state().CIRCLE_INDEX = 1;
813          do {
814            _value.visited = state.CIRCLE_INDEX;
815            state.CHANGE = false;
816            new_strictSubtype_TypeDecl_value = type.strictSupertypePrimitiveType(this);
817            if (new_strictSubtype_TypeDecl_value != ((Boolean)_value.value)) {
818              state.CHANGE = true;
819              _value.value = new_strictSubtype_TypeDecl_value;
820            }
821            state.CIRCLE_INDEX++;
822          } while (state.CHANGE);
823          if (isFinal && num == state().boundariesCrossed) {
824            strictSubtype_TypeDecl_values.put(_parameters, new_strictSubtype_TypeDecl_value);
825          } else {
826            strictSubtype_TypeDecl_values.remove(_parameters);
827            state.RESET_CYCLE = true;
828            boolean $tmp = type.strictSupertypePrimitiveType(this);
829            state.RESET_CYCLE = false;
830          }
831          state.IN_CIRCLE = false;
832          state.INTERMEDIATE_VALUE = false;
833          return new_strictSubtype_TypeDecl_value;
834        }
835        if (state.CIRCLE_INDEX != _value.visited) {
836          _value.visited = state.CIRCLE_INDEX;
837          new_strictSubtype_TypeDecl_value = type.strictSupertypePrimitiveType(this);
838          if (state.RESET_CYCLE) {
839            strictSubtype_TypeDecl_values.remove(_parameters);
840          }
841          else if (new_strictSubtype_TypeDecl_value != ((Boolean)_value.value)) {
842            state.CHANGE = true;
843            _value.value = new_strictSubtype_TypeDecl_value;
844          }
845          state.INTERMEDIATE_VALUE = true;
846          return new_strictSubtype_TypeDecl_value;
847        }
848        state.INTERMEDIATE_VALUE = true;
849        return (Boolean) _value.value;
850      }
851      /**
852       * @attribute syn
853       * @aspect StrictSubtype
854       * @declaredat /home/jesper/git/extendj/java8/frontend/GenericsSubtype.jrag:437
855       */
856      @ASTNodeAnnotation.Attribute
857      public boolean strictSupertypePrimitiveType(PrimitiveType type) {
858        {
859            if (super.strictSupertypePrimitiveType(type)) {
860              return true;
861            }
862            return type.hasSuperclass() && type.superclass().isPrimitive()
863                && type.superclass().strictSubtype(this);
864          }
865      }
866      /**
867       * @declaredat /home/jesper/git/extendj/java7/frontend/MultiCatch.jrag:71
868       * @apilevel internal
869       */
870      public TypeDecl Define_hostType(ASTNode caller, ASTNode child) {
871        if (caller == getSuperClassOptNoTransform()) {
872          // @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:629
873          return hostType();
874        }
875        else {
876          return super.Define_hostType(caller, child);
877        }
878      }
879      protected boolean canDefine_hostType(ASTNode caller, ASTNode child) {
880        return true;
881      }
882      /**
883       * @apilevel internal
884       */
885      public ASTNode rewriteTo() {
886        return super.rewriteTo();
887      }
888    }