|
mjc | ||||||||||
| 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.CFlowControlContext
org.multijava.mjc.CLoopContext
This class represents the context for a loop statement during
checking passes (checkInterface, checkInitializers, typecheck). It
stores the loop statement and include methods for calculating to
where breaks and continues inside this
loop should be directed.
CContextType| Field Summary | |
private boolean |
bodyChecksCompleted
Indicates that checks have been performed on this context between the completion of the loop body and the merging of break and continuation contexts. |
private JLoopStatement |
self
|
| Fields inherited from class org.multijava.mjc.CFlowControlContext |
cachedParent, fieldInfo, isReachable, methodContext, variableInfo |
| 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 | |
protected |
CLoopContext(CFlowControlContextType cachedParent,
CLoopContext clone)
Used by cloneContext. |
(package private) |
CLoopContext(CFlowControlContextType parent,
JLoopStatement self)
Construct a block context, it supports local variable allocation throw statement and return statement |
| Method Summary | |
void |
checkingComplete()
Registers that this context is no longer needed. |
CFlowControlContextType |
cloneContext()
Create a clone of this context to handle divergent paths in the control flow. |
boolean |
declaredOutsideOfLoop(JLocalVariable var)
Indicates whether this context is enclosed in a loop and the given variable is declared outside the inner-most loop context. |
void |
doneWithCheckingBody()
Performs final checks on the main body of the loop, i.e., on the context that represents a full execution of the loop body (without break or continue statements). |
JStatement |
getNearestBreakableStatement()
Get the nearest breakable statement |
JStatement |
getNearestContinuableStatement()
Get the nearest continuable statement. |
boolean |
isInLoop()
Indicates whether this context is in a loop. |
| 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, wait, wait, wait |
| Field Detail |
private final JLoopStatement self
private boolean bodyChecksCompleted
| Constructor Detail |
CLoopContext(CFlowControlContextType parent,
JLoopStatement self)
parent - the parent context, it must be different
than null except if called by the top level
protected CLoopContext(CFlowControlContextType cachedParent,
CLoopContext clone)
| Method Detail |
public final void checkingComplete()
Registers that this context is no longer needed. Passes information collected by this context to the parent context.
Passes this context's field information to the surrounding context; passes local variable information to the surrounding context if that context is one which maintains local variable information.
Checks that local variables are used and issues warnings if not.
This should only be called on a linearly nested context! !FIXME!10/26 If we refactor the context creation code as planned (to lock the parent context) then this method is called to unlock the parent context when we exit a linearly nested context.
checkingComplete in interface CFlowControlContextTypecheckingComplete in class CFlowControlContextpublic final void doneWithCheckingBody()
public CFlowControlContextType cloneContext()
cloneContext in interface CFlowControlContextTypecloneContext in class CFlowControlContextpublic JStatement getNearestBreakableStatement()
getNearestBreakableStatement in interface CFlowControlContextTypegetNearestBreakableStatement in class CFlowControlContextpublic JStatement getNearestContinuableStatement()
getNearestContinuableStatement in interface CFlowControlContextTypegetNearestContinuableStatement in class CFlowControlContextpublic final boolean isInLoop()
isInLoop in interface CContextTypeisInLoop in class CContextpublic boolean declaredOutsideOfLoop(JLocalVariable var)
declaredOutsideOfLoop in interface CContextTypedeclaredOutsideOfLoop in class CFlowControlContext
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||