Package org.eclipse.cdt.core.dom.ast
Interface IScope
-
- All Known Subinterfaces:
ICCompositeTypeScope
,ICFunctionPrototypeScope
,ICFunctionScope
,ICPPBlockScope
,ICPPClassScope
,ICPPEnumScope
,ICPPFunctionScope
,ICPPNamespaceScope
,ICPPScope
,ICPPTemplateScope
,ICScope
,IProblemBinding
public interface IScope
Scopes can be used to look-up names. With the exception of template-scopes the scopes can be arranged in a hierarchy.- 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 class
IScope.ScopeLookupData
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description IBinding[]
find(String name)
Deprecated.IBinding[]
find(String name, IASTTranslationUnit tu)
This is the general lookup entry point.IBinding
getBinding(IASTName name, boolean resolve)
Returns the binding in this scope that the given name would resolve to.IBinding
getBinding(IASTName name, boolean resolve, IIndexFileSet acceptLocalBindings)
Returns the binding in this scope that the given name would resolve to.IBinding[]
getBindings(IASTName name, boolean resolve, boolean prefixLookup)
Deprecated.UsegetBindings(ScopeLookupData)
insteadIBinding[]
getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet acceptLocalBindings)
Deprecated.UsegetBindings(ScopeLookupData)
insteadIBinding[]
getBindings(IScope.ScopeLookupData lookup)
Returns the bindings in this scope that the given name or prefix could resolve to.EScopeKind
getKind()
Classifies the scope.IScope
getParent()
Returns the first enclosing non-template scope, ornull
if this is the global scope.IName
getScopeName()
Returns the IName for this scope, may benull
.
-
-
-
Method Detail
-
getKind
EScopeKind getKind()
Classifies the scope.- Since:
- 5.1
-
getScopeName
IName getScopeName()
Returns the IName for this scope, may benull
.- Returns:
- The name of this scope.
-
getParent
IScope getParent() throws DOMException
Returns the first enclosing non-template scope, ornull
if this is the global scope.- Throws:
DOMException
-
find
IBinding[] find(String name, IASTTranslationUnit tu)
This is the general lookup entry point. It returns the list of valid bindings for a given name in this scope and its enclosing scopes. The name is treated as unqualified. Constructors are not considered during this lookup and won't be returned. No attempt is made to resolve potential ambiguities or perform access checking.- Parameters:
name
- the name of the bindingstu
- the translation unit determining the context for the lookup- Returns:
- An array of bindings
- Since:
- 5.11
-
find
@Deprecated IBinding[] find(String name)
Deprecated.- Restriction:
- This method is not intended to be referenced by clients.
-
getBinding
IBinding getBinding(IASTName name, boolean resolve)
Returns the binding in this scope that the given name would resolve to. Could returnnull
if there is no matching binding in this scope, if the binding has not yet been cached in this scope, or if resolve isfalse
and the appropriate binding has not yet been resolved.- Parameters:
name
- the name of the bindingresolve
- whether or not to resolve the matching binding if it has not been so already- Returns:
- the binding in this scope that matches the name, or
null
-
getBinding
IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet acceptLocalBindings)
Returns the binding in this scope that the given name would resolve to. Could returnnull
if there is no matching binding in this scope, if the binding has not yet been cached in this scope, or if resolve isfalse
and the appropriate binding has not yet been resolved. Accepts file local bindings from the index for the files in the given set, only.- Parameters:
name
- the name of the bindingresolve
- whether or not to resolve the matching binding if it has not been so alreadyacceptLocalBindings
- a set of files for which to accept local bindings- Returns:
- the binding in this scope that matches the name, or
null
-
getBindings
@Deprecated IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup)
Deprecated.UsegetBindings(ScopeLookupData)
instead- Restriction:
- This method is not intended to be referenced by clients.
-
getBindings
@Deprecated IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet acceptLocalBindings)
Deprecated.UsegetBindings(ScopeLookupData)
instead- Restriction:
- This method is not intended to be referenced by clients.
-
getBindings
IBinding[] getBindings(IScope.ScopeLookupData lookup)
Returns the bindings in this scope that the given name or prefix could resolve to. Could returnnull
if there is no matching bindings in this scope, if the bindings have not yet been cached in this scope, or if resolve isfalse
and the appropriate bindings have not yet been resolved.- Returns:
- the bindings in this scope that match the name or prefix, or
null
- Since:
- 5.5
-
-