6 * represents a symbol in the language (var name, function name, etc).
9 public class TypeDescriptor extends Descriptor {
10 public static final int BYTE=1;
11 public static final int SHORT=2;
12 public static final int INT=3;
13 public static final int LONG=4;
14 public static final int CHAR=5;
15 public static final int BOOLEAN=6;
16 public static final int FLOAT=7;
17 public static final int DOUBLE=8;
18 public static final int VOID=9;
19 public static final int NULL=10;
20 public static final int CLASS=11;
25 ClassDescriptor class_desc;
27 public void setClassDescriptor(ClassDescriptor cd) {
31 public boolean isVoid() {
35 public boolean isPrimitive() {
36 return ((type>=BYTE)&&(type<=DOUBLE));
39 public boolean isClass() {
43 public TypeDescriptor(NameDescriptor name) {
44 super(name.toString());
49 public ClassDescriptor getClassDesc() {
53 public TypeDescriptor(ClassDescriptor cd) {
54 super(cd.getSymbol());
59 public TypeDescriptor(int t) {
64 public String toString() {
68 return decodeInt(type);
71 private static String decodeInt(int type) {
74 else if (type==BOOLEAN)
86 else if (type==DOUBLE)
92 else throw new Error();