|
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.JSwitchStatement
This class represents a switch statement in the AST. JLS 14.9: Switch Statement
| Field Summary | |
private CFlowControlContextType |
breakContext
Stores the definite assignment information for control flow paths that reach the end of the switch via a break statement. |
private CodeLabel |
endLabel
|
private JExpression |
expr
|
private JSwitchGroup[] |
groups
|
private boolean |
hasBreak
|
| 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 | |
JSwitchStatement(TokenReference where,
JExpression expr,
JSwitchGroup[] groups,
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. |
JExpression |
expr()
|
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) |
JSwitchGroup[] |
groups()
|
void |
typecheck(CFlowControlContextType context)
Typechecks this statement in the context in which it appears. |
| Methods inherited from class org.multijava.mjc.JStatement |
addContinue, 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 JExpression expr
private JSwitchGroup[] groups
private boolean hasBreak
private CodeLabel endLabel
private CFlowControlContextType breakContext
| Constructor Detail |
public JSwitchStatement(TokenReference where,
JExpression expr,
JSwitchGroup[] groups,
JavaStyleComment[] comments)
where - the line of this node in the source codeexpr - the expr partgroups - the cases of the switchcomments - the comments associated with this statement| Method Detail |
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 addBreak(CFlowControlContextType context)
addBreak in class JStatementpublic CodeLabel getBreakLabel()
getBreakLabel in class JStatementpublic CodeLabel getContinueLabel()
getContinueLabel in class JStatementpublic void accept(MjcVisitor p)
accept in class JStatementp - the visitorpublic void genCode(CodeSequence code)
code - the code listpublic JExpression expr()
public JSwitchGroup[] groups()
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||