Interface ConstantNode

All Superinterfaces:
ASTNode, ExpressionNode, ForLoopInitializerNode, InitializerNode, SizeableNode
All Known Subinterfaces:
CharacterConstantNode, EnumerationConstantNode, FloatingConstantNode, HereOrRootNode, IntegerConstantNode, MPIContractConstantNode, ProcnullNode, SelfNode, StatenullNode

public interface ConstantNode extends ExpressionNode
A "constant" in the sense of the C11 Standard. See C11 Sec. 6.4.4. Note that C uses the word "constant" in a limited way. Character, integer, and floating point literals and enumeration constants are all considered "constants". String literals and compound literals (array, structure, and union literals) are not considered constants.
  • Method Details

    • constantKind

    • getStringRepresentation

      String getStringRepresentation()
      Returns the representation of the constant exactly as it occurred in the source code.
      the original representation of this constant in the source code
    • setStringRepresentation

      void setStringRepresentation(String representation)
      Sets the value returned by getStringRepresentation().
      representation - the original representation of this constant in the source code
    • getConstantValue

      Value getConstantValue()
      Returns the actual constant value, obtained by evaluating this constant expression.
      the value of this constant expression
    • copy

      ConstantNode 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