|
||||||||||
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.JLocalVariableExpression
A LocalVariable used as an lvalue or rvalue expression.
Field Summary | |
(package private) JLocalVariable |
variable
The local variable itself. |
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 | |
JLocalVariableExpression(TokenReference where,
JLocalVariable variable)
Construct a node in the parsing tree. |
Method Summary | |
void |
accept(KjcVisitor p)
Accepts the specified visitor. |
JExpression |
checkExpression(CExpressionContext context)
Check expression and evaluate and alter context. |
boolean |
equals(java.lang.Object o)
|
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 |
java.lang.String |
getIdent()
Returns the name of the local variable. |
JLiteral |
getLiteral()
Returns the literal value of this field |
int |
getPosition()
Returns the position of this variable in the sets of local vars. |
CType |
getType()
Compute the type of this expression. |
JLocalVariable |
getVariable()
Returns the local variable. |
void |
initialize(CBodyContext context)
Marks this local variable as 'definately assigned' in this context. |
boolean |
isConstant()
Returns true iff this expression is constant. |
boolean |
isInitialized(CExpressionContext context)
Returns true if this field is already possible initialized. |
boolean |
isLValue(CExpressionContext context)
Returns true if this field accept 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 |
|
Field Detail |
JLocalVariable variable
Constructor Detail |
public JLocalVariableExpression(TokenReference where, JLocalVariable variable)
where
- The line of this node in the source code.Method Detail |
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 int getPosition()
public CType getType()
getType
in class JExpression
public java.lang.String getIdent()
public boolean isConstant()
isConstant
in class JExpression
at.dms.kjc.JExpression
public JLiteral getLiteral()
getLiteral
in class JExpression
public JLocalVariable getVariable()
public JExpression checkExpression(CExpressionContext context) throws PositionedError
checkExpression
in class JExpression
context
- The actual context of the check.PositionedError
- If the check fails.public void accept(KjcVisitor p)
accept
in class JExpression
p
- the visitorpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public 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 |