|
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.JStatement
org.multijava.mjc.JLabeledStatement
This class represents a labeled statement. JLS 14.6: Labeled Statement
| Field Summary | |
private CFlowControlContextType |
breakContext
The control flow context representing paths in this statement that can jump to the end of the statement via a break. |
private CodeLabel |
endLabel
|
private boolean |
isBreakTarget
|
private String |
label
|
private JStatement |
stmt
|
| Fields inherited from class org.multijava.mjc.JStatement |
|
| Fields inherited from class org.multijava.mjc.JPhylum |
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 | |
JLabeledStatement(TokenReference where,
String label,
JStatement stmt,
JavaStyleComment[] comments)
Construct a node in the parsing tree. |
|
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor |
boolean |
acceptsBreak()
Returns true iff this statement is a possible target for a break statement. |
boolean |
acceptsContinue()
Returns true iff this statement is a possible target for a continue statement. |
void |
addBreak(CFlowControlContextType context)
Registers that this statement is the target of a break statement. |
void |
addContinue(CFlowControlContextType context)
Registers that this statement is the target of a continue statement. |
void |
genCode(CodeSequence code)
Generates a sequence of bytecodes |
CodeLabel |
getBreakLabel()
Return the end of this block (for break statement) |
CodeLabel |
getContinueLabel()
Return the beginning of this block (for continue statement) |
String |
getLabel()
Returns the label of this statement. |
JStatement |
stmt()
|
void |
typecheck(CFlowControlContextType context)
Typechecks this statement in the context in which it appears. |
| Methods inherited from class org.multijava.mjc.JStatement |
fail, getComments |
| 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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private CFlowControlContextType breakContext
private String label
private JStatement stmt
private CodeLabel endLabel
private boolean isBreakTarget
| Constructor Detail |
public JLabeledStatement(TokenReference where,
String label,
JStatement stmt,
JavaStyleComment[] comments)
where - the line of this node in the source codelabel - the label of the enclosing labeled statementstmt - the statementcomments - comments in the source text| Method Detail |
public String getLabel()
public JStatement stmt()
public void typecheck(CFlowControlContextType context)
throws PositionedError
context - the context in which this appears
PositionedError - if any checks fail public boolean acceptsBreak()
acceptsBreak in class JStatementpublic boolean acceptsContinue()
acceptsContinue in class JStatementpublic void accept(MjcVisitor p)
accept in class JStatementp - the visitorpublic void genCode(CodeSequence code)
code - the code listpublic void addBreak(CFlowControlContextType context)
addBreak in class JStatementpublic void addContinue(CFlowControlContextType context)
also requires stmt.acceptsContinue();
addContinue in class JStatementpublic CodeLabel getBreakLabel()
getBreakLabel in class JStatementpublic CodeLabel getContinueLabel()
getContinueLabel in class JStatement
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||