|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.util.compiler.Phylum
org.multijava.mjc.JPhylum
org.multijava.mjc.JExpression
org.multijava.mjc.JLocalVariableExpression
This class represents the AST node for local variable references.
| Field Summary | |
(package private) JLocalVariable |
variable
|
| Fields inherited from class org.multijava.mjc.JExpression |
EMPTY |
| Fields inherited from class org.multijava.util.compiler.Phylum |
|
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
JLocalVariableExpression(TokenReference where,
JLocalVariable variable)
Construct a node in the parsing tree |
|
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor |
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 |
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 (called after parsing) |
int |
hashCode()
Throws a runtime exception because hashCode isn't properly implemented yet. |
java.lang.String |
ident()
|
void |
initialize(CContextType context)
Records that this variable is initialized in the given context. |
boolean |
isConstant()
Returns true iff this expression is constant. |
boolean |
isDefinitelyAssigned(CContextType context)
Returns true if this field is already initialized. |
private boolean |
isDefinitelyUnassigned(CContextType context)
|
boolean |
isLValue(CExpressionContextType context)
Returns true if this field accept assignment |
boolean |
isMaybeInitializable()
Indicates whether this expression can appear on the left-hand side of an assignment or in an increment or decrement operation. |
java.lang.String |
toString()
|
JExpression |
typecheck(CExpressionContextType context)
Typechecks the expression and mutates the context to record information gathered during typechecking. |
JLocalVariable |
variable()
|
| Methods inherited from class org.multijava.mjc.JExpression |
buildUniverseDynChecks, clone, convertType, fail, genBranch, genUniverseDynCheckCode, getApparentType, getBooleanLiteral, getNumberLiteral, getOrdinalLiteral, getRealLiteral, getStringLiteral, isAssignableTo, isBooleanLiteral, isLiteral, isOrdinalLiteral, isRealLiteral, isStatementExpression, isStringLiteral, typecheck, unParenthesize |
| Methods inherited from class org.multijava.mjc.JPhylum |
check, check, check, check, fail, fail, warn, warn, warn, warn |
| Methods inherited from class org.multijava.util.compiler.Phylum |
getTokenReference, setTokenReference |
| Methods inherited from class org.multijava.util.Utils |
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| 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 isMaybeInitializable()
also ensures true;
isMaybeInitializable in class JExpressionpublic boolean isLValue(CExpressionContextType context)
isLValue in interface CInitializablepublic boolean isDefinitelyAssigned(CContextType context)
isDefinitelyAssigned in interface CInitializableprivate boolean isDefinitelyUnassigned(CContextType context)
public void initialize(CContextType context)
throws UnpositionedError
initialize in interface CInitializableUnpositionedError - if this is a final field and has already been
assigned topublic int getPosition()
public CType getType()
public java.lang.String ident()
public boolean isConstant()
isConstant in class JExpressionpublic JLiteral getLiteral()
getLiteral in class JExpressionpublic JLocalVariable variable()
public java.lang.String toString()
toString in class java.lang.Object
public JExpression typecheck(CExpressionContextType context)
throws PositionedError
context - the context in which this expression appears
JExpression.typecheck())
PositionedError - if the check failspublic void accept(MjcVisitor p)
p - the visitorpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void genCode(CodeSequence code)
code - the code listpublic void genStartStoreCode(CodeSequence code)
genStartStoreCode in interface CInitializablecode - the code list
public void genEndStoreCode(CodeSequence code,
boolean discardValue)
genEndStoreCode in interface CInitializablecode - the code list
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||