|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectast.ASTNode
ast.Stmt
ast.ForStmt
public class ForStmt
The ForStmt class represents a for (loop) statement appearing in a method declaration. It contains an initialization expression (initExpr), a predicate expression (predExpr), an update expression (updateExpr), and body statement (bodyStmt).
ASTNode
,
Stmt
Field Summary | |
---|---|
protected Stmt |
bodyStmt
The body statement |
protected Expr |
initExpr
The initialization expression (null for no init expression) |
protected Expr |
predExpr
The predicate expression (null for no predicate -- must be boolean expression) |
protected Expr |
updateExpr
The update expression (null for no update expression) |
Fields inherited from class ast.ASTNode |
---|
charNum, lineNum, lineStr |
Constructor Summary | |
---|---|
ForStmt(int lineNum,
Expr initExpr,
Expr predExpr,
Expr updateExpr,
Stmt bodyStmt)
ForStmt constructor |
Method Summary | |
---|---|
java.lang.Object |
accept(visitor.Visitor v,
java.lang.Object o)
Visitor method |
Stmt |
getBodyStmt()
Get the body statement |
Expr |
getInitExpr()
Get the initialization expression If null, then no initialization expression |
Expr |
getPredExpr()
Get the predicate expression If null, then no predicate expression |
Expr |
getUpdateExpr()
Get the update expression If null, then no update expression |
Methods inherited from class ast.ASTNode |
---|
getLineNum |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Expr initExpr
protected Expr predExpr
protected Expr updateExpr
protected Stmt bodyStmt
Constructor Detail |
---|
public ForStmt(int lineNum, Expr initExpr, Expr predExpr, Expr updateExpr, Stmt bodyStmt)
lineNum
- source line number corresponding to this AST nodeinitExpr
- the initialization expression (null for no init expression)predExpr
- the predicate expression (null for no predicate -- must be
boolean expression)updateExpr
- the update expression (null for no update expression)bodyStmt
- the then statementMethod Detail |
---|
public Expr getInitExpr()
public Expr getPredExpr()
public Expr getUpdateExpr()
public Stmt getBodyStmt()
public java.lang.Object accept(visitor.Visitor v, java.lang.Object o)
accept
in class Stmt
v
- visitor objecto
- object to pass down
Visitor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |