This class encapsulates information about a Scope and its dictionary of names. Since the AST::Scope is meant purely for documentation purposes, this class provides the extra information needed for operations such as name lookup (a dictionary of types, and links to using scopes).
The using directives work as follows: Using directives effectively add all contained declarations to the namespace containing the directive, but they still need to be processed separately. To handle this each ScopeInfo remembers which other namespaces it is using {using_scopes}.
One quirk is that all used namespaces are considered as a whole for overload resolution, *not* one at a time. To facilitate this 'dummy' scopeinfos are inserted into the ScopeSearch of a containing namespace, which the algorithms recognize. (TODO: consider a wrapper(?) a.la AST::Inheritance)
Public Member functions Summary: | |
constructor | ScopeInfo(AST::Scope* s) Constructor [Source] |
constructor | ScopeInfo(ScopeInfo* s) Constructor that creates a Dummy 'using' scope referencing 's' [Source] |
destructor | ~ScopeInfo() Destructor [Source] |
int | getCount(const std::string& name) [Source] |
Public Data members Summary: | |
Dictionary* | dict Dictionary for this scope [Source] |
AST::Scope* | scope_decl The declaration for this scope [Source] |
ScopeSearch | search The list of scopes to search for this scope, including this [Source] |
ScopeSearch | using_scopes The list of scopes in the search because they are 'using'd [Source] |
ScopeSearch | used_by The list of scopes 'using' this one [Source] |
bool | is_using True only if this is a dummy Scope representing the use of another. [Source] |
AST::Access | access Current accessability [Source] |
std::map<std::string, int> | nscounts Counts of named sub-namespaces. [Source] |
Public Data members Inherited from FakeGC::cleanup | |
cleanup_next |
Public Data member Details: |
True only if this is a dummy Scope representing the use of another. If this is the case, then only 'dict' is set
Counts of named sub-namespaces. The names are things like "if", "while" etc. This is for the purely aesthetic purpose of being able to name anonymous namespaces like "`if `while `if2 `do" instead of "`if1 `while2 `if3 `do4" or even "`0001 `0002 `0003 `0004" as OpenC++ does.