- All Superinterfaces:
ASTNode,BlockItemNode,StatementNode
- All Known Subinterfaces:
ForLoopNode
Root of type hierarchy for every kind of loop statement. Every such statement
has at least a condition specifying when to stay in the loop, and a body.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.ASTNode
ASTNode.NodeKindNested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.statement.BlockItemNode
BlockItemNode.BlockItemKindNested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.statement.StatementNode
StatementNode.StatementKind -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a deep copy of this AST node.getBody()The loop body.The condition which controls when to stay in or exit the loop.getKind()What kind of loop is this?voidsetBody(StatementNode body) Sets the loop body.voidsetCondition(ExpressionNode condition) Sets the loop condition for this loop node.Methods inherited from interface dev.civl.abc.ast.node.IF.ASTNode
addAllTransformAnnotations, addTransformAnnotation, child, childIndex, children, diff, equiv, getAttribute, getOwner, getScope, getSource, id, keepOnly, nextDFS, nodeKind, numChildren, parent, prettyPrint, prettyRepresentation, prettyRepresentation, print, remove, removeChild, removeTransformAnnotation, setAttribute, setChild, setId, setOwner, setScope, toString, transformAnnotationsMethods inherited from interface dev.civl.abc.ast.node.IF.statement.BlockItemNode
blockItemKindMethods inherited from interface dev.civl.abc.ast.node.IF.statement.StatementNode
statementKind
-
Method Details
-
getCondition
ExpressionNode getCondition()The condition which controls when to stay in or exit the loop. For WHILE and FOR loops, evaluated before entering body; for DO_WHILE, evaluated after each execution of body.- Returns:
- the loop condition
-
setCondition
Sets the loop condition for this loop node.- Parameters:
condition- the loop condition
-
getBody
StatementNode getBody()The loop body.- Returns:
- the loop body
-
setBody
Sets the loop body.- Parameters:
body- the body
-
getKind
LoopNode.LoopKind getKind()What kind of loop is this?- Returns:
- the loop kind
-
loopContracts
SequenceNode<ContractNode> loopContracts() -
copy
LoopNode copy()Description copied from interface:ASTNodeReturns a deep copy of this AST node. The node and all of its descendants will be cloned. The cloning does not copy analysis or attribute information.- Specified by:
copyin interfaceASTNode- Specified by:
copyin interfaceBlockItemNode- Specified by:
copyin interfaceStatementNode- Returns:
- deep copy of this node
-