|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--at.dms.util.Utils | +--at.dms.kjc.CType
Root for type abstraction hierarchy.
Field Summary | |
protected static SignatureParser |
signatureParser
VM type signature parser instance. |
protected int |
type
Type identifier. |
Fields inherited from class at.dms.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
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_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_SHORT, TID_VOID |
Constructor Summary | |
protected |
CType(int typeID)
Constructs a type baseclass with the general type identifier typeID . |
Method Summary | |
protected abstract void |
appendSignature(FastStringBuffer buff)
Transforms this type to a string. |
boolean |
checked()
|
abstract void |
checkType(CContext context)
check that type is valid. |
boolean |
equals(CType other)
Default equals for type abstractions. |
static java.lang.String |
genMethodSignature(CType returnType,
CType[] parameters)
Generate a method signature. |
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. |
java.lang.String |
getSignature()
Transforms this type to a string |
abstract int |
getSize()
Returns the size used in stack by 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 |
implicitlyCastTo(CType dest)
implicitlyCastTo. |
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 |
isCodedHasInt()
? |
boolean |
isFloatingPoint()
Check if a type is an integer 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(java.lang.String sig)
Returns an array of types represented by the type signature. |
static CType |
parseSignature(java.lang.String signature)
Parse a java type signature. |
abstract java.lang.String |
toString()
Transforms this type to a string. |
Methods inherited from class at.dms.util.Utils |
assert, assert, fail, fail, hasFlag, hasMoreThanOneFlag, hasOtherFlags, splitQualifiedName, splitQualifiedName, vectorToArray, vectorToIntArray |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected static final SignatureParser signatureParser
protected int type
Constructor Detail |
protected CType(int typeID)
typeID
.Method Detail |
public boolean equals(CType other)
public abstract java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getSignature()
protected abstract void appendSignature(FastStringBuffer buff)
public abstract int getSize()
public boolean isNumeric()
public boolean isCodedHasInt()
public boolean isOrdinal()
public boolean isFloatingPoint()
public boolean isPrimitive()
public boolean isReference()
public boolean isClassType()
public boolean isArrayType()
public boolean checked()
public int getTypeID()
public abstract void checkType(CContext context) throws UnpositionedError
UnpositionedError
- This error will be positioned soon.public abstract boolean isCastableTo(CType dest)
dest
- The destination type.public boolean implicitlyCastTo(CType dest)
dest
- the expression type to cast topublic abstract boolean isAssignableTo(CType dest)
dest
- The destination type.public boolean isCheckedException()
public CClass getCClass()
public int getLoadOpcode()
public int getStoreOpcode()
public int getReturnOpcode()
public static CType parseSignature(java.lang.String signature)
public static CType[] parseMethodSignature(java.lang.String sig)
public static java.lang.String genMethodSignature(CType returnType, CType[] parameters)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |