Package org.eclipse.cdt.core.dom.ast
Interface IASTName
- All Known Subinterfaces:
IASTImplicitDestructorName,IASTImplicitName,ICPPASTConversionName,ICPPASTName,ICPPASTOperatorName,ICPPASTQualifiedName,ICPPASTTemplateId,ICPPASTTemplateName
This class represents a name in the program that represents a semantic object
in the program.
- 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
FieldsFields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
EMPTY_NODE_ARRAYFields inherited from interface org.eclipse.cdt.core.dom.IName
EMPTY_ARRAY -
Method Summary
Modifier and TypeMethodDescriptioncopy()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 semantic object attached to this name.Returns the completion context for this name.Returns the image location for this name ornullif the information is not available.For convenience this method returns the last name of a qualified name orthisif this is not a qualified name.Determines the current linkage in which the name has to be resolved.char[]Returns the key for looking up this name in a scope.Returns the intermediate representation of the binding, if already available.intgetRoleOfName(boolean allowResolution) Returns the role of this name.booleanReturns whether this name is qualified, i.e.Resolves the semantic object this name is referring to.Resolves to an intermediate representation of the binding.voidsetBinding(IBinding binding) Sets the semantic object for this name to be the given bindingchar[]Returns the name including qualification and template arguments.toString()Same astoCharArray().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, setPropertyInParentMethods inherited from interface org.eclipse.cdt.core.dom.IName
getFileLocation, getSimpleID, isDeclaration, isDefinition, isReference
-
Field Details
-
EMPTY_NAME_ARRAY
Constant sentinel.
-
-
Method Details
-
toCharArray
char[] toCharArray()Returns the name including qualification and template arguments.- Specified by:
toCharArrayin interfaceIName
-
toString
String toString()Same astoCharArray(). -
getBinding
IBinding getBinding()Returns the semantic object attached to this name. May be null if this name has not yet been semantically resolved (@see resolveBinding)- Returns:
IBindingif it has been resolved, otherwise null
-
resolveBinding
IBinding resolveBinding()Resolves the semantic object this name is referring to.- Returns:
IBindingbinding
-
getRoleOfName
int getRoleOfName(boolean allowResolution) Returns the role of this name. If the name needs to be resolved to determine that andallowResolutionis set tofalse, thenIASTNameOwner.r_unclearis returned.- Parameters:
allowResolution- whether or not resolving the name is allowed.- Returns:
IASTNameOwner.r_definition,IASTNameOwner.r_declaration,IASTNameOwner.r_reference,IASTNameOwner.r_unclear.- Since:
- 5.0
-
getCompletionContext
IASTCompletionContext getCompletionContext()Returns the completion context for this name.- Returns:
IASTCompletionContextthe context for completion
-
getLinkage
ILinkage getLinkage()Determines the current linkage in which the name has to be resolved. -
getImageLocation
IASTImageLocation getImageLocation()Returns the image location for this name ornullif the information is not available.An image location can be computed when the name is either found directly in the code, is (part of) an argument to a macro expansion or is (part of) a macro definition found in the source code.
The image location is
null, when the name consists of multiple tokens (qualified names) and the tokens are not found side by side in the code, or if the name is the result of a token-paste operation or the name is found in the definition of a built-in macro.- Since:
- 5.0
-
getLastName
IASTName getLastName()For convenience this method returns the last name of a qualified name orthisif this is not a qualified name.- Since:
- 5.1
-
copy
IASTName 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
-
setBinding
Sets the semantic object for this name to be the given binding- Restriction:
- This method is not intended to be referenced by clients.
-
getLookupKey
char[] getLookupKey()Returns the key for looking up this name in a scope.- Restriction:
- This method is not intended to be referenced by clients.
-
getPreBinding
IBinding getPreBinding()Returns the intermediate representation of the binding, if already available.- Restriction:
- This method is not intended to be referenced by clients.
-
resolvePreBinding
IBinding resolvePreBinding()Resolves to an intermediate representation of the binding.- Restriction:
- This method is not intended to be referenced by clients.
-
isQualified
boolean isQualified()Returns whether this name is qualified, i.e. whether it is preceded by a scope operator.- Since:
- 5.4
-