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
FieldsModifier and TypeFieldDescriptionstatic final ASTNodePropertyDECLARATOR_NAMErepresents the relationship between anIASTDeclaratorand anIASTName.static final IASTDeclarator[]Constant - empty declarator arraystatic final ASTNodePropertyINITIALIZERrepresents the relationship between anIASTDeclaratorand anIASTInitializer.static final ASTNodePropertyNESTED_DECLARATORrepresents the relationship between anIASTDeclaratorand a nestedIASTDeclarator.static final ASTNodePropertyPOINTER_OPERATORrepresents the relationship between anIASTDeclaratorand anIASTPointerOperator.Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTAttributeOwner
ATTRIBUTE, ATTRIBUTE_SPECIFIERFields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNameOwner
r_declaration, r_definition, r_reference, r_unclearFields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
EMPTY_NODE_ARRAY -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPointerOperator(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.voidsetInitializer(IASTInitializer initializer) Set the optional initializer.voidSets the name of he declarator.voidsetNestedDeclarator(IASTDeclarator nested) Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTAttributeOwner
addAttribute, addAttributeSpecifier, getAttributes, getAttributeSpecifiersMethods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNameOwner
getRoleForNameMethods 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_OPERATORrepresents the relationship between anIASTDeclaratorand anIASTPointerOperator. -
INITIALIZER
INITIALIZERrepresents the relationship between anIASTDeclaratorand anIASTInitializer. -
NESTED_DECLARATOR
NESTED_DECLARATORrepresents the relationship between anIASTDeclaratorand a nestedIASTDeclarator. -
DECLARATOR_NAME
DECLARATOR_NAMErepresents the relationship between anIASTDeclaratorand 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- aIASTPointerOperatorto 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:IASTNodeReturns 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:IASTNodeReturns 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:
copyin interfaceIASTNode- Parameters:
style-IASTNode.CopyStylecreate a copy with or without locations. Please seeIASTNode.CopyStylefor restrictions on copies with Locations.- Since:
- 5.3
-