X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=Robust%2Fsrc%2FIR%2FTypeDescriptor.java;h=431d964dc0d1d76572f17fb2b2951506890ce7ef;hb=5c990dc2f16fb12de3201155cf241f329a712a09;hp=0ff054713f70a960160c912b416cc4dcfacb5901;hpb=cc49a7b0b58d134b52f69f5407f2a31f6e1d9c87;p=IRC.git diff --git a/Robust/src/IR/TypeDescriptor.java b/Robust/src/IR/TypeDescriptor.java index 0ff05471..431d964d 100644 --- a/Robust/src/IR/TypeDescriptor.java +++ b/Robust/src/IR/TypeDescriptor.java @@ -30,7 +30,7 @@ public class TypeDescriptor extends Descriptor { private int type; ClassDescriptor class_desc; boolean isClassNameRef = false; - + private Vector annotationSet; private TypeExtension typeExtension; @@ -38,11 +38,11 @@ public class TypeDescriptor extends Descriptor { if (o instanceof TypeDescriptor) { TypeDescriptor t=(TypeDescriptor)o; if (t.type!=type) - return false; + return false; if ((type==CLASS)&&(!t.getSymbol().equals(getSymbol()))) - return false; + return false; if (t.arraycount!=arraycount) - return false; + return false; if (t.isClassNameRef != this.isClassNameRef) return false; return true; @@ -59,11 +59,11 @@ public class TypeDescriptor extends Descriptor { return false; return true; } - + public boolean isClassNameRef() { return this.isClassNameRef; } - + public void setClassNameRef() { this.isClassNameRef = true; } @@ -79,14 +79,14 @@ public class TypeDescriptor extends Descriptor { if (arraycount!=0||!isClass()) return false; return (name.equals("bytewrapper")|| - name.equals("booleanwrapper")|| - name.equals("shortwrapper")|| - name.equals("intwrapper")|| - name.equals("longwrapper")|| - name.equals("charwrapper")|| - name.equals("floatwrapper")|| - name.equals("doublewrapper")|| - name.equals("Objectwrapper")); + name.equals("booleanwrapper")|| + name.equals("shortwrapper")|| + name.equals("intwrapper")|| + name.equals("longwrapper")|| + name.equals("charwrapper")|| + name.equals("floatwrapper")|| + name.equals("doublewrapper")|| + name.equals("Objectwrapper")); } public TypeDescriptor makeArray(State state) { @@ -150,7 +150,9 @@ public class TypeDescriptor extends Descriptor { return "float"; else if (isOffset()) return "short"; - else + else if (isNull()) + return "null"; + else throw new Error("Error Type: "+type); } @@ -267,12 +269,12 @@ public class TypeDescriptor extends Descriptor { public boolean isEnum() { if(this.type != CLASS) { return false; - } else if(this.class_desc != null){ + } else if(this.class_desc != null) { return this.class_desc.isEnum(); } return false; } - + public boolean isClass() { return (type==CLASS && !isEnum()); } @@ -282,7 +284,7 @@ public class TypeDescriptor extends Descriptor { } public boolean isImmutable() { - return isPrimitive() || isString(); + return isPrimitive(); } public TypeDescriptor(NameDescriptor name) { @@ -338,7 +340,7 @@ public class TypeDescriptor extends Descriptor { } for(int i=0; i getAnnotationMarkers(){ + + public Vector getAnnotationMarkers() { return annotationSet; } - - public void setExtension(TypeExtension te){ + + public void setExtension(TypeExtension te) { typeExtension=te; } - - public TypeExtension getExtension(){ + + public TypeExtension getExtension() { return typeExtension; } - + }