|
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.util.compiler.Phylum
org.multijava.mjc.JPhylum
org.multijava.mjc.JStatement
This class is the root class for all classes representing statement nodes in the AST. See JLS 14.4.
| Field Summary | |
private JavaStyleComment[] |
comments
|
| 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 | |
JStatement(TokenReference where,
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. |
protected void |
fail(CContextType context,
MessageDescription key,
Object[] params)
Adds a compiler error. |
abstract void |
genCode(CodeSequence code)
Generates a sequence of bytecodes |
CodeLabel |
getBreakLabel()
Returns a label at end of this statement (for break statement) |
JavaStyleComment[] |
getComments()
Returns the comments |
CodeLabel |
getContinueLabel()
Returns the beginning of this block (for continue statement) |
abstract void |
typecheck(CFlowControlContextType context)
Typechecks this statement in the context in which it appears. |
| 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 JavaStyleComment[] comments
| Constructor Detail |
public JStatement(TokenReference where,
JavaStyleComment[] comments)
where - the line of this node in the source codecomments - the Java comments that go with this statement| Method Detail |
public abstract void typecheck(CFlowControlContextType context)
throws PositionedError
context - the context in which this appears
PositionedError - if any checks fail
protected void fail(CContextType context,
MessageDescription key,
Object[] params)
throws PositionedError
fail in class JPhylumcontext - the context in which the error occurredkey - the message ident to be displayedparams - the array of parameters
PositionedErrorpublic boolean acceptsBreak()
public boolean acceptsContinue()
public CodeLabel getBreakLabel()
public CodeLabel getContinueLabel()
public void addBreak(CFlowControlContextType context)
UnsupportedOperationException since only some
sorts statements are valid break targets. The classes
representing those sorts of statements override this method.
public void addContinue(CFlowControlContextType context)
UnsupportedOperationException since only some
sorts statements are valid continue targets. The classes
representing those sorts of statements override this method.
public abstract void genCode(CodeSequence code)
code - the code listpublic void accept(MjcVisitor p)
p - the visitorpublic JavaStyleComment[] getComments()
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||