|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.ptree.ParseTreeObject | +--openjava.ptree.NonLeaf | +--openjava.ptree.ForStatement
The ForStatement
class represents a for statement
node of parse tree.
The specification of the initialization part may be modified
in the later version of OpenJava.
ParseTree
,
NonLeaf
,
Statement
,
Expression
,
ExpressionList
,
StatementList
Fields inherited from class openjava.ptree.ParseTreeObject |
debugFlag,
debugLevel,
LN,
out,
writerStack |
Constructor Summary | |
ForStatement(ExpressionList init,
Expression expr,
ExpressionList iterator,
StatementList stmts)
Allocates a new ForStatement object. |
|
ForStatement(TypeName tspec,
VariableDeclarator[] vdecls,
Expression expr,
ExpressionList iterator,
StatementList stmts)
|
Method Summary | |
void |
accept(ParseTreeVisitor v)
Accepts a ParseTreeVisitor object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern. |
Expression |
getCondition()
Gets the condition part of this for-statement. |
ExpressionList |
getIncrement()
Gets the increments part of this for-statement. |
ExpressionList |
getInit()
Gets the initialization part of this for-statement. |
VariableDeclarator[] |
getInitDecls()
Gets the initialization part of this for-statement. |
TypeName |
getInitDeclType()
Gets the initialization part of this for-statement. |
StatementList |
getStatements()
Gets the body of this for-statement. |
void |
setCondition(Expression cond)
Sets the condition part of this for-statement. |
void |
setIncrement(ExpressionList incs)
Sets the increments part of this for-statement. |
void |
setInit(ExpressionList init)
Sets the initialization part of this for-statement. |
void |
setInitDecl(TypeName type_specifier,
VariableDeclarator[] init)
Sets the initialization part of this for-statement. |
void |
setStatements(StatementList stmts)
Sets the body of this for-statement. |
void |
writeCode()
Writes the code this parse-tree presents for. |
Methods inherited from class openjava.ptree.NonLeaf |
childrenAccept,
elementAt,
equals,
getComment,
getContents,
getLength,
makeRecursiveCopy,
replaceChildWith,
set,
set,
set,
set,
set,
set,
set,
set,
set,
setComment,
setElementAt |
Methods inherited from class openjava.ptree.ParseTreeObject |
clone,
eq,
eq,
equal,
flushPrintWriter,
getDebugFlag,
getNest,
getObjectID,
getParent,
getPrintWriter,
getTab,
hashCode,
lastObjectID,
makeCopy,
popNest,
popPrintWriter,
pushNest,
pushPrintWriter,
replace,
setDebugFlag,
setDebugLevel,
setNest,
setParent,
setPrintStream,
setTab,
toFlattenString,
toString,
writeDebug,
writeDebugL,
writeDebugLln,
writeDebugln,
writeDebugLR,
writeDebugR,
writeDebugRln,
writeTab |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public ForStatement(ExpressionList init, Expression expr, ExpressionList iterator, StatementList stmts)
init
- the initialization part.expr
- the condition part.iterator
- the increments part.stmts
- the stement list of the body.public ForStatement(TypeName tspec, VariableDeclarator[] vdecls, Expression expr, ExpressionList iterator, StatementList stmts)
Method Detail |
public void writeCode()
public ExpressionList getInit()
public void setInit(ExpressionList init)
init
- the initialization part.public TypeName getInitDeclType()
public VariableDeclarator[] getInitDecls()
public void setInitDecl(TypeName type_specifier, VariableDeclarator[] init)
init
- the initialization part.public Expression getCondition()
public void setCondition(Expression cond)
cond
- the expression of the condtion part.public ExpressionList getIncrement()
public void setIncrement(ExpressionList incs)
incs
- the expression list of the increments part.public StatementList getStatements()
public void setStatements(StatementList stmts)
stmts
- the statement list of the body.public void accept(ParseTreeVisitor v) throws ParseTreeException
ParseTreeVisitor
object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern.
This invoke an appropriate visit()
method on the
accepted visitor.
visitor
- a visitor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |