Interface ForLoopNode

All Superinterfaces:
ASTNode, BlockItemNode, LoopNode, StatementNode

public interface ForLoopNode extends LoopNode
A for loop, in addition to the expression and body that all loops possess, has an initializer and incrementer. The initializer can be either an expression or a declaration. See C11 Sec. 6.8.5.
  • Method Details

    • getInitializer

      ForLoopInitializerNode getInitializer()
      Gets the initializer part of this for loop node. Note that this is an instance of either ExpressionNode or DeclarationListNode.
    • setInitializer

      void setInitializer(ForLoopInitializerNode initNode)
      Sets the initializer part of this for loop node.
      Parameters:
      initNode - the initializer
    • getIncrementer

      ExpressionNode getIncrementer()
      Gets the incrementer part of this for loop node.
      Returns:
      incrementer
    • setIncrementer

      void setIncrementer(ExpressionNode node)
      Sets the incrementer part of this for loop node.
      Parameters:
      node - the incrementer
    • copy

      ForLoopNode 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 LoopNode
      Specified by:
      copy in interface StatementNode
      Returns:
      deep copy of this node