|
||||||||||
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.compiler.Phylum | +--at.dms.kjc.JPhylum | +--at.dms.kjc.JExpression | +--at.dms.kjc.JClassFieldExpression
A field access ('getExpression().t' or 't'). XXX: note: why is it necessary to private a CContext subclass object in the check* methods; why not set the context once when it is know, so that it is still available in the genCode methods etc.? - EJB
Fields inherited from class at.dms.kjc.JExpression |
EMPTY |
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 | |
JClassFieldExpression(TokenReference where,
JExpression prefix,
java.lang.String ident)
Construct a node in the parsing tree. |
|
JClassFieldExpression(TokenReference where,
java.lang.String ident)
Construct a node in the parsing tree. |
Method Summary | |
void |
accept(KjcVisitor p)
Accepts the specified visitor |
void |
checkAccess(CClass local,
CExpressionContext context)
Checks is access to prefix is okay. |
JExpression |
checkExpression(CExpressionContext context)
Check expression and evaluate and alter context. |
boolean |
equals(java.lang.Object o)
|
protected void |
findPrefix(CClass local,
CExpressionContext context)
Find the type of the prefix. |
void |
genCode(CodeSequence code)
Generates a sequence of bytecodes |
void |
genEndStoreCode(CodeSequence code,
boolean discardValue)
Generates a sequence of bytecodes |
void |
genStartStoreCode(CodeSequence code)
Generates a sequence of bytecodes |
CField |
getField()
Returns the field-export that this expression refers to. |
java.lang.String |
getIdent()
Returns the name of the classfield that this expression refers to. |
JLiteral |
getLiteral()
Returns the literal value of this field, if this is a constant expression. |
CType |
getType()
Compute the type of this expression. |
void |
initialize(CBodyContext context)
Signals that this field will receive a value. |
boolean |
isConstant()
Checks whether this JLS says that this expression is a constant. |
boolean |
isInitialized(CExpressionContext context)
Returns true if this field is already initialized. |
boolean |
isLValue(CExpressionContext context)
Returns true if this field (still) accepts assignment. |
Methods inherited from class at.dms.kjc.JExpression |
checkExpression, convertType, fail, genBranch, getBooleanLiteral, getNumberLiteral, getOrdinalLiteral, getRealLiteral, getStringLiteral, isAssignableTo, isLiteral, isStatementExpression, isSubTypePossible, setConstant, unParenthesize |
Methods inherited from class at.dms.kjc.JPhylum |
check, check, check, check |
Methods inherited from class at.dms.compiler.Phylum |
getTokenReference, setTokenReference |
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 |
public JClassFieldExpression(TokenReference where, JExpression prefix, java.lang.String ident)
where
- The line of this node in the source code.public JClassFieldExpression(TokenReference where, java.lang.String ident)
where
- The line of this node in the source code.Method Detail |
public java.lang.String getIdent()
public CType getType()
getType
in class JExpression
public boolean isConstant()
A compile-time constant expression is an expression denoting a value of primitive type or a String that is composed using only the following:
- ...
- Simple names that refer to final variables whose initializers are constant expressions.
- Qualified names of the form TypeName . Identifier that refer to final variables whose initializers are constant expressions.
- Overrides:
isConstant
in classJExpression
- Returns:
- Whether this expression is constant.
public boolean isLValue(CExpressionContext context)
isLValue
in interface CInitializable
at.dms.kjc.CInitializable
true
if this expression is an LValue at call time.
Note: a final variable is a lvalue until it is initialized.public boolean isInitialized(CExpressionContext context)
isInitialized
in interface CInitializable
at.dms.kjc.CInitializable
true
if this expression is a variable that is already
initialized.public void initialize(CBodyContext context)
initialize
in interface CInitializable
at.dms.kjc.CInitializable
UnpositionedError
- An error if this object can't actually be assigned. This may happen
with final variables.public CField getField()
public JLiteral getLiteral()
getLiteral
in class JExpression
public JExpression checkExpression(CExpressionContext context) throws PositionedError
checkExpression
in class JExpression
context
- The actual context of analyse.PositionedError
- If the check fails.protected void findPrefix(CClass local, CExpressionContext context) throws PositionedError
PositionedError
- Error catched as soon as possiblepublic void checkAccess(CClass local, CExpressionContext context) throws PositionedError
PositionedError
- Error caught as soon as possible.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public void accept(KjcVisitor p)
accept
in class JExpression
p
- the visitorpublic void genCode(CodeSequence code)
genCode
in class JExpression
code
- the code listpublic void genStartStoreCode(CodeSequence code)
genStartStoreCode
in interface CInitializable
code
- the code listpublic void genEndStoreCode(CodeSequence code, boolean discardValue)
genEndStoreCode
in interface CInitializable
code
- the code list
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |