Modifier and Type | Field and Description |
---|---|
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)
|
Constructor and Description |
---|
ForStmt(int lineNum,
Expr initExpr,
Expr predExpr,
Expr updateExpr,
Stmt bodyStmt)
ForStmt constructor
|
Modifier and Type | Method and Description |
---|---|
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
|
getLineNum
protected Expr initExpr
protected Expr predExpr
protected Expr updateExpr
protected Stmt bodyStmt
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 statementpublic Expr getInitExpr()
public Expr getPredExpr()
public Expr getUpdateExpr()
public Stmt getBodyStmt()