|
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.JNewArrayExpression
This class represents a new array allocation expression 'new type[...]'
| Field Summary | |
protected JArrayDimsAndInits |
dims
|
private JMethodCallExpression |
setAnonymousOwner
|
private JMethodCallExpression |
setOwner
|
private JLocalVariable |
tmpLocalVar
|
protected 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 | |
JNewArrayExpression(TokenReference where,
CType arrayType,
JArrayDimsAndInits dims)
Constructs a node in the parsing tree. |
|
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor |
private static JMethodCallExpression |
buildNewArrayUniverseDynChecks(CExpressionContextType context,
CArrayType type,
JExpression var)
Creates the method call for the dynamic universe typechecks. |
void |
buildUniverseDynChecks(CExpressionContextType context,
JExpression var)
Creates the expressions for the dynamic universe typechecks. |
JArrayDimsAndInits |
dims()
|
void |
genCode(CodeSequence code)
Generates a sequence of bytecodes |
void |
genUniverseDynCheckCode(CodeSequence code)
Generate the code for the dynamic universe typechecks. |
CType |
getType()
Compute the type of this expression (called after parsing) |
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. |
| Methods inherited from class org.multijava.mjc.JExpression |
clone, convertType, dumpArray, fail, genBranch, 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 CType type
protected JArrayDimsAndInits dims
private JMethodCallExpression setOwner
private JLocalVariable tmpLocalVar
private JMethodCallExpression setAnonymousOwner
| Constructor Detail |
public JNewArrayExpression(TokenReference where,
CType arrayType,
JArrayDimsAndInits dims)
where - the line of this node in the source codearrayType - the type of this array allocatordims - dimensions and initializers| Method Detail |
public JArrayDimsAndInits dims()
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 public void accept(MjcVisitor p)
p - the visitorpublic void genCode(CodeSequence code)
code - the code list
public void buildUniverseDynChecks(CExpressionContextType context,
JExpression var)
throws PositionedError
buildUniverseDynChecks in class JExpressioncontext - context used to typecheck the expressions createdvar - the variable where the new object is found
PositionedError - By scdaniel.
private static JMethodCallExpression buildNewArrayUniverseDynChecks(CExpressionContextType context,
CArrayType type,
JExpression var)
throws PositionedError
context - context used to typecheck the expressions createdvar - the variable where the new object is found
PositionedError - By scdaniel.public void genUniverseDynCheckCode(CodeSequence code)
genUniverseDynCheckCode in class JExpressioncode - the CodeSequence for the codegeneration
By scdaniel.public String toString()
toString in class Object
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||