|
JML | ||||||||||
| 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.JArrayAccessExpression
This class implements an access to an array.
| Field Summary | |
private JExpression |
accessor
|
private JExpression |
prefix
|
private CType |
type
|
| 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 | |
JArrayAccessExpression(TokenReference where,
JExpression prefix,
JExpression accessor)
Construct a node in the parsing tree This method is directly called by the parser |
|
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor |
JExpression |
accessor()
|
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 |
CType |
getType()
|
void |
initialize(CContextType ctxt)
Initialize this object |
boolean |
isDeclaredNonNull()
Returns true iff the variable, field or method represente by this expression was declared non_null. |
boolean |
isDefinitelyAssigned(CContextType context)
|
boolean |
isLValue(CExpressionContextType context)
Determine whether the array access is a LValue in this context. |
boolean |
isMaybeInitializable()
Indicates whether this expression can appear on the left-hand side of an assignment or in an increment or decrement operation. |
boolean |
isNonNull(CContextType context)
Returns true iff the value represented by this expression is non-null |
JExpression |
prefix()
|
String |
toString()
|
JExpression |
typecheck(CExpressionContextType context)
Typechecks the expression and mutates the context to record information gathered during typechecking. |
| Methods inherited from class org.multijava.mjc.JExpression |
buildUniverseDynChecks, clone, convertType, dumpArray, fail, genBranch, genUniverseDynCheckCode, getApparentType, getBooleanLiteral, getFANonNulls, getFANulls, getLiteral, getNumberLiteral, getOrdinalLiteral, getRealLiteral, getStringLiteral, isAssignableTo, isBooleanLiteral, isConstant, 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 |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private JExpression prefix
private JExpression accessor
private CType type
| Constructor Detail |
public JArrayAccessExpression(TokenReference where,
JExpression prefix,
JExpression accessor)
where - the line of this node in the source codeprefix - denotes the array to accessaccessor - denotes a natural integer indicating the
element to access| Method Detail |
public JExpression prefix()
public JExpression accessor()
public CType getType()
JExpression
public boolean isMaybeInitializable()
also ensures true;
isMaybeInitializable in class JExpressionpublic boolean isDefinitelyAssigned(CContextType context)
isDefinitelyAssigned in interface CInitializablepublic void initialize(CContextType ctxt)
initialize in interface CInitializablepublic boolean isLValue(CExpressionContextType context)
isLValue in interface CInitializablepublic boolean isNonNull(CContextType context)
isNonNull in class JExpressionpublic boolean isDeclaredNonNull()
isDeclaredNonNull in class JExpression
public JExpression typecheck(CExpressionContextType context)
throws PositionedError
context - the context in which this expression appears
JExpression.typecheck())
PositionedError - if the check fails public void accept(MjcVisitor p)
p - the visitorpublic 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 listpublic String toString()
toString in class Object
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||