public final class ForLoopStatement extends LoopStatementBase
Modifier and Type | Field and Description |
---|---|
Statement |
body |
ValueExpression |
cond |
Statement |
init |
Statement |
update |
BlockStatement |
whileReplacement |
Modifier and Type | Method and Description |
---|---|
void |
accept(ASTVisitor visitor)
Accept visitor for a visit.
|
void |
accept(ASTVisitorOld visitor)
Accept visitor for a visit.
|
void |
acceptChildren(ASTVisitor visitor)
Accept visitor for a visit to the children of this node.
|
static ForLoopStatement |
construct(Statement init,
ValueExpression cond,
Statement update,
Statement body)
Construct a while loop.
|
java.lang.String |
getKind()
Get type of statement.
|
Formula |
getPrecondition()
Get for-loop precondition.
|
void |
setLoopAnnotation(ProgramAnnotation annotation)
Set the loop annotation for this item.
|
void |
setPosition(SourcePosition position)
Set the position of this node in the source code.
|
void |
setPrecondition(Formula pre)
Set for-loop precondition.
|
getLoopAnnotation
getAnnotation, getJudgement, setAnnotation, setJudgement
getPosition
accept, accept, print, printCore, toString, toStringCore
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getJudgement, setJudgement
getPosition
getAnnotation, setAnnotation
print, printCore, toString, toStringCore
public final Statement init
public final ValueExpression cond
public final Statement update
public final Statement body
public final BlockStatement whileReplacement
public static ForLoopStatement construct(Statement init, ValueExpression cond, Statement update, Statement body)
init
- the loop variable initialization.cond
- the loop condition.update
- the loop variable update.body
- the loop body.public void setLoopAnnotation(ProgramAnnotation annotation)
setLoopAnnotation
in interface LoopStatement
setLoopAnnotation
in class LoopStatementBase
annotation
- the annotation.public void setPosition(SourcePosition position)
setPosition
in interface ASTSource
setPosition
in class ASTSourceBase
position
- the source code position.public void accept(ASTVisitorOld visitor)
accept
in interface AST
accept
in class LoopStatementBase
visitor
- the visitor who is accepted by this node.public void accept(ASTVisitor visitor)
accept
in interface AST
accept
in class LoopStatementBase
visitor
- the visitor who is accepted by this node.public void acceptChildren(ASTVisitor visitor)
acceptChildren
in interface AST
acceptChildren
in class LoopStatementBase
visitor
- the visitor who is accepted by the children of this node.public java.lang.String getKind()
public void setPrecondition(Formula pre)
pre
- the precondition.public Formula getPrecondition()