|
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.JCastExpression
This class represents a cast expression '((byte)2)'
| Field Summary | |
protected CType |
dest
|
protected JExpression |
expr
|
(package private) boolean |
isSynthetic
Whether this is a synthetic cast introduced by the compiler. |
private JIfStatement |
test
|
private JLocalVariable |
tmpLocalVar
|
| 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 | |
JCastExpression(TokenReference where,
JExpression expr,
CType dest)
Constructs a node in the parsing tree. |
|
JCastExpression(TokenReference where,
JExpression expr,
CType dest,
boolean isSynthetic)
Constructs a node in the parsing tree. |
|
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor |
JExpression |
expr()
|
void |
genCode(CodeSequence code)
Generates a sequence of bytecodes |
CType |
getType()
Compute the type of this expression. |
boolean |
isNonNull(CContextType context)
Returns true iff the value represented by this expression is non-null |
boolean |
isSynthetic()
Returns whether this is a synthetic cast introduced by the compiler. |
void |
setExpr(JExpression e)
|
String |
toString()
|
JExpression |
typecheck(CExpressionContextType context)
Typechecks the expression and mutates the context to record information gathered during typechecking. |
protected JExpression |
typecheckHelper(CExpressionContextType context)
|
| 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, isDeclaredNonNull, isLiteral, isMaybeInitializable, 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 |
protected JExpression expr
protected CType dest
boolean isSynthetic
private JIfStatement test
private JLocalVariable tmpLocalVar
| Constructor Detail |
public JCastExpression(TokenReference where,
JExpression expr,
CType dest)
where - the line of this node in the source codeexpr - the expression to be casteddest - the type of this expression after cast
public JCastExpression(TokenReference where,
JExpression expr,
CType dest,
boolean isSynthetic)
where - the line of this node in the source codeexpr - the expression to be casteddest - the type of this expression after castisSynthetic - whether this is a synthetic cast introduced by
the compiler (e.g. a generics cast) | Method Detail |
public String toString()
toString in class Objectpublic JExpression expr()
public void setExpr(JExpression e)
public boolean isSynthetic()
public CType getType()
public boolean isNonNull(CContextType context)
isNonNull 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
WMD: issue a warning if there is a downcast from readonly to peer
or rep.
protected JExpression typecheckHelper(CExpressionContextType context)
throws PositionedError
PositionedErrorpublic void accept(MjcVisitor p)
p - the visitorpublic void genCode(CodeSequence code)
code - the code list
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||