|
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.mjc.CContext
org.multijava.mjc.CExpressionContext
This class represents the context for an expression during checking passes (checkInterface, checkInitializers, typecheck).
CContextType| Field Summary | |
protected MJMathMode |
arithmeticMode
|
protected boolean |
discardValue
|
protected boolean |
incDec
|
protected boolean |
leftSide
|
| Fields inherited from class org.multijava.mjc.CContext |
contextNullity, cunit, parent |
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
CExpressionContext(CExpressionContextType parent)
|
|
CExpressionContext(CFlowControlContextType parent)
Construct a block context, it supports local variable allocation throw statement and return statement. |
|
| Method Summary | |
MJMathMode |
arithmeticMode()
Indicates the integral arithmetic mode that should be used. |
CExpressionContextType |
createExpressionContext_()
Create a copy of this context to handle divergent paths, e.g., in conditional expressions |
boolean |
discardValue()
|
boolean |
isIncDec()
|
boolean |
isLeftSide()
|
CFieldAccessor |
lookupField(String ident)
searches for a field with the given identifier |
CFieldAccessor |
lookupOuterField(String ident)
Searches for a field of the given name in the context surrounding the current lexical contour. |
void |
setArithmeticMode(byte mode)
|
void |
setDiscardValue(boolean discardValue)
set this context as a discarded value so result is ignored |
void |
setIncDec(boolean incDec)
Set this context as an increment or decrement expression, so we can generate appropriate getters and setters if necessary (and also generate proper code in the future). |
void |
setLeftSide(boolean leftSide)
Set this context as a left side in an assignment, so access to vars may be uninitialized |
| 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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected boolean discardValue
protected boolean leftSide
protected boolean incDec
protected MJMathMode arithmeticMode
| Constructor Detail |
public CExpressionContext(CFlowControlContextType parent)
CFlowControlContextType.createExpressionContext.
requires (* \caller instanceof CContextType *);
parent - the parent context, it must be different
than null except if called by the top levelCFlowControlContextType.createExpressionContext()public CExpressionContext(CExpressionContextType parent)
| Method Detail |
public CExpressionContextType createExpressionContext_()
createExpressionContext_ in interface CExpressionContextType
public CFieldAccessor lookupField(String ident)
throws UnpositionedError
lookupField in interface CContextTypelookupField in class CContextUnpositionedError - this error will be positioned soon
public CFieldAccessor lookupOuterField(String ident)
throws UnpositionedError
lookupOuterField in interface CContextTypelookupOuterField in class CContextident - the name of the field
UnpositionedError - this error will be positioned soonpublic void setIncDec(boolean incDec)
setIncDec in interface CExpressionContextTypeincDec - public boolean isIncDec()
isIncDec in interface CExpressionContextTypepublic void setLeftSide(boolean leftSide)
setLeftSide in interface CExpressionContextTypeleftSide - set the side of current code flowpublic boolean isLeftSide()
isLeftSide in interface CExpressionContextTypepublic void setDiscardValue(boolean discardValue)
setDiscardValue in interface CExpressionContextTypediscardValue - is the value of this expression in
this context discarded?public boolean discardValue()
discardValue in interface CExpressionContextTypepublic MJMathMode arithmeticMode()
CContextType
arithmeticMode in interface CContextTypearithmeticMode in class CContextpublic void setArithmeticMode(byte mode)
setArithmeticMode in interface CExpressionContextType
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||