|
||||||||||
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
at.dms.kjc.CNumericType
public abstract class CNumericType
This class represents java and kopi numericals types Such as byte, short, int, long, float, double
Field Summary |
---|
Fields inherited from class at.dms.kjc.CType |
---|
instance, 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 |
CNumericType(int typeID)
Constructor |
Method Summary | |
---|---|
protected abstract void |
appendSignature(SimpleStringBuffer buffer)
Appends the VM signature of this type to the specified buffer. |
static CType |
binaryPromote(CType t1,
CType t2)
binaryPromote search the type corresponding to the promotion of the two types |
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(CNumericType other)
Clones all fields of this into |
abstract void |
genCastTo(CNumericType dest,
CodeSequence code)
Generates a bytecode sequence to convert a value of this type to the specified destination type. |
abstract 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. |
abstract boolean |
isAssignableTo(CType dest)
Can this type be converted to the specified type by assignment conversion (JLS 5.2) ? |
boolean |
isCastableTo(CType dest)
Can this type be converted to the specified type by casting conversion (JLS 5.5) ? |
abstract boolean |
isFloatingPoint()
Is this a floating point type ? |
boolean |
isNumeric()
Is this a numeric type ? |
abstract boolean |
isOrdinal()
Is this type ordinal ? |
abstract String |
toString()
Returns a string representation of this type. |
static CType |
unaryPromote(CType t1)
unaryPromote search the type corresponding to the type after computation |
Methods inherited from class at.dms.kjc.CType |
---|
checked, deepCloneInto, equals, genMethodSignature, getArrayLoadOpcode, getArrayStoreOpcode, getCClass, getLoadOpcode, getReturnOpcode, getStoreOpcode, getTypeID, isArrayType, isCheckedException, isClassType, isPrimitive, isReference, parseMethodSignature, parseSignature |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected CNumericType(int typeID)
typeID
- the ident (int value) of this typeMethod Detail |
---|
public abstract String toString()
toString
in class CType
public abstract String getSignature()
getSignature
in class CType
protected abstract void appendSignature(SimpleStringBuffer buffer)
appendSignature
in class CType
public abstract int getSizeInC()
getSizeInC
in class CType
public abstract int getSize()
getSize
in class CType
public abstract boolean isOrdinal()
isOrdinal
in class CType
public abstract boolean isFloatingPoint()
isFloatingPoint
in class CType
public boolean isNumeric()
isNumeric
in class CType
public void checkType(CContext context) throws UnpositionedError
checkType
in class CType
UnpositionedError
- this error will be positioned soonpublic abstract boolean isAssignableTo(CType dest)
isAssignableTo
in class CType
dest
- the destination type
public boolean isCastableTo(CType dest)
isCastableTo
in class CType
dest
- the destination type
public static CType unaryPromote(CType t1)
t1
- the type
public static CType binaryPromote(CType t1, CType t2)
t1
- the first typet2
- the second type
public abstract void genCastTo(CNumericType dest, CodeSequence code)
dest
- the destination typecode
- the code sequencepublic Object deepClone()
deepClone
in interface DeepCloneable
deepClone
in class CType
protected void deepCloneInto(CNumericType other)
other
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |