Eclipse CDT
Pre-release 3.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


Method Summary
 void addBinding(IBinding binding)
          This adds an IBinding to the scope.
 void addName(IASTName name)
          Add an IASTName to be cached in this scope
 IBinding[] find(String name)
          This is the general lookup entry point.
 void flushCache()
          clear the name cache in this scope
 IBinding getBinding(IASTName name, boolean resolve)
          Get the binding in this scope that the given name would resolve to.
 IScope getParent()
          Scopes are arranged hierarchically.
 IASTNode getPhysicalNode()
          Return the physical IASTNode that this scope was created for
 IASTName getScopeName()
          Get the IASTName for this scope, may be null
 boolean isFullyCached()
          whether or not this scope's cache contains all the names
 void removeBinding(IBinding binding)
          remove the given binding from this scope
 void setFullyCached(boolean b)
          Set whether or not all the names in this scope have been cached
 

Method Detail

getScopeName

IASTName getScopeName()
                      throws DOMException
Get the IASTName for this scope, may be null

Returns:
Throws:
DOMException

getParent

IScope getParent()
                 throws DOMException
Scopes are arranged hierarchically. Lookups will generally flow upward to find resolution.

Returns:
Throws:
DOMException

find

IBinding[] find(String name)
                throws DOMException
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:
searchString -
Returns:
List of IBinding
Throws:
DOMException

getPhysicalNode

IASTNode getPhysicalNode()
                         throws DOMException
Return the physical IASTNode that this scope was created for

Returns:
Throws:
DOMException

addName

void addName(IASTName name)
             throws DOMException
Add an IASTName to be cached in this scope

Parameters:
name -
Throws:
DOMException

removeBinding

void removeBinding(IBinding binding)
                   throws DOMException
remove the given binding from this scope

Parameters:
binding -
Throws:
DOMException

getBinding

IBinding getBinding(IASTName name,
                    boolean resolve)
                    throws DOMException
Get 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
Throws:
DOMException

addBinding

void addBinding(IBinding binding)
                throws DOMException
This adds an IBinding to the scope. It is primarily used by the parser to add implicit IBindings to the scope (such as GCC built-in functions).

Parameters:
binding -
Throws:
DOMException

setFullyCached

void setFullyCached(boolean b)
                    throws DOMException
Set whether or not all the names in this scope have been cached

Parameters:
b -
Throws:
DOMException

isFullyCached

boolean isFullyCached()
                      throws DOMException
whether or not this scope's cache contains all the names

Returns:
Throws:
DOMException

flushCache

void flushCache()
                throws DOMException
clear the name cache in this scope

Throws:
DOMException

Eclipse CDT
Pre-release 3.0

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