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    /**
015     * @production PrimitiveCompilationUnit : {@link CompilationUnit};
016     * @ast node
017     * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/java.ast:7
018     */
019    public class PrimitiveCompilationUnit extends CompilationUnit implements Cloneable {
020      /**
021       * @apilevel low-level
022       */
023      public void flushCache() {
024      }
025      /**
026       * @apilevel internal
027       */
028      public void flushCollectionCache() {
029      }
030      /**
031       * @apilevel internal
032       */
033      @SuppressWarnings({"unchecked", "cast"})
034      public PrimitiveCompilationUnit clone() throws CloneNotSupportedException {
035        PrimitiveCompilationUnit node = (PrimitiveCompilationUnit)super.clone();
036        node.typeBoolean_computed = false;
037        node.typeBoolean_value = null;
038        node.typeByte_computed = false;
039        node.typeByte_value = null;
040        node.typeShort_computed = false;
041        node.typeShort_value = null;
042        node.typeChar_computed = false;
043        node.typeChar_value = null;
044        node.typeInt_computed = false;
045        node.typeInt_value = null;
046        node.typeLong_computed = false;
047        node.typeLong_value = null;
048        node.typeFloat_computed = false;
049        node.typeFloat_value = null;
050        node.typeDouble_computed = false;
051        node.typeDouble_value = null;
052        node.typeVoid_computed = false;
053        node.typeVoid_value = null;
054        node.typeNull_computed = false;
055        node.typeNull_value = null;
056        node.unknownType_computed = false;
057        node.unknownType_value = null;
058        node.in$Circle(false);
059        node.is$Final(false);
060        return node;
061      }
062    /**
063     * @apilevel internal
064     */
065      @SuppressWarnings({"unchecked", "cast"})
066    public PrimitiveCompilationUnit copy() {
067      
068      try {
069        PrimitiveCompilationUnit node = (PrimitiveCompilationUnit) clone();
070        node.parent = null;
071        if(children != null)
072          node.children = (ASTNode[]) children.clone();
073        
074        return node;
075      } catch (CloneNotSupportedException e) {
076        throw new Error("Error: clone not supported for " + getClass().getName());
077      }
078      
079    }/**
080     * Create a deep copy of the AST subtree at this node.
081     * The copy is dangling, i.e. has no parent.
082     * @return dangling copy of the subtree at this node
083     * @apilevel low-level
084     */
085      @SuppressWarnings({"unchecked", "cast"})
086    public PrimitiveCompilationUnit fullCopy() {
087      
088      PrimitiveCompilationUnit tree = (PrimitiveCompilationUnit) copy();
089      if (children != null) {
090        for (int i = 0; i < children.length; ++i) {
091          
092          ASTNode child = (ASTNode) children[i];
093          if(child != null) {
094            child = child.fullCopy();
095            tree.setChild(child, i);
096          }
097        }
098      }
099      return tree;
100      
101    }  /**
102       * @ast method 
103       * 
104       */
105      public PrimitiveCompilationUnit() {
106        super();
107    
108    
109      }
110      /**
111       * Initializes the child array to the correct size.
112       * Initializes List and Opt nta children.
113       * @apilevel internal
114       * @ast method
115       * @ast method 
116       * 
117       */
118      public void init$Children() {
119        children = new ASTNode[2];
120        setChild(new List(), 0);
121        setChild(new List(), 1);
122      }
123      /**
124       * @ast method 
125       * 
126       */
127      public PrimitiveCompilationUnit(java.lang.String p0, List<ImportDecl> p1, List<TypeDecl> p2) {
128        setPackageDecl(p0);
129        setChild(p1, 0);
130        setChild(p2, 1);
131      }
132      /**
133       * @ast method 
134       * 
135       */
136      public PrimitiveCompilationUnit(beaver.Symbol p0, List<ImportDecl> p1, List<TypeDecl> p2) {
137        setPackageDecl(p0);
138        setChild(p1, 0);
139        setChild(p2, 1);
140      }
141      /**
142       * @apilevel low-level
143       * @ast method 
144       * 
145       */
146      protected int numChildren() {
147        return 2;
148      }
149      /**
150       * @apilevel internal
151       * @ast method 
152       * 
153       */
154      public boolean mayHaveRewrite() {
155        return false;
156      }
157      /**
158       * Replaces the lexeme PackageDecl.
159       * @param value The new value for the lexeme PackageDecl.
160       * @apilevel high-level
161       * @ast method 
162       * 
163       */
164      public void setPackageDecl(java.lang.String value) {
165        tokenjava_lang_String_PackageDecl = value;
166      }
167      /**
168       * JastAdd-internal setter for lexeme PackageDecl using the Beaver parser.
169       * @apilevel internal
170       * @ast method 
171       * 
172       */
173      public void setPackageDecl(beaver.Symbol symbol) {
174        if(symbol.value != null && !(symbol.value instanceof String))
175          throw new UnsupportedOperationException("setPackageDecl is only valid for String lexemes");
176        tokenjava_lang_String_PackageDecl = (String)symbol.value;
177        PackageDeclstart = symbol.getStart();
178        PackageDeclend = symbol.getEnd();
179      }
180      /**
181       * Retrieves the value for the lexeme PackageDecl.
182       * @return The value for the lexeme PackageDecl.
183       * @apilevel high-level
184       * @ast method 
185       * 
186       */
187      public java.lang.String getPackageDecl() {
188        return tokenjava_lang_String_PackageDecl != null ? tokenjava_lang_String_PackageDecl : "";
189      }
190      /**
191       * Replaces the ImportDecl list.
192       * @param list The new list node to be used as the ImportDecl list.
193       * @apilevel high-level
194       * @ast method 
195       * 
196       */
197      public void setImportDeclList(List<ImportDecl> list) {
198        setChild(list, 0);
199      }
200      /**
201       * Retrieves the number of children in the ImportDecl list.
202       * @return Number of children in the ImportDecl list.
203       * @apilevel high-level
204       * @ast method 
205       * 
206       */
207      public int getNumImportDecl() {
208        return getImportDeclList().getNumChild();
209      }
210      /**
211       * Retrieves the number of children in the ImportDecl list.
212       * Calling this method will not trigger rewrites..
213       * @return Number of children in the ImportDecl list.
214       * @apilevel low-level
215       * @ast method 
216       * 
217       */
218      public int getNumImportDeclNoTransform() {
219        return getImportDeclListNoTransform().getNumChildNoTransform();
220      }
221      /**
222       * Retrieves the element at index {@code i} in the ImportDecl list..
223       * @param i Index of the element to return.
224       * @return The element at position {@code i} in the ImportDecl list.
225       * @apilevel high-level
226       * @ast method 
227       * 
228       */
229      @SuppressWarnings({"unchecked", "cast"})
230      public ImportDecl getImportDecl(int i) {
231        return (ImportDecl)getImportDeclList().getChild(i);
232      }
233      /**
234       * Append an element to the ImportDecl list.
235       * @param node The element to append to the ImportDecl list.
236       * @apilevel high-level
237       * @ast method 
238       * 
239       */
240      public void addImportDecl(ImportDecl node) {
241        List<ImportDecl> list = (parent == null || state == null) ? getImportDeclListNoTransform() : getImportDeclList();
242        list.addChild(node);
243      }
244      /**
245       * @apilevel low-level
246       * @ast method 
247       * 
248       */
249      public void addImportDeclNoTransform(ImportDecl node) {
250        List<ImportDecl> list = getImportDeclListNoTransform();
251        list.addChild(node);
252      }
253      /**
254       * Replaces the ImportDecl list element at index {@code i} with the new node {@code node}.
255       * @param node The new node to replace the old list element.
256       * @param i The list index of the node to be replaced.
257       * @apilevel high-level
258       * @ast method 
259       * 
260       */
261      public void setImportDecl(ImportDecl node, int i) {
262        List<ImportDecl> list = getImportDeclList();
263        list.setChild(node, i);
264      }
265      /**
266       * Retrieves the ImportDecl list.
267       * @return The node representing the ImportDecl list.
268       * @apilevel high-level
269       * @ast method 
270       * 
271       */
272      public List<ImportDecl> getImportDecls() {
273        return getImportDeclList();
274      }
275      /**
276       * Retrieves the ImportDecl list.
277       * <p><em>This method does not invoke AST transformations.</em></p>
278       * @return The node representing the ImportDecl list.
279       * @apilevel low-level
280       * @ast method 
281       * 
282       */
283      public List<ImportDecl> getImportDeclsNoTransform() {
284        return getImportDeclListNoTransform();
285      }
286      /**
287       * Retrieves the ImportDecl list.
288       * @return The node representing the ImportDecl list.
289       * @apilevel high-level
290       * @ast method 
291       * 
292       */
293      @SuppressWarnings({"unchecked", "cast"})
294      public List<ImportDecl> getImportDeclList() {
295        List<ImportDecl> list = (List<ImportDecl>)getChild(0);
296        list.getNumChild();
297        return list;
298      }
299      /**
300       * Retrieves the ImportDecl list.
301       * <p><em>This method does not invoke AST transformations.</em></p>
302       * @return The node representing the ImportDecl list.
303       * @apilevel low-level
304       * @ast method 
305       * 
306       */
307      @SuppressWarnings({"unchecked", "cast"})
308      public List<ImportDecl> getImportDeclListNoTransform() {
309        return (List<ImportDecl>)getChildNoTransform(0);
310      }
311      /**
312       * Replaces the TypeDecl list.
313       * @param list The new list node to be used as the TypeDecl list.
314       * @apilevel high-level
315       * @ast method 
316       * 
317       */
318      public void setTypeDeclList(List<TypeDecl> list) {
319        setChild(list, 1);
320      }
321      /**
322       * Retrieves the number of children in the TypeDecl list.
323       * @return Number of children in the TypeDecl list.
324       * @apilevel high-level
325       * @ast method 
326       * 
327       */
328      public int getNumTypeDecl() {
329        return getTypeDeclList().getNumChild();
330      }
331      /**
332       * Retrieves the number of children in the TypeDecl list.
333       * Calling this method will not trigger rewrites..
334       * @return Number of children in the TypeDecl list.
335       * @apilevel low-level
336       * @ast method 
337       * 
338       */
339      public int getNumTypeDeclNoTransform() {
340        return getTypeDeclListNoTransform().getNumChildNoTransform();
341      }
342      /**
343       * Retrieves the element at index {@code i} in the TypeDecl list..
344       * @param i Index of the element to return.
345       * @return The element at position {@code i} in the TypeDecl list.
346       * @apilevel high-level
347       * @ast method 
348       * 
349       */
350      @SuppressWarnings({"unchecked", "cast"})
351      public TypeDecl getTypeDecl(int i) {
352        return (TypeDecl)getTypeDeclList().getChild(i);
353      }
354      /**
355       * Append an element to the TypeDecl list.
356       * @param node The element to append to the TypeDecl list.
357       * @apilevel high-level
358       * @ast method 
359       * 
360       */
361      public void addTypeDecl(TypeDecl node) {
362        List<TypeDecl> list = (parent == null || state == null) ? getTypeDeclListNoTransform() : getTypeDeclList();
363        list.addChild(node);
364      }
365      /**
366       * @apilevel low-level
367       * @ast method 
368       * 
369       */
370      public void addTypeDeclNoTransform(TypeDecl node) {
371        List<TypeDecl> list = getTypeDeclListNoTransform();
372        list.addChild(node);
373      }
374      /**
375       * Replaces the TypeDecl list element at index {@code i} with the new node {@code node}.
376       * @param node The new node to replace the old list element.
377       * @param i The list index of the node to be replaced.
378       * @apilevel high-level
379       * @ast method 
380       * 
381       */
382      public void setTypeDecl(TypeDecl node, int i) {
383        List<TypeDecl> list = getTypeDeclList();
384        list.setChild(node, i);
385      }
386      /**
387       * Retrieves the TypeDecl list.
388       * @return The node representing the TypeDecl list.
389       * @apilevel high-level
390       * @ast method 
391       * 
392       */
393      public List<TypeDecl> getTypeDecls() {
394        return getTypeDeclList();
395      }
396      /**
397       * Retrieves the TypeDecl list.
398       * <p><em>This method does not invoke AST transformations.</em></p>
399       * @return The node representing the TypeDecl list.
400       * @apilevel low-level
401       * @ast method 
402       * 
403       */
404      public List<TypeDecl> getTypeDeclsNoTransform() {
405        return getTypeDeclListNoTransform();
406      }
407      /**
408       * Retrieves the TypeDecl list.
409       * @return The node representing the TypeDecl list.
410       * @apilevel high-level
411       * @ast method 
412       * 
413       */
414      @SuppressWarnings({"unchecked", "cast"})
415      public List<TypeDecl> getTypeDeclList() {
416        List<TypeDecl> list = (List<TypeDecl>)getChild(1);
417        list.getNumChild();
418        return list;
419      }
420      /**
421       * Retrieves the TypeDecl list.
422       * <p><em>This method does not invoke AST transformations.</em></p>
423       * @return The node representing the TypeDecl list.
424       * @apilevel low-level
425       * @ast method 
426       * 
427       */
428      @SuppressWarnings({"unchecked", "cast"})
429      public List<TypeDecl> getTypeDeclListNoTransform() {
430        return (List<TypeDecl>)getChildNoTransform(1);
431      }
432      /**
433       * @apilevel internal
434       */
435      protected boolean typeBoolean_computed = false;
436      /**
437       * @apilevel internal
438       */
439      protected TypeDecl typeBoolean_value;
440      /* ES: Replacing this with a create method used in type lookup the first time a primitive type is requested
441      private boolean Program.initPrimTypes = false;
442      public void Program.addPrimitiveTypes() {
443        if(!initPrimTypes) {
444          initPrimTypes = true;
445        
446        CompilationUnit u = new CompilationUnit();
447        u.setPackageDecl(PRIMITIVE_PACKAGE_NAME);
448        addCompilationUnit(u);
449    
450        TypeDecl classDecl = generateUnknownType();
451        u.addTypeDecl(classDecl);
452        TypeDecl unknown = classDecl;
453    
454        classDecl = generatePrimitiveType(new BooleanType(), "boolean", unknown);
455        u.addTypeDecl(classDecl);
456        
457        classDecl = generatePrimitiveType(new DoubleType(), "double", unknown);
458        u.addTypeDecl(classDecl);
459        
460        classDecl = generatePrimitiveType(new FloatType(), "float", classDecl);
461        u.addTypeDecl(classDecl);
462        
463        classDecl = generatePrimitiveType(new LongType(), "long", classDecl);
464        u.addTypeDecl(classDecl);
465        
466        classDecl = generatePrimitiveType(new IntType(), "int", classDecl);
467        u.addTypeDecl(classDecl);
468        TypeDecl intDecl = classDecl;
469        
470        classDecl = generatePrimitiveType(new ShortType(), "short", classDecl);
471        u.addTypeDecl(classDecl);
472        
473        classDecl = generatePrimitiveType(new ByteType(), "byte", classDecl);
474        u.addTypeDecl(classDecl);
475        
476        classDecl = generatePrimitiveType(new CharType(), "char", intDecl);
477        u.addTypeDecl(classDecl);
478        
479        classDecl = new NullType();
480        classDecl.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
481        classDecl.setID("null");
482        u.addTypeDecl(classDecl);
483    
484        classDecl = new VoidType();
485        classDecl.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
486        classDecl.setID("void");
487        u.addTypeDecl(classDecl);
488    
489        }
490      }
491    
492    
493      public TypeDecl Program.generatePrimitiveType(PrimitiveType type, String name, TypeDecl superType) {
494        type.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
495        type.setID(name);
496        if(superType != null)
497          type.setSuperClassAccess(superType.createQualifiedAccess());
498        return type;
499      }
500    
501      private TypeDecl Program.generateUnknownType() {
502        ClassDecl classDecl = new UnknownType();
503        classDecl.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
504        classDecl.setID("Unknown");
505        MethodDecl methodDecl = new MethodDecl(
506            new Modifiers(new List().add(
507              new Modifier("public")
508            )),
509            new PrimitiveTypeAccess("Unknown"),
510            "unknown",
511            new List(),
512            new List(),
513            new Opt()
514        );
515        classDecl.addBodyDecl(methodDecl);
516        FieldDeclaration fieldDecl = new FieldDeclaration(
517            new Modifiers(new List().add(
518              new Modifier("public")
519            )),
520            new PrimitiveTypeAccess("Unknown"),
521            "unknown",
522            new Opt()
523        );
524        classDecl.addBodyDecl(fieldDecl);   
525        ConstructorDecl constrDecl = new ConstructorDecl(
526          new Modifiers(new List().add(new Modifier("public"))),
527          "Unknown",
528          new List(),
529          new List(),
530          new Opt(),
531          new Block()
532        );
533        classDecl.addBodyDecl(constrDecl);
534          
535        return classDecl;
536      }
537    
538    * @attribute syn
539       * @aspect PrimitiveTypes
540       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrimitiveTypes.jrag:113
541       */
542      @SuppressWarnings({"unchecked", "cast"})
543      public TypeDecl typeBoolean() {
544        if(typeBoolean_computed) {
545          return typeBoolean_value;
546        }
547          ASTNode$State state = state();
548      int num = state.boundariesCrossed;
549      boolean isFinal = this.is$Final();
550        typeBoolean_value = typeBoolean_compute();
551        typeBoolean_value.setParent(this);
552        typeBoolean_value.is$Final = true;
553      if(true){ typeBoolean_computed = true; }
554            return typeBoolean_value;
555      }
556      /**
557       * @apilevel internal
558       */
559      private TypeDecl typeBoolean_compute() {
560        BooleanType type = new BooleanType();
561        type.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
562        type.setID("boolean");
563        type.setSuperClassAccess(unknownType().createQualifiedAccess());
564        return type;
565      }
566      /**
567       * @apilevel internal
568       */
569      protected boolean typeByte_computed = false;
570      /**
571       * @apilevel internal
572       */
573      protected TypeDecl typeByte_value;
574      /**
575       * @attribute syn
576       * @aspect PrimitiveTypes
577       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrimitiveTypes.jrag:120
578       */
579      @SuppressWarnings({"unchecked", "cast"})
580      public TypeDecl typeByte() {
581        if(typeByte_computed) {
582          return typeByte_value;
583        }
584          ASTNode$State state = state();
585      int num = state.boundariesCrossed;
586      boolean isFinal = this.is$Final();
587        typeByte_value = typeByte_compute();
588        typeByte_value.setParent(this);
589        typeByte_value.is$Final = true;
590      if(true){ typeByte_computed = true; }
591            return typeByte_value;
592      }
593      /**
594       * @apilevel internal
595       */
596      private TypeDecl typeByte_compute() {
597        ByteType type = new ByteType();
598        type.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
599        type.setID("byte");
600        type.setSuperClassAccess(typeShort().createQualifiedAccess());
601        return type;
602      }
603      /**
604       * @apilevel internal
605       */
606      protected boolean typeShort_computed = false;
607      /**
608       * @apilevel internal
609       */
610      protected TypeDecl typeShort_value;
611      /**
612       * @attribute syn
613       * @aspect PrimitiveTypes
614       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrimitiveTypes.jrag:127
615       */
616      @SuppressWarnings({"unchecked", "cast"})
617      public TypeDecl typeShort() {
618        if(typeShort_computed) {
619          return typeShort_value;
620        }
621          ASTNode$State state = state();
622      int num = state.boundariesCrossed;
623      boolean isFinal = this.is$Final();
624        typeShort_value = typeShort_compute();
625        typeShort_value.setParent(this);
626        typeShort_value.is$Final = true;
627      if(true){ typeShort_computed = true; }
628            return typeShort_value;
629      }
630      /**
631       * @apilevel internal
632       */
633      private TypeDecl typeShort_compute() {
634        ShortType type = new ShortType();
635        type.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
636        type.setID("short");
637        type.setSuperClassAccess(typeInt().createQualifiedAccess());
638        return type;
639      }
640      /**
641       * @apilevel internal
642       */
643      protected boolean typeChar_computed = false;
644      /**
645       * @apilevel internal
646       */
647      protected TypeDecl typeChar_value;
648      /**
649       * @attribute syn
650       * @aspect PrimitiveTypes
651       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrimitiveTypes.jrag:134
652       */
653      @SuppressWarnings({"unchecked", "cast"})
654      public TypeDecl typeChar() {
655        if(typeChar_computed) {
656          return typeChar_value;
657        }
658          ASTNode$State state = state();
659      int num = state.boundariesCrossed;
660      boolean isFinal = this.is$Final();
661        typeChar_value = typeChar_compute();
662        typeChar_value.setParent(this);
663        typeChar_value.is$Final = true;
664      if(true){ typeChar_computed = true; }
665            return typeChar_value;
666      }
667      /**
668       * @apilevel internal
669       */
670      private TypeDecl typeChar_compute() {
671        CharType type = new CharType();
672        type.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
673        type.setID("char");
674        type.setSuperClassAccess(typeInt().createQualifiedAccess());
675        return type;
676      }
677      /**
678       * @apilevel internal
679       */
680      protected boolean typeInt_computed = false;
681      /**
682       * @apilevel internal
683       */
684      protected TypeDecl typeInt_value;
685      /**
686       * @attribute syn
687       * @aspect PrimitiveTypes
688       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrimitiveTypes.jrag:141
689       */
690      @SuppressWarnings({"unchecked", "cast"})
691      public TypeDecl typeInt() {
692        if(typeInt_computed) {
693          return typeInt_value;
694        }
695          ASTNode$State state = state();
696      int num = state.boundariesCrossed;
697      boolean isFinal = this.is$Final();
698        typeInt_value = typeInt_compute();
699        typeInt_value.setParent(this);
700        typeInt_value.is$Final = true;
701      if(true){ typeInt_computed = true; }
702            return typeInt_value;
703      }
704      /**
705       * @apilevel internal
706       */
707      private TypeDecl typeInt_compute() {
708        IntType type = new IntType();
709        type.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
710        type.setID("int");
711        type.setSuperClassAccess(typeLong().createQualifiedAccess());
712        return type;
713      }
714      /**
715       * @apilevel internal
716       */
717      protected boolean typeLong_computed = false;
718      /**
719       * @apilevel internal
720       */
721      protected TypeDecl typeLong_value;
722      /**
723       * @attribute syn
724       * @aspect PrimitiveTypes
725       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrimitiveTypes.jrag:148
726       */
727      @SuppressWarnings({"unchecked", "cast"})
728      public TypeDecl typeLong() {
729        if(typeLong_computed) {
730          return typeLong_value;
731        }
732          ASTNode$State state = state();
733      int num = state.boundariesCrossed;
734      boolean isFinal = this.is$Final();
735        typeLong_value = typeLong_compute();
736        typeLong_value.setParent(this);
737        typeLong_value.is$Final = true;
738      if(true){ typeLong_computed = true; }
739            return typeLong_value;
740      }
741      /**
742       * @apilevel internal
743       */
744      private TypeDecl typeLong_compute() {
745        LongType type = new LongType();
746        type.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
747        type.setID("long");
748        // Float doesn't seem right here, keeping it because the old code does this
749        type.setSuperClassAccess(typeFloat().createQualifiedAccess()); 
750        return type;
751      }
752      /**
753       * @apilevel internal
754       */
755      protected boolean typeFloat_computed = false;
756      /**
757       * @apilevel internal
758       */
759      protected TypeDecl typeFloat_value;
760      /**
761       * @attribute syn
762       * @aspect PrimitiveTypes
763       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrimitiveTypes.jrag:156
764       */
765      @SuppressWarnings({"unchecked", "cast"})
766      public TypeDecl typeFloat() {
767        if(typeFloat_computed) {
768          return typeFloat_value;
769        }
770          ASTNode$State state = state();
771      int num = state.boundariesCrossed;
772      boolean isFinal = this.is$Final();
773        typeFloat_value = typeFloat_compute();
774        typeFloat_value.setParent(this);
775        typeFloat_value.is$Final = true;
776      if(true){ typeFloat_computed = true; }
777            return typeFloat_value;
778      }
779      /**
780       * @apilevel internal
781       */
782      private TypeDecl typeFloat_compute() {
783        FloatType type = new FloatType();
784        type.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
785        type.setID("float");
786        type.setSuperClassAccess(typeDouble().createQualifiedAccess());
787        return type;
788      }
789      /**
790       * @apilevel internal
791       */
792      protected boolean typeDouble_computed = false;
793      /**
794       * @apilevel internal
795       */
796      protected TypeDecl typeDouble_value;
797      /**
798       * @attribute syn
799       * @aspect PrimitiveTypes
800       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrimitiveTypes.jrag:163
801       */
802      @SuppressWarnings({"unchecked", "cast"})
803      public TypeDecl typeDouble() {
804        if(typeDouble_computed) {
805          return typeDouble_value;
806        }
807          ASTNode$State state = state();
808      int num = state.boundariesCrossed;
809      boolean isFinal = this.is$Final();
810        typeDouble_value = typeDouble_compute();
811        typeDouble_value.setParent(this);
812        typeDouble_value.is$Final = true;
813      if(true){ typeDouble_computed = true; }
814            return typeDouble_value;
815      }
816      /**
817       * @apilevel internal
818       */
819      private TypeDecl typeDouble_compute() {
820        DoubleType type = new DoubleType();
821        type.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
822        type.setID("double");
823        type.setSuperClassAccess(unknownType().createQualifiedAccess());
824        return type;
825      }
826      /**
827       * @apilevel internal
828       */
829      protected boolean typeVoid_computed = false;
830      /**
831       * @apilevel internal
832       */
833      protected TypeDecl typeVoid_value;
834      /**
835       * @attribute syn
836       * @aspect PrimitiveTypes
837       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrimitiveTypes.jrag:170
838       */
839      @SuppressWarnings({"unchecked", "cast"})
840      public TypeDecl typeVoid() {
841        if(typeVoid_computed) {
842          return typeVoid_value;
843        }
844          ASTNode$State state = state();
845      int num = state.boundariesCrossed;
846      boolean isFinal = this.is$Final();
847        typeVoid_value = typeVoid_compute();
848        typeVoid_value.setParent(this);
849        typeVoid_value.is$Final = true;
850      if(true){ typeVoid_computed = true; }
851            return typeVoid_value;
852      }
853      /**
854       * @apilevel internal
855       */
856      private TypeDecl typeVoid_compute() {
857        VoidType classDecl = new VoidType();
858        classDecl.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
859        classDecl.setID("void");
860        return classDecl;
861      }
862      /**
863       * @apilevel internal
864       */
865      protected boolean typeNull_computed = false;
866      /**
867       * @apilevel internal
868       */
869      protected TypeDecl typeNull_value;
870      /**
871       * @attribute syn
872       * @aspect PrimitiveTypes
873       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrimitiveTypes.jrag:176
874       */
875      @SuppressWarnings({"unchecked", "cast"})
876      public TypeDecl typeNull() {
877        if(typeNull_computed) {
878          return typeNull_value;
879        }
880          ASTNode$State state = state();
881      int num = state.boundariesCrossed;
882      boolean isFinal = this.is$Final();
883        typeNull_value = typeNull_compute();
884        typeNull_value.setParent(this);
885        typeNull_value.is$Final = true;
886      if(true){ typeNull_computed = true; }
887            return typeNull_value;
888      }
889      /**
890       * @apilevel internal
891       */
892      private TypeDecl typeNull_compute() {
893        NullType classDecl = new NullType();
894        classDecl.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
895        classDecl.setID("null");
896        return classDecl;
897      }
898      /**
899       * @apilevel internal
900       */
901      protected boolean unknownType_computed = false;
902      /**
903       * @apilevel internal
904       */
905      protected TypeDecl unknownType_value;
906      /**
907       * @attribute syn
908       * @aspect PrimitiveTypes
909       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrimitiveTypes.jrag:182
910       */
911      @SuppressWarnings({"unchecked", "cast"})
912      public TypeDecl unknownType() {
913        if(unknownType_computed) {
914          return unknownType_value;
915        }
916          ASTNode$State state = state();
917      int num = state.boundariesCrossed;
918      boolean isFinal = this.is$Final();
919        unknownType_value = unknownType_compute();
920        unknownType_value.setParent(this);
921        unknownType_value.is$Final = true;
922      if(true){ unknownType_computed = true; }
923            return unknownType_value;
924      }
925      /**
926       * @apilevel internal
927       */
928      private TypeDecl unknownType_compute() {
929        ClassDecl classDecl = new UnknownType();
930        classDecl.setModifiers(new Modifiers(new List().add(new Modifier("public"))));
931        classDecl.setID("Unknown");
932        MethodDecl methodDecl = new MethodDecl(
933            new Modifiers(new List().add(
934              new Modifier("public")
935            )),
936            new PrimitiveTypeAccess("Unknown"),
937            "unknown",
938            new List(),
939            new List(),
940            new Opt()
941        );
942        classDecl.addBodyDecl(methodDecl);
943        FieldDeclaration fieldDecl = new FieldDeclaration(
944            new Modifiers(new List().add(
945              new Modifier("public")
946            )),
947            new PrimitiveTypeAccess("Unknown"),
948            "unknown",
949            new Opt()
950        );
951        classDecl.addBodyDecl(fieldDecl);   
952        ConstructorDecl constrDecl = new ConstructorDecl(
953          new Modifiers(new List().add(new Modifier("public"))),
954          "Unknown",
955          new List(),
956          new List(),
957          new Opt(),
958          new Block()
959        );
960        classDecl.addBodyDecl(constrDecl);      
961        return classDecl;
962      }
963      /**
964       * @apilevel internal
965       */
966      public ASTNode rewriteTo() {
967        return super.rewriteTo();
968      }
969    }