|
||||||||||
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 | +--at.dms.kjc.CNumericType
This class represents java and kopi numericals types Such as byte, short, int, long, float, double
Fields inherited from class at.dms.kjc.CType |
signatureParser, type |
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 |
CNumericType(int typeID)
Constructor |
Method Summary | |
protected void |
appendSignature(FastStringBuffer buff)
Transforms this type to a string |
static CType |
binaryPromote(CType left,
CType right)
Returns the type to which both operands in a binary expression must be promoted before the operation is performed. |
void |
checkType(CContext context)
check that type is valid necessary to resolve String into java/lang/String |
void |
genCastTo(CNumericType dest,
CodeSequence code)
Generates a sequence of bytecodes |
java.lang.String |
getSignature()
Transforms this type to a string |
int |
getSize()
Returns the size used in stack by value of this type |
boolean |
implicitlyCastTo(CType dest)
implicitlyCastTo |
boolean |
isAssignableTo(CType dest)
isAssignableTo |
boolean |
isCastableTo(CType dest)
isCastableTo |
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 |
java.lang.String |
toString()
Transforms this type to a string |
static CType |
unaryPromote(CType type)
Returns the unary-promoted type for the argument type . |
Methods inherited from class at.dms.kjc.CType |
checked, equals, genMethodSignature, getCClass, getLoadOpcode, getReturnOpcode, getStoreOpcode, getTypeID, isArrayType, isCheckedException, isClassType, isPrimitive, isReference, parseMethodSignature, parseSignature |
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 |
|
Constructor Detail |
protected CNumericType(int typeID)
typeID
- the ident (int value) of this typeMethod Detail |
public java.lang.String toString()
toString
in class CType
public java.lang.String getSignature()
getSignature
in class CType
at.dms.kjc.CType
protected void appendSignature(FastStringBuffer buff)
appendSignature
in class CType
public int getSize()
getSize
in class CType
public boolean isNumeric()
isNumeric
in class CType
public boolean isCodedHasInt()
CType
isCodedHasInt
in class CType
public boolean isOrdinal()
isOrdinal
in class CType
public boolean isFloatingPoint()
isFloatingPoint
in class CType
public void checkType(CContext context) throws UnpositionedError
checkType
in class CType
UnpositionedError
- this error will be positioned soonpublic boolean isAssignableTo(CType dest)
isAssignableTo
in class CType
dest
- the destination typepublic boolean isCastableTo(CType dest)
isCastableTo
in class CType
dest
- the destination typepublic boolean implicitlyCastTo(CType dest)
implicitlyCastTo
in class CType
dest
- the expression type to cast topublic static CType unaryPromote(CType type)
type
.
This is done according to the rules defined in JLS2 section 5.6.1,
titled "Unary Numeric Promotion."type
- the type to promote.type
.public static CType binaryPromote(CType left, CType right)
left
- the type of the left expression in a binary expression.right
- the type of the right expression in a binary expression.public void genCastTo(CNumericType dest, CodeSequence code)
dest
- the destination typecode
- the code list
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |