Package org.eclipse.cdt.core.dom.ast.cpp
Interface ICPPASTFunctionDeclarator
-
- All Superinterfaces:
IASTAttributeOwner,IASTDeclarator,IASTFunctionDeclarator,IASTNameOwner,IASTNode,IASTStandardFunctionDeclarator,ICPPASTDeclarator,ICPPASTParameterListOwner
- All Known Subinterfaces:
ICPPASTFunctionTryBlockDeclarator
public interface ICPPASTFunctionDeclarator extends IASTStandardFunctionDeclarator, ICPPASTDeclarator, ICPPASTParameterListOwner
C++ adds a few things to function declarators.- 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 Modifier and Type Interface Description static classICPPASTFunctionDeclarator.RefQualifier-
Nested classes/interfaces inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
IASTNode.CopyStyle
-
-
Field Summary
Fields Modifier and Type Field Description static ASTNodePropertyCONSTRUCTOR_CHAIN_MEMBERDeprecated.Not used.static ASTNodePropertyEXCEPTION_TYPEIDstatic IASTTypeId[]NO_EXCEPTION_SPECIFICATIONUsed as return value forgetExceptionSpecification().static ICPPASTVirtSpecifier[]NO_VIRT_SPECIFIERSUsed as return value forgetVirtSpecifiers().static ICPPASTLiteralExpressionNOEXCEPT_DEFAULTRepresents a 'noexcept' specification without an expression.static ASTNodePropertyNOEXCEPT_EXPRESSIONstatic ASTNodePropertyTRAILING_RETURN_TYPEstatic ASTNodePropertyVIRT_SPECIFIER-
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTAttributeOwner
ATTRIBUTE, ATTRIBUTE_SPECIFIER
-
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTDeclarator
DECLARATOR_NAME, EMPTY_DECLARATOR_ARRAY, INITIALIZER, NESTED_DECLARATOR, POINTER_OPERATOR
-
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
-
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator
FUNCTION_PARAMETER
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddConstructorToChain(ICPPASTConstructorChainInitializer initializer)voidaddExceptionSpecificationTypeId(IASTTypeId typeId)Add an exception specification type Id.voidaddVirtSpecifier(ICPPASTVirtSpecifier virtSpecifier)Add a virt-specifiers to this function.ICPPASTFunctionDeclaratorcopy()Returns a mutable copy of the tree rooted at this node.ICPPASTFunctionDeclaratorcopy(IASTNode.CopyStyle style)Returns a mutable copy of the tree rooted at this node.ICPPASTConstructorChainInitializer[]getConstructorChain()Deprecated.UseICPPASTFunctionDefinition.getMemberInitializers(), instead.IASTTypeId[]getExceptionSpecification()Returns an array of type-ids representing the exception specification.ICPPFunctionScopegetFunctionScope()Get function scope this node represents.org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluationgetNoexceptEvaluation()Returns the noexcept evaluation, ornullif no noexcept specification is present, or or an evaluation representingnoexcept(true)in case of an empty exception specification.ICPPASTExpressiongetNoexceptExpression()Returns the noexcept expression,NOEXCEPT_DEFAULTif the noexcept specification does not contain an expression, ornullthe noexcept specification is not present.ICPPASTParameterDeclaration[]getParameters()Gets the parameter declarations for the functionICPPASTFunctionDeclarator.RefQualifiergetRefQualifier()Returns the ref-qualifier.IASTTypeIdgetTrailingReturnType()Returns the trailing return type as inauto f() -> int, ornull.ICPPASTVirtSpecifier[]getVirtSpecifiers()Returns the virt-specifiers of this function.booleanisConst()Is this a const method?booleanisConstexpr()When used as a lambda declarator, it can be constexpr.booleanisFinal()Returns whether this function is declared final.booleanisMutable()When used as a lambda declarator, it can be mutable.booleanisOverride()Returns whether this function is declared override.booleanisPureVirtual()Is the method pure virtual?booleanisVolatile()Is this a volatile method?voidsetConst(boolean value)Sets the method to be const or not.voidsetConstexpr(boolean value)When used as a lambda declarator, it can be constexpr.voidsetEmptyExceptionSpecification()Configures the declarator with an empty exception specification (as opposed to having none).voidsetFinal(boolean isFinal)Deprecated.UseaddVirtSpecifier(ICPPASTVirtSpecifier)instead.voidsetMutable(boolean value)When used as a lambda declarator, it can be mutable.voidsetNoexceptExpression(ICPPASTExpression expression)Sets the noexcept expression.voidsetOverride(boolean isOverride)Deprecated.UseaddVirtSpecifier(ICPPASTVirtSpecifier)instead.voidsetPureVirtual(boolean isPureVirtual)Sets this method to be pure virtual.voidsetRefQualifier(ICPPASTFunctionDeclarator.RefQualifier value)Sets the ref-qualifier.voidsetTrailingReturnType(IASTTypeId typeId)Trailing return type as inauto f() -> int.voidsetVirtSpecifiers(ICPPASTVirtSpecifier[] newVirtSpecifiers)Set virt-specifiers of this function.voidsetVolatile(boolean value)Sets the method to be volatile or not.-
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.IASTDeclarator
addPointerOperator, getInitializer, getName, getNestedDeclarator, getPointerOperators, setInitializer, setName, setNestedDeclarator
-
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
-
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator
addParameterDeclaration, setVarArgs, takesVarArgs
-
Methods inherited from interface org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclarator
declaresParameterPack, setDeclaresParameterPack
-
Methods inherited from interface org.eclipse.cdt.core.dom.ast.cpp.ICPPASTParameterListOwner
addParameterDeclaration, setVarArgs, takesVarArgs
-
-
-
-
Field Detail
-
NO_EXCEPTION_SPECIFICATION
static final IASTTypeId[] NO_EXCEPTION_SPECIFICATION
Used as return value forgetExceptionSpecification().- Since:
- 5.1
-
NO_VIRT_SPECIFIERS
static final ICPPASTVirtSpecifier[] NO_VIRT_SPECIFIERS
Used as return value forgetVirtSpecifiers().- Since:
- 5.7
-
NOEXCEPT_DEFAULT
static final ICPPASTLiteralExpression NOEXCEPT_DEFAULT
Represents a 'noexcept' specification without an expression.- Since:
- 5.5
-
EXCEPTION_TYPEID
static final ASTNodeProperty EXCEPTION_TYPEID
-
NOEXCEPT_EXPRESSION
static final ASTNodeProperty NOEXCEPT_EXPRESSION
- Since:
- 5.5
-
TRAILING_RETURN_TYPE
static final ASTNodeProperty TRAILING_RETURN_TYPE
- Since:
- 5.2
-
VIRT_SPECIFIER
static final ASTNodeProperty VIRT_SPECIFIER
- Since:
- 5.7
-
CONSTRUCTOR_CHAIN_MEMBER
@Deprecated static final ASTNodeProperty CONSTRUCTOR_CHAIN_MEMBER
Deprecated.Not used.- Restriction:
- This field is not intended to be referenced by clients.
-
-
Method Detail
-
isConst
boolean isConst()
Is this a const method?
-
setConst
void setConst(boolean value)
Sets the method to be const or not.
-
isVolatile
boolean isVolatile()
Is this a volatile method?
-
setVolatile
void setVolatile(boolean value)
Sets the method to be volatile or not.
-
isMutable
boolean isMutable()
When used as a lambda declarator, it can be mutable.- Since:
- 5.3
-
setMutable
void setMutable(boolean value)
When used as a lambda declarator, it can be mutable.- Since:
- 5.3
-
isConstexpr
boolean isConstexpr()
When used as a lambda declarator, it can be constexpr.- Since:
- 7.0
-
setConstexpr
void setConstexpr(boolean value)
When used as a lambda declarator, it can be constexpr.- Since:
- 7.0
-
isPureVirtual
boolean isPureVirtual()
Is the method pure virtual?
-
setPureVirtual
void setPureVirtual(boolean isPureVirtual)
Sets this method to be pure virtual.
-
getRefQualifier
ICPPASTFunctionDeclarator.RefQualifier getRefQualifier()
Returns the ref-qualifier.- Since:
- 5.9
-
setRefQualifier
void setRefQualifier(ICPPASTFunctionDeclarator.RefQualifier value)
Sets the ref-qualifier.- Since:
- 5.9
-
getParameters
ICPPASTParameterDeclaration[] getParameters()
Description copied from interface:IASTStandardFunctionDeclaratorGets the parameter declarations for the function- Specified by:
getParametersin interfaceIASTStandardFunctionDeclarator- Specified by:
getParametersin interfaceICPPASTParameterListOwner- Returns:
- array of IASTParameterDeclaration
- Since:
- 5.2
-
getExceptionSpecification
IASTTypeId[] getExceptionSpecification()
Returns an array of type-ids representing the exception specification. The return valueNO_EXCEPTION_SPECIFICATIONindicates that no exceptions are specified, whereasIASTTypeId.EMPTY_TYPEID_ARRAYis used for an empty exception specification.
-
addExceptionSpecificationTypeId
void addExceptionSpecificationTypeId(IASTTypeId typeId)
Add an exception specification type Id.
-
setEmptyExceptionSpecification
void setEmptyExceptionSpecification()
Configures the declarator with an empty exception specification (as opposed to having none).- Since:
- 5.1
-
getNoexceptExpression
ICPPASTExpression getNoexceptExpression()
Returns the noexcept expression,NOEXCEPT_DEFAULTif the noexcept specification does not contain an expression, ornullthe noexcept specification is not present. See C++11 5.4.1.- Since:
- 5.5
-
getNoexceptEvaluation
org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation getNoexceptEvaluation()
Returns the noexcept evaluation, ornullif no noexcept specification is present, or or an evaluation representingnoexcept(true)in case of an empty exception specification.- Since:
- 6.7
- Restriction:
- This method is not intended to be referenced by clients.
-
setNoexceptExpression
void setNoexceptExpression(ICPPASTExpression expression)
Sets the noexcept expression.- Since:
- 5.5
-
getTrailingReturnType
IASTTypeId getTrailingReturnType()
Returns the trailing return type as inauto f() -> int, ornull.- Since:
- 5.2
-
setTrailingReturnType
void setTrailingReturnType(IASTTypeId typeId)
Trailing return type as inauto f() -> int.- Since:
- 5.2
-
getFunctionScope
ICPPFunctionScope getFunctionScope()
Get function scope this node represents. Returnsnull, if this declarator does not declare a function-prototype or function-definition.- Specified by:
getFunctionScopein interfaceIASTStandardFunctionDeclarator
-
copy
ICPPASTFunctionDeclarator 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).- Specified by:
copyin interfaceIASTDeclarator- Specified by:
copyin interfaceIASTFunctionDeclarator- Specified by:
copyin interfaceIASTNode- Specified by:
copyin interfaceIASTStandardFunctionDeclarator- Since:
- 5.1
-
copy
ICPPASTFunctionDeclarator 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 interfaceIASTDeclarator- Specified by:
copyin interfaceIASTFunctionDeclarator- Specified by:
copyin interfaceIASTNode- Specified by:
copyin interfaceIASTStandardFunctionDeclarator- Parameters:
style-IASTNode.CopyStylecreate a copy with or without locations. Please seeIASTNode.CopyStylefor restrictions on copies with Locations.- Since:
- 5.3
-
isOverride
boolean isOverride()
Returns whether this function is declared override.- Since:
- 5.5
-
isFinal
boolean isFinal()
Returns whether this function is declared final.- Since:
- 5.5
-
getVirtSpecifiers
ICPPASTVirtSpecifier[] getVirtSpecifiers()
Returns the virt-specifiers of this function.- Since:
- 5.7
-
addVirtSpecifier
void addVirtSpecifier(ICPPASTVirtSpecifier virtSpecifier)
Add a virt-specifiers to this function.- Since:
- 5.7
-
setVirtSpecifiers
void setVirtSpecifiers(ICPPASTVirtSpecifier[] newVirtSpecifiers)
Set virt-specifiers of this function.- Since:
- 6.6
-
getConstructorChain
@Deprecated ICPPASTConstructorChainInitializer[] getConstructorChain()
Deprecated.UseICPPASTFunctionDefinition.getMemberInitializers(), instead.- Restriction:
- This method is not intended to be referenced by clients.
-
addConstructorToChain
@Deprecated void addConstructorToChain(ICPPASTConstructorChainInitializer initializer)
- Restriction:
- This method is not intended to be referenced by clients.
-
setFinal
@Deprecated void setFinal(boolean isFinal)
Deprecated.UseaddVirtSpecifier(ICPPASTVirtSpecifier)instead.- Since:
- 5.5
- Restriction:
- This method is not intended to be referenced by clients.
-
setOverride
@Deprecated void setOverride(boolean isOverride)
Deprecated.UseaddVirtSpecifier(ICPPASTVirtSpecifier)instead.- Since:
- 5.5
- Restriction:
- This method is not intended to be referenced by clients.
-
-