001 // -*- mode: java -*-
002 /* Copyright 2000, 2001, Compaq Computer Corporation */
003
004 /* IF THIS IS A JAVA FILE, DO NOT EDIT IT!
005
006 Most Java files in this directory which are part of the Javafe AST
007 are automatically generated using the astgen comment (see
008 ESCTools/Javafe/astgen) from the input file 'hierarchy.h'. If you
009 wish to modify AST classes or introduce new ones, modify
010 'hierarchy.j.'
011 */
012
013 package javafe.ast;
014
015 import javafe.util.Assert;
016 import javafe.util.Location;
017 import javafe.util.ErrorSet;
018
019 // Convention: unless otherwise noted, integer fields named "loc" refer
020 // to the location of the first character of the syntactic unit
021
022
023 /**
024 * Represents a PrimitiveType syntactic unit.
025 * Subtypes determing the range of a valid tags
026 *
027 * @warning This AST node has associated locations only if syntax is
028 * true.
029 *
030 * for backwards compatibility, the PrimitiveType makers make calls to the JavafePrimitiveType
031 */
032 public abstract class PrimitiveType extends Type
033 {
034
035 //@ invariant isValidTag();
036 public abstract /*@pure*/ boolean isValidTag();
037 public int tag;
038
039
040 public int loc;
041
042
043 //@ also ensures \result == this.tag;
044 public final /*@pure*/ int getTag() { return this.tag; }
045
046 //@ public represents startLoc <- loc;
047 public /*@ pure @*/ int getStartLoc() { return loc; }
048 protected PrimitiveType() {throw new RuntimeException("this sould never be called");}
049
050
051
052 // Generated boilerplate constructors:
053
054 //@ ensures this.tmodifiers == tmodifiers;
055 //@ ensures this.tag == tag;
056 //@ ensures this.loc == loc;
057 protected PrimitiveType(TypeModifierPragmaVec tmodifiers, int tag, int loc) {
058 super(tmodifiers);
059 this.tag = tag;
060 this.loc = loc;
061 }
062 public void check() {
063 super.check();
064 if (this.tmodifiers != null)
065 for(int i = 0; i < this.tmodifiers.size(); i++)
066 this.tmodifiers.elementAt(i).check();
067 }
068
069 }