Package org.eclipse.cdt.core.dom.ast
Interface IASTDeclarator
- All Superinterfaces:
IASTAttributeOwner
,IASTNameOwner
,IASTNode
- All Known Subinterfaces:
IASTArrayDeclarator
,IASTFieldDeclarator
,IASTFunctionDeclarator
,IASTStandardFunctionDeclarator
,ICASTKnRFunctionDeclarator
,ICPPASTArrayDeclarator
,ICPPASTDeclarator
,ICPPASTDeductionGuide
,ICPPASTFieldDeclarator
,ICPPASTFunctionDeclarator
,ICPPASTFunctionTryBlockDeclarator
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
IASTNode.CopyStyle
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ASTNodeProperty
DECLARATOR_NAME
represents the relationship between anIASTDeclarator
and anIASTName
.static final IASTDeclarator[]
Constant - empty declarator arraystatic final ASTNodeProperty
INITIALIZER
represents the relationship between anIASTDeclarator
and anIASTInitializer
.static final ASTNodeProperty
NESTED_DECLARATOR
represents the relationship between anIASTDeclarator
and a nestedIASTDeclarator
.static final ASTNodeProperty
POINTER_OPERATOR
represents the relationship between anIASTDeclarator
and anIASTPointerOperator
.Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTAttributeOwner
ATTRIBUTE, ATTRIBUTE_SPECIFIER
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNameOwner
r_declaration, r_definition, r_reference, r_unclear
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
EMPTY_NODE_ARRAY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPointerOperator
(IASTPointerOperator operator) Adds a pointer operator to the declarator.copy()
Returns a mutable copy of the tree rooted at this node.copy
(IASTNode.CopyStyle style) Returns a mutable copy of the tree rooted at this node.Returns the optional initializer for this declarator.getName()
Returns the name of the declarator.If the declarator is nested in parentheses, returns the declarator as found in those parentheses.This is the list of pointer operators applied to the type for the declarator.void
setInitializer
(IASTInitializer initializer) Set the optional initializer.void
Sets the name of he declarator.void
setNestedDeclarator
(IASTDeclarator nested) Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTAttributeOwner
addAttribute, addAttributeSpecifier, getAttributes, getAttributeSpecifiers
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNameOwner
getRoleForName
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
accept, contains, getChildren, getContainingFilename, getFileLocation, getLeadingSyntax, getNodeLocations, getOriginalNode, getParent, getPropertyInParent, getRawSignature, getSyntax, getTrailingSyntax, getTranslationUnit, isActive, isFrozen, isPartOfTranslationUnitFile, setParent, setPropertyInParent
-
Field Details
-
EMPTY_DECLARATOR_ARRAY
Constant - empty declarator array -
POINTER_OPERATOR
POINTER_OPERATOR
represents the relationship between anIASTDeclarator
and anIASTPointerOperator
. -
INITIALIZER
INITIALIZER
represents the relationship between anIASTDeclarator
and anIASTInitializer
. -
NESTED_DECLARATOR
NESTED_DECLARATOR
represents the relationship between anIASTDeclarator
and a nestedIASTDeclarator
. -
DECLARATOR_NAME
DECLARATOR_NAME
represents the relationship between anIASTDeclarator
and anIASTName
.
-
-
Method Details
-
getPointerOperators
IASTPointerOperator[] getPointerOperators()This is the list of pointer operators applied to the type for the declarator.- Returns:
- array of IASTPointerOperator
-
addPointerOperator
Adds a pointer operator to the declarator.- Parameters:
operator
- aIASTPointerOperator
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
-
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
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
Set the optional initializer.- Parameters:
initializer
-IASTInitializer
-
copy
IASTDeclarator 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)
. -
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 interfaceIASTNode
- Parameters:
style
-IASTNode.CopyStyle
create a copy with or without locations. Please seeIASTNode.CopyStyle
for restrictions on copies with Locations.- Since:
- 5.3
-