Interface CivlForNode

All Superinterfaces:
ASTNode, BlockItemNode, StatementNode

public interface CivlForNode extends StatementNode

Represents a CIVL $for or $parfor statement. The syntax for $for is

 $for (int i1, i2, ... : expr) stmt
 
where 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.

  • Method Details

    • isParallel

      boolean isParallel()
      Is this a parallel loop, i.e., $parfor (as opposed to $for)?
      Returns:
      true iff 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: ASTNode
      Returns 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:
      copy in interface ASTNode
      Specified by:
      copy in interface BlockItemNode
      Specified by:
      copy in interface StatementNode
      Returns:
      deep copy of this node