|
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.JSwitchGroup
This class represents an AST node for a group in a switch statement. A group is a set of case labels and a sequence of statements for those labels.
| Field Summary | |
private JSwitchLabel[] |
labels
|
private boolean |
labelsChecked
Flag indicates whether the labels for this group have been typechecked. |
private CodeLabel |
pos
|
private JStatement[] |
stmts
|
| 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 | |
JSwitchGroup(TokenReference where,
JSwitchLabel[] labels,
JStatement[] stmts)
Construct a node in the parsing tree. |
|
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor |
void |
collectLabels(CodeLabel deflab,
ArrayList matches,
ArrayList targets)
Generates a sequence of bytecodes |
void |
genCode(CodeSequence code)
Generates a sequence of bytecodes |
JStatement[] |
getStatements()
Returns a list of statements |
JSwitchLabel[] |
labels()
|
void |
typecheck(CSwitchGroupContext context)
Typechecks the group and mutates the context to record information gathered during typechecking. |
| Methods inherited from class org.multijava.mjc.JPhylum |
check, check, check, check, fail, 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 JSwitchLabel[] labels
private boolean labelsChecked
private JStatement[] stmts
private CodeLabel pos
| Constructor Detail |
public JSwitchGroup(TokenReference where,
JSwitchLabel[] labels,
JStatement[] stmts)
where - the line of this node in the source codelabels - a group of labelsstmts - a group of statements| Method Detail |
public JStatement[] getStatements()
public JSwitchLabel[] labels()
public void typecheck(CSwitchGroupContext context)
throws PositionedError
requires context != null && context.isReachable();
context - the context for the control flow in which the
statements of the group are checked
PositionedError - if the check fails public void accept(MjcVisitor p)
p - the visitor
public void collectLabels(CodeLabel deflab,
ArrayList matches,
ArrayList targets)
matches - a list of values to matchtargets - a list of target labelspublic void genCode(CodeSequence code)
code - the code list
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||