Interface IASTDeclarator

All Superinterfaces:
IASTAttributeOwner, IASTNameOwner, IASTNode
All Known Subinterfaces:
IASTArrayDeclarator, IASTFieldDeclarator, IASTFunctionDeclarator, IASTStandardFunctionDeclarator, ICASTKnRFunctionDeclarator, ICPPASTArrayDeclarator, ICPPASTDeclarator, ICPPASTDeductionGuide, ICPPASTFieldDeclarator, ICPPASTFunctionDeclarator, ICPPASTFunctionTryBlockDeclarator

public interface IASTDeclarator extends IASTNameOwner, IASTAttributeOwner
Base interface for a declarator.
Restriction:
This interface is not intended to be implemented by clients.
Restriction:
This interface is not intended to be extended by clients.
  • Field Details

    • EMPTY_DECLARATOR_ARRAY

      static final IASTDeclarator[] EMPTY_DECLARATOR_ARRAY
      Constant - empty declarator array
    • POINTER_OPERATOR

      static final ASTNodeProperty POINTER_OPERATOR
      POINTER_OPERATOR represents the relationship between an IASTDeclarator and an IASTPointerOperator.
    • INITIALIZER

      static final ASTNodeProperty INITIALIZER
      INITIALIZER represents the relationship between an IASTDeclarator and an IASTInitializer.
    • NESTED_DECLARATOR

      static final ASTNodeProperty NESTED_DECLARATOR
      NESTED_DECLARATOR represents the relationship between an IASTDeclarator and a nested IASTDeclarator.
    • DECLARATOR_NAME

      static final ASTNodeProperty DECLARATOR_NAME
      DECLARATOR_NAME represents the relationship between an IASTDeclarator and an IASTName.
  • Method Details

    • getPointerOperators

      IASTPointerOperator[] getPointerOperators()
      This is the list of pointer operators applied to the type for the declarator.
      Returns:
      array of IASTPointerOperator
    • addPointerOperator

      void addPointerOperator(IASTPointerOperator operator)
      Adds a pointer operator to the declarator.
      Parameters:
      operator - a IASTPointerOperator to be added.
    • getNestedDeclarator

      IASTDeclarator getNestedDeclarator()
      If the declarator is nested in parentheses, returns the declarator as found in those parentheses.
      Returns:
      the nested declarator or null
    • setNestedDeclarator

      void setNestedDeclarator(IASTDeclarator nested)
    • getName

      IASTName getName()
      Returns the name of the declarator. If this is an abstract declarator, this will return an empty name.
      Returns:
      the name of the declarator
    • setName

      void setName(IASTName name)
      Sets the name of he declarator.
      Parameters:
      name - IASTName
    • getInitializer

      IASTInitializer getInitializer()
      Returns the optional initializer for this declarator.
      Returns:
      the initializer expression or null
    • setInitializer

      void setInitializer(IASTInitializer initializer)
      Set the optional initializer.
      Parameters:
      initializer - IASTInitializer
    • copy

      Description copied from interface: IASTNode
      Returns a mutable copy of the tree rooted at this node. The following postconditions hold:
       copy.getParent() == null
       copy.getPropertyInParent() == null
       copy.isFrozen() == false
       
      Preprocessor nodes do not currently support being copied. Implicit name nodes are not copied, instead they can be regenerated if required.

      Calling this method is equivalent to copy(CopyStyle.withoutLocations).

      Specified by:
      copy in interface IASTNode
      Since:
      5.1
    • copy

      Description copied from interface: IASTNode
      Returns a mutable copy of the tree rooted at this node. The following postconditions hold:
       copy.getParent() == null
       copy.getPropertyInParent() == null
       copy.isFrozen() == false
       
      Preprocessor nodes do not currently support being copied. Implicit name nodes are not copied, instead they can be regenerated if required.
      Specified by:
      copy in interface IASTNode
      Parameters:
      style - IASTNode.CopyStyle create a copy with or without locations. Please see IASTNode.CopyStyle for restrictions on copies with Locations.
      Since:
      5.3