Eclipse CDT
7.0

org.eclipse.cdt.core.dom.ast
Interface IScope

All Known Subinterfaces:
ICCompositeTypeScope, ICFunctionPrototypeScope, ICFunctionScope, ICPPBlockScope, ICPPClassScope, 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.


Nested Class Summary
static class IScope.ScopeLookupData
           
 
Method Summary
 IBinding[] find(java.lang.String name)
          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, org.eclipse.cdt.core.index.IIndexFileSet acceptLocalBindings)
          Returns the binding in this scope that the given name would resolve to.
 IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup)
          Deprecated. Use getBindings(ScopeLookupData) instead
 IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, org.eclipse.cdt.core.index.IIndexFileSet acceptLocalBindings)
          Deprecated. Use getBindings(ScopeLookupData) instead
 IBinding[] getBindings(IScope.ScopeLookupData lookup)
          Get 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, or null if this is the global scope.
 org.eclipse.cdt.core.dom.IName getScopeName()
          Returns the IName for this scope, may be null
 

Method Detail

getKind

EScopeKind getKind()
Classifies the scope.

Since:
5.1

getScopeName

org.eclipse.cdt.core.dom.IName getScopeName()
Returns the IName for this scope, may be null

Returns:
The name of this scope.

getParent

IScope getParent()
                 throws DOMException
Returns the first enclosing non-template scope, or null if this is the global scope.

For scopes obtained from an index, null is returned to indicate that the scope is only enclosed by the global scope.

Throws:
DOMException

find

IBinding[] find(java.lang.String name)
This is the general lookup entry point. It returns the list of valid bindings for a given name. The lookup proceeds as an unqualified lookup. 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 -
Returns:
An array of bindings.

getBinding

IBinding getBinding(IASTName name,
                    boolean resolve)
Returns the binding in this scope that the given name would resolve to. Could return null if there is no matching binding in this scope, if the binding has not yet been cached in this scope, or if resolve == false and the appropriate binding has not yet been resolved.

Parameters:
name -
resolve - 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,
                    org.eclipse.cdt.core.index.IIndexFileSet acceptLocalBindings)
Returns the binding in this scope that the given name would resolve to. Could return null if there is no matching binding in this scope, if the binding has not yet been cached in this scope, or if resolve == false 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 -
resolve - whether or not to resolve the matching binding if it has not been so already.
acceptLocalBindings - 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. Use getBindings(ScopeLookupData) instead


getBindings

@Deprecated
IBinding[] getBindings(IASTName name,
                                  boolean resolve,
                                  boolean prefixLookup,
                                  org.eclipse.cdt.core.index.IIndexFileSet acceptLocalBindings)
Deprecated. Use getBindings(ScopeLookupData) instead


getBindings

IBinding[] getBindings(IScope.ScopeLookupData lookup)
Get the bindings in this scope that the given name or prefix could resolve to. Could return null if there is no matching bindings in this scope, if the bindings have not yet been cached in this scope, or if resolve == false 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

Eclipse CDT
7.0

Copyright (c) IBM Corp. and others 2004, 2012. All Rights Reserved.