Interface CompoundLiteralNode

All Superinterfaces:
ASTNode, ExpressionNode, ForLoopInitializerNode, InitializerNode, SizeableNode

public interface CompoundLiteralNode extends ExpressionNode

Compound literals are used to represent literal array, structure, and union values. See C11 Sec. and Sec. 6.7.9.

The syntax and interpretation of compound literals is exactly the same as for those of compound initializers. The only difference is that for compound initializers, the type is obtained from the declared type of the variable being initialized, while for compound literals the type is obtained by placing the type name in parentheses before the initialization list (similar in appearance to a cast).

  • Method Details

    • getTypeNode

      TypeNode getTypeNode()
      Gets the type node for the type name placed in parentheses before the initializer list.
      the type node
    • getInitializerList

      CompoundInitializerNode getInitializerList()
      Returns the initializer list, which is exactly the same structure used in a compound initializer.
      the initializer list
    • setInitializerList

      void setInitializerList(CompoundInitializerNode arg)
      Sets the initializer list.
      arg - the compound initializer node to become the child of this node
    • 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 ExpressionNode
      Specified by:
      copy in interface ForLoopInitializerNode
      Specified by:
      copy in interface InitializerNode
      Specified by:
      copy in interface SizeableNode
      deep copy of this node