Interface InitializerNode

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, MPIContractAbsentEventNode, MPIContractAbsentNode, MPIContractConstantNode, MPIContractExpressionNode, NothingNode, ObjectOrRegionOfNode, OperatorNode, ProcnullNode, QuantifiedExpressionNode, RegularRangeNode, RemoteOnExpressionNode, ResultNode, ScopeOfNode, SelfNode, SizeofNode, SpawnNode, StatementExpressionNode, StatenullNode, StringLiteralNode, ValueAtNode, WildcardNode

public interface InitializerNode extends ASTNode

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).

  • Method Details

    • 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
      Returns:
      deep copy of this node
    • 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