|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.util.Utils
at.dms.kjc.CType
public abstract class CType
Root for type hierarchy
Field Summary | |
---|---|
protected static MethodSignatureParser |
instance
|
protected int |
type
|
Fields inherited from class at.dms.util.Utils |
---|
EMPTY_LIST, getForLoopCallers |
Fields inherited from interface at.dms.kjc.Constants |
---|
CMP_VERSION, JAV_CLASS, JAV_CLONE, JAV_CLONEABLE, JAV_CONSTRUCTOR, JAV_ERROR, JAV_EXCEPTION, JAV_INIT, JAV_LENGTH, JAV_NAME_SEPARATOR, JAV_OBJECT, JAV_OUTER_THIS, JAV_RUNTIME, JAV_RUNTIME_EXCEPTION, JAV_STATIC_INIT, JAV_STRING, JAV_STRINGBUFFER, JAV_THIS, JAV_THROWABLE, OPE_BAND, OPE_BNOT, OPE_BOR, OPE_BSR, OPE_BXOR, OPE_EQ, OPE_GE, OPE_GT, OPE_LE, OPE_LNOT, OPE_LT, OPE_MINUS, OPE_NE, OPE_PERCENT, OPE_PLUS, OPE_POSTDEC, OPE_POSTINC, OPE_PREDEC, OPE_PREINC, OPE_SIMPLE, OPE_SL, OPE_SLASH, OPE_SR, OPE_STAR, TID_ARRAY, TID_BIT, TID_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_SHORT, TID_VECTOR, TID_VOID, VECTOR_EMPTY |
Constructor Summary | |
---|---|
protected |
CType()
|
protected |
CType(int type)
Constructs a type signature |
Method Summary | |
---|---|
protected abstract void |
appendSignature(SimpleStringBuffer buffer)
Appends the VM signature of this type to the specified buffer. |
boolean |
checked()
|
abstract void |
checkType(CContext context)
check that type is valid necessary to resolve String into java/lang/String |
Object |
deepClone()
Returns a deep clone of this object. |
protected void |
deepCloneInto(CType other)
Clones all fields of this into |
boolean |
equals(CType other)
equals |
static String |
genMethodSignature(CType returnType,
CType[] parameters)
Generates the signature of a method. |
int |
getArrayLoadOpcode()
Returns the opcode used to load a value from an array. |
int |
getArrayStoreOpcode()
Returns the opcode used to store a value into an array. |
CClass |
getCClass()
|
int |
getLoadOpcode()
Returns the opcode to load a local variable of this type. |
int |
getReturnOpcode()
Returns the opcode to return a value of this type. |
String |
getSignature()
Returns the VM signature of this type. |
abstract int |
getSize()
Returns the stack size used by a value of this type. |
abstract int |
getSizeInC()
Returns the stack size (conservative estimate of maximum number of bytes needed in C on 32-bit machine) used by a value of this type. |
int |
getStoreOpcode()
Returns the opcode to store a local variable of this type. |
int |
getTypeID()
Returns the ID of this type |
boolean |
isArrayType()
|
abstract boolean |
isAssignableTo(CType dest)
Can this type be converted to the specified type by assignment conversion (JLS 5.2) ? |
abstract boolean |
isCastableTo(CType dest)
Can this type be converted to the specified type by casting conversion (JLS 5.5) ? |
boolean |
isCheckedException()
|
boolean |
isClassType()
Check if a type is a class type |
boolean |
isFloatingPoint()
Check if a type is a floating point type |
boolean |
isNumeric()
Check if a type is a numeric type |
boolean |
isOrdinal()
Check if a type is an integer type |
boolean |
isPrimitive()
Check if a type is a class type |
boolean |
isReference()
Check if a type is a class type |
static CType[] |
parseMethodSignature(String sig)
Returns an array of types represented by the type signature For methods, the return type is the last element of the array |
static CType |
parseSignature(String signature)
Parse a java type signature Description : Attempts to parse the provided string as if it started with the Java VM-standard signature for a type. |
abstract String |
toString()
Transforms this type to a string |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int type
protected static MethodSignatureParser instance
Constructor Detail |
---|
protected CType()
protected CType(int type)
Method Detail |
---|
public boolean equals(CType other)
public abstract String toString()
toString
in class Object
public String getSignature()
protected abstract void appendSignature(SimpleStringBuffer buffer)
public abstract int getSizeInC()
public abstract int getSize()
public boolean isNumeric()
public boolean isOrdinal()
public boolean isFloatingPoint()
public boolean isPrimitive()
public boolean isReference()
public boolean isClassType()
public boolean isArrayType()
public boolean checked()
public final int getTypeID()
public abstract void checkType(CContext context) throws UnpositionedError
UnpositionedError
- this error will be positioned soonpublic abstract boolean isCastableTo(CType dest)
dest
- the destination type
public abstract boolean isAssignableTo(CType dest)
dest
- the destination type
public boolean isCheckedException()
public CClass getCClass()
public int getLoadOpcode()
public int getStoreOpcode()
public int getArrayLoadOpcode()
public int getArrayStoreOpcode()
public int getReturnOpcode()
public static CType parseSignature(String signature)
public static CType[] parseMethodSignature(String sig)
public static String genMethodSignature(CType returnType, CType[] parameters)
returnType
- the return type of the methodparameters
- the parameter types of the methodpublic Object deepClone()
deepClone
in interface DeepCloneable
deepClone
in class Utils
protected void deepCloneInto(CType other)
other
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |