Package org.eclipse.cdt.core.dom.ast
Interface IASTDeclarator
-
- All Superinterfaces:
IASTAttributeOwner,IASTNameOwner,IASTNode
- All Known Subinterfaces:
IASTArrayDeclarator,IASTFieldDeclarator,IASTFunctionDeclarator,IASTStandardFunctionDeclarator,ICASTKnRFunctionDeclarator,ICPPASTArrayDeclarator,ICPPASTDeclarator,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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
IASTNode.CopyStyle
-
-
Field Summary
Fields Modifier and Type Field Description static ASTNodePropertyDECLARATOR_NAMEDECLARATOR_NAMErepresents the relationship between anIASTDeclaratorand anIASTName.static IASTDeclarator[]EMPTY_DECLARATOR_ARRAYConstant - empty declarator arraystatic ASTNodePropertyINITIALIZERINITIALIZERrepresents the relationship between anIASTDeclaratorand anIASTInitializer.static ASTNodePropertyNESTED_DECLARATORNESTED_DECLARATORrepresents the relationship between anIASTDeclaratorand a nestedIASTDeclarator.static ASTNodePropertyPOINTER_OPERATORPOINTER_OPERATORrepresents the relationship between anIASTDeclaratorand 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddPointerOperator(IASTPointerOperator operator)Adds a pointer operator to the declarator.IASTDeclaratorcopy()Returns a mutable copy of the tree rooted at this node.IASTDeclaratorcopy(IASTNode.CopyStyle style)Returns a mutable copy of the tree rooted at this node.IASTInitializergetInitializer()Returns the optional initializer for this declarator.IASTNamegetName()Returns the name of the declarator.IASTDeclaratorgetNestedDeclarator()If the declarator is nested in parentheses, returns the declarator as found in those parentheses.IASTPointerOperator[]getPointerOperators()This is the list of pointer operators applied to the type for the declarator.voidsetInitializer(IASTInitializer initializer)Set the optional initializer.voidsetName(IASTName name)Sets the name of he declarator.voidsetNestedDeclarator(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 Detail
-
EMPTY_DECLARATOR_ARRAY
static final IASTDeclarator[] EMPTY_DECLARATOR_ARRAY
Constant - empty declarator array
-
POINTER_OPERATOR
static final ASTNodeProperty POINTER_OPERATOR
POINTER_OPERATORrepresents the relationship between anIASTDeclaratorand anIASTPointerOperator.
-
INITIALIZER
static final ASTNodeProperty INITIALIZER
INITIALIZERrepresents the relationship between anIASTDeclaratorand anIASTInitializer.
-
NESTED_DECLARATOR
static final ASTNodeProperty NESTED_DECLARATOR
NESTED_DECLARATORrepresents the relationship between anIASTDeclaratorand a nestedIASTDeclarator.
-
DECLARATOR_NAME
static final ASTNodeProperty DECLARATOR_NAME
DECLARATOR_NAMErepresents the relationship between anIASTDeclaratorand anIASTName.
-
-
Method Detail
-
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- 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
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
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
IASTDeclarator copy(IASTNode.CopyStyle style)
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
-
-