public static final int DOUBLE=8;
public static final int VOID=9;
public static final int NULL=10;
- public static final int CLASS=11;
+ public static final int TAG=11;
+ public static final int CLASS=12;
int arraycount;
TypeDescriptor t=(TypeDescriptor)o;
if (t.type!=type)
return false;
- if ((type==CLASS)&&(t.class_desc!=class_desc))
+ if ((type==CLASS)&&(!t.getSymbol().equals(getSymbol())))
return false;
if (t.arraycount!=arraycount)
return false;
return false;
}
+ public boolean isString() {
+ if (type!=CLASS)
+ return false;
+ if (arraycount>0)
+ return false;
+ if (!getSymbol().equals(TypeUtil.StringClass))
+ return false;
+ return true;
+ }
+
public int hashCode() {
int hashcode=type^arraycount;
if (type==CLASS)
else if (isClass())
return class_desc.getSafeDescriptor();
else if (isByte())
- return "C";
+ return "B";
else if (isChar())
return "C";
else if (isShort())
return "D";
else if (isFloat())
return "F";
+ else if (isTag())
+ return "T";
else throw new Error();
}
}
public boolean isPtr() {
- return (isClass()||isNull());
+ return (isClass()||isNull()||isTag()||isArray());
}
public boolean isIntegerType() {
public boolean isClass() {
return type==CLASS;
}
+
+ public boolean isTag() {
+ return type==TAG;
+ }
public TypeDescriptor(NameDescriptor name) {
super(name.toString());
this.arraycount=0;
}
- private TypeDescriptor(String st) {
+ public TypeDescriptor(String st) {
super(st);
+ this.type=CLASS;
+ this.class_desc=null;
+ this.arraycount=0;
}
public ClassDescriptor getClassDesc() {
}
public String toString() {
- if (type==CLASS)
+ if (type==CLASS) {
return name;
- else
+ } else
+ return decodeInt(type);
+ }
+
+ public String toPrettyString() {
+ if (type==CLASS) {
+ String str=name;
+ for(int i=0;i<arraycount;i++)
+ str+="[]";
+ return str;
+ } else
return decodeInt(type);
}
return "void";
else if (type==NULL)
return "null";
+ else if (type==TAG)
+ return TypeUtil.TagClass;
else throw new Error();
}
}