int arraycount;
private int type;
ClassDescriptor class_desc;
- boolean isStatic = false;
+ boolean isClassNameRef = false;
public boolean equals(Object o) {
if (o instanceof TypeDescriptor) {
return false;
if (t.arraycount!=arraycount)
return false;
+ if (t.isClassNameRef != this.isClassNameRef)
+ return false;
return true;
}
return false;
return true;
}
- public boolean isStatic() {
- return this.isStatic;
+ public boolean isClassNameRef() {
+ return this.isClassNameRef;
}
- public void setStatic() {
- this.isStatic = true;
+ public void setClassNameRef() {
+ this.isClassNameRef = true;
}
public int hashCode() {
public String getSafeSymbol() {
if (isArray())
return IR.Flat.BuildCode.arraytype;
- else if (isClass())
+ else if (isClass()) {
return class_desc.getSafeSymbol();
- else if (isByte())
+ } else if (isByte())
return "char";
else if (isChar())
return "short";
return "float";
else if (isOffset())
return "short";
- else throw new Error("Error Type: "+type);
+ else
+ throw new Error("Error Type: "+type);
}
public String getRepairSymbol() {
if (isArray())
return IR.Flat.BuildCode.arraytype;
- else if (isClass())
+ else if (isClass()) {
return class_desc.getSymbol();
- else if (isByte())
+ } else if (isByte())
return "byte";
else if (isChar())
return "short";
}
public boolean isPtr() {
- return (isClass()||isNull()||isTag()||isArray());
+ return ((isClass()&&!isEnum())||isNull()||isTag()||isArray());
}
public boolean isIntegerType() {
- return (isInt()||isLong()||isShort()||isChar()||isByte());
+ return (isInt()||isLong()||isShort()||isChar()||isByte()||isEnum());
}
public void setClassDescriptor(ClassDescriptor cd) {
return ((type>=BYTE)&&(type<=DOUBLE));
}
+ public boolean isEnum() {
+ if(this.type != CLASS) {
+ return false;
+ } else if(this.class_desc != null){
+ return this.class_desc.isEnum();
+ }
+ return false;
+ }
+
public boolean isClass() {
return type==CLASS;
}
this.type=CLASS;
this.class_desc=null;
this.arraycount=0;
- this.isStatic =false;
+ this.isClassNameRef =false;
}
public TypeDescriptor(String st) {
this.type=CLASS;
this.class_desc=null;
this.arraycount=0;
- this.isStatic =false;
+ this.isClassNameRef =false;
}
public ClassDescriptor getClassDesc() {
this.type=CLASS;
this.class_desc=cd;
this.arraycount=0;
- this.isStatic =false;
+ this.isClassNameRef =false;
}
public TypeDescriptor(int t) {
super(decodeInt(t));
this.type=t;
this.arraycount=0;
- this.isStatic =false;
+ this.isClassNameRef =false;
}
public String toString() {
else if (type==VOID)
return "void";
else if (type==NULL)
- return "null";
+ return "NULL";
else if (type==TAG)
return TypeUtil.TagClass;
else if (type==OFFSET)