- All Superinterfaces:
ASTNode,ExpressionNode,ForLoopInitializerNode,InitializerNode,SizeableNode
Represents a C11 generic selection construct; see C11 Section 6.5.1.1.
-
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.getAssociatedExpression(Type typeLabel) Gets the expression node associated to the typeNode representing a type compatible with typeLabel.Returns the controlling expression.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
-
getControllingExpression
ExpressionNode getControllingExpression()Returns the controlling expression.- Returns:
- the controlling expression which is the (unevaluated) expression whose type is used to select an expression from the association list.
-
getDefaultAssociation
ExpressionNode getDefaultAssociation()- Returns:
- the default association if it exists, null otherwise
-
getAssociationList
SequenceNode<GenericAssociationNode> getAssociationList()- Returns:
- the sequence node containing all generic associations (which does not include the default association)
-
getAssociatedExpression
Gets the expression node associated to the typeNode representing a type compatible with typeLabel. If no such type node exists in the sequence of associations then returns the expression of the default association (which may be null if there is no default association).- Parameters:
typeLabel- the conceptual type that pinpoints the association of interest- Returns:
- the expression node associated with typeLabel if it exists; returns getDefaultAssociation() otherwise.
-
copy
GenericSelectionNode 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
-