|
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.JParenthesedExpression
This class represents expression within parentheses.
| Field Summary | |
private JExpression |
expr
|
| 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 | |
JParenthesedExpression(TokenReference where,
JExpression expr)
Construct a node in the parsing tree. |
|
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor |
JExpression |
expr()
|
void |
genBranch(boolean cond,
CodeSequence code,
CodeLabel label)
Generates a sequence of bytecodes to branch on a label This method helps to handle heavy optimizables conditions |
void |
genCode(CodeSequence code)
Generates a sequence of bytecodes |
void |
genEndStoreCode(CodeSequence code,
boolean discard)
Delegates to expr. |
void |
genStartStoreCode(CodeSequence code)
Delegates to expr. |
Object[] |
getFANonNulls(CContextType context)
Returns a list of expressions known to be non-null (null) in this context |
Object[] |
getFANulls(CContextType context)
Returns a list of expressions known to be null if this evaluates to false. |
CType |
getType()
Compute the type of this expression (called after parsing) |
void |
initialize(CContextType context)
Delegates to expr. |
boolean |
isDeclaredNonNull()
Returns true iff the variable, field or method represente by this expression was declared non_null. |
boolean |
isDefinitelyAssigned(CContextType context)
Delegates to expr. |
boolean |
isLValue(CExpressionContextType context)
Delegates to expr. |
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 |
String |
toString()
|
JExpression |
typecheck(CExpressionContextType context)
Typechecks the expression and mutates the context to record information gathered during typechecking. |
JExpression |
unParenthesize()
Returns this with outer parentheses removed, i.e., returns the results of recursively calling unParenthesize on
the JExpression passed to the constructor of this. |
| Methods inherited from class org.multijava.mjc.JExpression |
buildUniverseDynChecks, clone, convertType, dumpArray, fail, genUniverseDynCheckCode, getApparentType, getBooleanLiteral, getLiteral, getNumberLiteral, getOrdinalLiteral, getRealLiteral, getStringLiteral, isAssignableTo, isBooleanLiteral, isConstant, isLiteral, isOrdinalLiteral, isRealLiteral, isStatementExpression, isStringLiteral, typecheck |
| 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 expr
| Constructor Detail |
public JParenthesedExpression(TokenReference where,
JExpression expr)
where - the line of this node in the source codeexpr - the expression beetwen parenthese| Method Detail |
public String toString()
toString in class Objectpublic Object[] getFANonNulls(CContextType context)
getFANonNulls in class JExpressionpublic Object[] getFANulls(CContextType context)
JExpression
getFANulls in class JExpressionpublic boolean isMaybeInitializable()
also ensures \result <==> expr.isMaybeInitializable();
isMaybeInitializable in class JExpression
public void initialize(CContextType context)
throws UnpositionedError
expr.
initialize in interface CInitializableUnpositionedError - an error if this object can't
actually be assigned to in the given context this may
happen with final variables. public boolean isLValue(CExpressionContextType context)
expr.
isLValue in interface CInitializablepublic boolean isDefinitelyAssigned(CContextType context)
expr.
isDefinitelyAssigned in interface CInitializablepublic void genStartStoreCode(CodeSequence code)
expr.
genStartStoreCode in interface CInitializablecode - the code list
public void genEndStoreCode(CodeSequence code,
boolean discard)
expr.
genEndStoreCode in interface CInitializablecode - the code listpublic JExpression expr()
public CType getType()
public 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 list
public void genBranch(boolean cond,
CodeSequence code,
CodeLabel label)
genBranch in class JExpressioncode - the code listpublic JExpression unParenthesize()
unParenthesize on
the JExpression passed to the constructor of this.
unParenthesize in class JExpression
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||