- All Superinterfaces:
ASTNode
- All Known Subinterfaces:
AlignOfNode,ArrayLambdaNode,ArrowNode,CastNode,CharacterConstantNode,CompoundInitializerNode,CompoundLiteralNode,ConstantNode,DerivativeExpressionNode,DotNode,EnumerationConstantNode,ExpressionNode,ExtendedQuantifiedExpressionNode,FloatingConstantNode,FunctionCallNode,GenericSelectionNode,HereOrRootNode,IdentifierExpressionNode,IntegerConstantNode,LambdaNode,NothingNode,ObjectOrRegionOfNode,OperatorNode,ProcnullNode,QuantifiedExpressionNode,RegularRangeNode,RemoteOnExpressionNode,ResultNode,ScopeOfNode,SelfNode,SizeofNode,SpawnNode,StatementExpressionNode,StatenullNode,StringLiteralNode,WildcardNode
A marker interface for any node that can be used as an initializer. An initializer is used in a declaration to give an initial value to an identifier.
There are two kinds of initializers: a simple expression (used to initialize scalar variables) and compound initializers (used to initialize arrays, structs, and unions).
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.ASTNode
ASTNode.NodeKind -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a deep copy of this AST node.booleanisSideEffectFree(boolean errorsAreSideEffects) Returns true iff this expression does not contain side effects.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, transformAnnotations
-
Method Details
-
copy
InitializerNode 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. -
isSideEffectFree
boolean isSideEffectFree(boolean errorsAreSideEffects) Returns true iff this expression does not contain side effects.- Parameters:
errorsAreSideEffects- Whether to consider potential errors (division by 0, array index out of bounds, etc.) as side effects.- Returns:
- true iff this expression does not contain side effects
-