- All Superinterfaces:
ASTNode,ExpressionNode,ForLoopInitializerNode,InitializerNode,SizeableNode
Compound literals are used to represent literal array, structure, and union values. See C11 Sec. 6.5.2.5 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).
-
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.expression.ExpressionNode
ExpressionNode.ExpressionKind -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a deep copy of this AST node.Returns the initializer list, which is exactly the same structure used in a compound initializer.Gets the type node for the type name placed in parentheses before the initializer list.voidSets the initializer list.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.expression.ExpressionNode
addConversion, expressionKind, getConversion, getConvertedType, getInitialType, getNumConversions, isConstantExpression, isLvalue, removeConversions, setInitialTypeMethods inherited from interface dev.civl.abc.ast.node.IF.declaration.InitializerNode
isSideEffectFreeMethods inherited from interface dev.civl.abc.ast.node.IF.expression.SizeableNode
getType
-
Method Details
-
getTypeNode
TypeNode getTypeNode()Gets the type node for the type name placed in parentheses before the initializer list.- Returns:
- the type node
-
getInitializerList
CompoundInitializerNode getInitializerList()Returns the initializer list, which is exactly the same structure used in a compound initializer.- Returns:
- the initializer list
-
setInitializerList
Sets the initializer list.- Parameters:
arg- the compound initializer node to become the child of this node
-
copy
CompoundLiteralNode 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 interfaceExpressionNode- Specified by:
copyin interfaceForLoopInitializerNode- Specified by:
copyin interfaceInitializerNode- Specified by:
copyin interfaceSizeableNode- Returns:
- deep copy of this node
-