Module dev.civl.abc

Interface OrdinaryDeclarationNode

All Superinterfaces:
ASTNode, BlockItemNode, DeclarationNode
All Known Subinterfaces:
AbstractFunctionDefinitionNode, FunctionDeclarationNode, FunctionDefinitionNode, PredicateNode, VariableDeclarationNode

public interface OrdinaryDeclarationNode extends BlockItemNode, DeclarationNode

A declaration of a variable or function via a C "declarator". In addition to the identifier (common to all declarations), this also specifies a type and storage information.

Note that this is not used to declare members of structures or unions ("fields"). A FieldDeclarationNode is used for that.

  • Method Details

    • ordinaryDeclarationKind

      The kind of ordinary declaration this is.
      Returns:
      the ordinary declaration kind
    • getTypeNode

      TypeNode getTypeNode()
      The type of the thing being declared. This may be null: e.g., in a function declaration, the parameter types do not necessarily have to be declared.
      Returns:
      the type node for the type of the entity being declared
      See Also:
    • setTypeNode

      void setTypeNode(TypeNode type)
      Sets the type node that will be returned by getTypeNode().
      Parameters:
      type - the node representing the type part of the declaration
    • hasExternStorage

      boolean hasExternStorage()
      Does the declaration include the extern storage class specifier? That specifier can be used for functions and objects.
      Returns:
      true iff the declaration contains extern
      See Also:
    • setExternStorage

      void setExternStorage(boolean value)
      Sets the value that will be returned by hasExternStorage(). The initial default value is false.
      Parameters:
      value - true iff the declaration contains extern, else false
      See Also:
    • hasStaticStorage

      boolean hasStaticStorage()
      Does the declaration include the static storage class specifier? This maybe used for functions and objects.
      Returns:
      true iff declaration contains static
      See Also:
    • setStaticStorage

      void setStaticStorage(boolean value)
      Sets the value that will be returned by hasStaticStorage(). Default value is false.
      Parameters:
      value - true iff declaration contains static
      See Also:
    • 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 BlockItemNode
      Specified by:
      copy in interface DeclarationNode
      Returns:
      deep copy of this node