Interface FloatingConstantNode

All Superinterfaces:
ASTNode, ConstantNode, ExpressionNode, ForLoopInitializerNode, InitializerNode, SizeableNode

public interface FloatingConstantNode extends ConstantNode
A floating constant node represents an occurrence of a literal floating point number in a program. The C11 Standard specifies the formats for floating point constants in Sec. 6.4.4.2:
A floating constant has a significand part that may be followed by an exponent part and a suffix that specifies its type. The components of the significand part may include a digit sequence representing the whole-number part, followed by a period (.), followed by a digit sequence representing the fraction part. The components of the exponent part are an e, E, p, or P followed by an exponent consisting of an optionally signed digit sequence. Either the whole-number part or the fraction part has to be present; for decimal floating constants, either the period or the exponent part has to be present.
  • Method Details

    • wholePart

      String wholePart()
      Returns the whole-number part of the significand. This is the digit sequence preceding the "." or just the entire significand if the "." is not present.
      Returns:
      the whole-number part of the significand
    • fractionPart

      String fractionPart()
      Returns the fraction part of the significand. This is the digit sequence following the ".". May return null if not fraction part is present.
      Returns:
      the fraction part of the significand
    • exponent

      String exponent()
      Returns the exponent part of the constant, including the letter. May return null if the exponent part is not present.
      Returns:
      the exponent part of the constant
    • getConstantValue

      RealFloatingValue getConstantValue()
      Returns the real floating value obtained by interpreting the representation of the constant.
      Specified by:
      getConstantValue in interface ConstantNode
      Returns:
      the real floating value
    • 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 ConstantNode
      Specified by:
      copy in interface ExpressionNode
      Specified by:
      copy in interface ForLoopInitializerNode
      Specified by:
      copy in interface InitializerNode
      Specified by:
      copy in interface SizeableNode
      Returns:
      deep copy of this node