|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.util.Utils
at.dms.compiler.Phylum
at.dms.kjc.JPhylum
at.dms.kjc.JExpression
at.dms.kjc.JLiteral
public abstract class JLiteral
Root class for all literals expression
Field Summary |
---|
Fields inherited from class at.dms.kjc.JExpression |
---|
EMPTY |
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 |
JLiteral()
|
|
JLiteral(TokenReference where)
Construct a node in the parsing tree |
Method Summary | |
---|---|
JExpression |
analyse(CExpressionContext context)
Analyses the expression (semantically). |
abstract String |
convertToString()
For up-casting into a string type. |
abstract JExpression |
convertType(CType dest,
CExpressionContext context)
convertType changes the type of this expression to an other |
Object |
deepClone()
Returns a deep clone of this object. |
protected void |
deepCloneInto(JLiteral other)
Clones all fields of this into |
JLiteral |
getLiteral()
Returns the literal value of an expression |
boolean |
isConstant()
Tests whether this expression denotes a compile-time constant (JLS 15.28). |
abstract boolean |
isDefault()
Returns true iff the value of this literal is the default value for this type (JLS 4.5.5). |
static JLiteral |
parseInteger(TokenReference where,
String image)
Constructs an integer (int or long) literal |
static JLiteral |
parseReal(TokenReference where,
String image)
Constructs a real (float or double) literal |
void |
setType(CType type)
Literals have manifest immutable types, setType should respect those. |
Methods inherited from class at.dms.kjc.JExpression |
---|
accept, accept, accept, booleanValue, byteValue, charValue, convertType, deepCloneInto, doubleValue, fail, floatValue, genBranch, genCode, genEndStoreCode, genStartStoreCode, getIdent, getType, intValue, isAssignableTo, isDynamic, isFinal, isInitialized, isLValue, isStatementExpression, longValue, setInitialized, shortValue, stringValue |
Methods inherited from class at.dms.kjc.JPhylum |
---|
assertMutable, check, check, check, check, deepCloneInto, setLineNumber |
Methods inherited from class at.dms.compiler.Phylum |
---|
deepCloneInto, getTokenReference, setTokenReference |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected JLiteral()
public JLiteral(TokenReference where)
where
- the line of this node in the source codeMethod Detail |
---|
public static JLiteral parseReal(TokenReference where, String image) throws PositionedError
where
- the line of this node in the source codeimage
- the textual representation of this literal
PositionedError
public static JLiteral parseInteger(TokenReference where, String image) throws PositionedError
where
- the line of this node in the source codeimage
- the textual representation of this literal
PositionedError
public boolean isConstant()
isConstant
in class JExpression
public JLiteral getLiteral()
getLiteral
in class JExpression
public void setType(CType type)
setType
in class JExpression
type
- the CType to set.public abstract String convertToString()
public abstract boolean isDefault()
public JExpression analyse(CExpressionContext context) throws PositionedError
analyse
in class JExpression
context
- the analysis context
PositionedError
- the analysis detected an errorpublic abstract JExpression convertType(CType dest, CExpressionContext context)
convertType
in class JExpression
dest
- the destination typepublic Object deepClone()
deepClone
in interface DeepCloneable
deepClone
in class JExpression
protected void deepCloneInto(JLiteral other)
other
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |