- All Superinterfaces:
ASTNode,BlockItemNode,StatementNode
Represents a CIVL $for or $parfor statement. The
syntax for $for is
$for (int i1, i2, ... : expr) stmtwhere
i1, i2, etc., are the loop variables,
expr is an expression of type $domain(n), where
n is the number of loop variables, and stmt is a
statement.
The syntax for $parfor is exactly the same with
$parfor replacing $for.
-
Nested Class Summary
Nested 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.Returns the iteration domain expression, which is the expression following the colon.Returns the sequence of loop variable declarations.booleanIs this a parallel loop, i.e.,$parfor(as opposed to$for)?Optional loop contracts 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
-
isParallel
boolean isParallel()Is this a parallel loop, i.e.,$parfor(as opposed to$for)?- Returns:
trueiff this is a parellel loop
-
getDomain
ExpressionNode getDomain()Returns the iteration domain expression, which is the expression following the colon.- Returns:
- the iteration domain expression
-
getBody
StatementNode getBody()The loop body.- Returns:
- the loop body
-
loopContracts
SequenceNode<ContractNode> loopContracts()Optional loop contracts node.- Returns:
- loop contracts or null
-
getVariables
DeclarationListNode getVariables()Returns the sequence of loop variable declarations. Each element in the sequence is a declaration of a variable of integer type. The declarations will not have initializers.- Returns:
- the sequence of loop variable declarations
-
copy
CivlForNode 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
-