#include <cppScope.h>
Inheritance diagram for CPPScope:
Public Types | |
typedef vector< CPPDeclaration * > | Declarations |
typedef map< string, CPPType * > | ExtensionTypes |
typedef map< string, CPPNamespace * > | Namespaces |
typedef map< string, CPPTypedef * > | Typedefs |
typedef map< string, CPPInstance * > | Variables |
typedef map< string, CPPFunctionGroup * > | Functions |
typedef map< string, CPPDeclaration * > | Templates |
Public Member Functions | |
CPPScope (CPPScope *parent_scope, const CPPNameComponent &name, CPPVisibility starting_vis) | |
virtual | ~CPPScope () |
void | set_current_vis (CPPVisibility current_vis) |
CPPVisibility | get_current_vis () const |
void | set_struct_type (CPPStructType *struct_type) |
Sets the struct or class that owns this scope. | |
CPPStructType * | get_struct_type () const |
Returns the class or struct that defines this scope, if any. | |
CPPScope * | get_parent_scope () const |
Returns the parent scope of this scope, if any. | |
virtual void | add_declaration (CPPDeclaration *decl, CPPScope *global_scope, CPPPreprocessor *preprocessor, const cppyyltype &pos) |
virtual void | add_enum_value (CPPInstance *inst) |
virtual void | define_extension_type (CPPExtensionType *type) |
virtual void | define_namespace (CPPNamespace *scope) |
virtual void | add_using (CPPUsing *using_decl, CPPScope *global_scope, CPPPreprocessor *error_sink=NULL) |
virtual bool | is_fully_specified () const |
Returns true if this declaration is an actual, factual declaration, or false if some part of the declaration depends on a template parameter which has not yet been instantiated. | |
CPPScope * | instantiate (const CPPTemplateParameterList *actual_params, CPPScope *current_scope, CPPScope *global_scope, CPPPreprocessor *error_sink=NULL) const |
CPPScope * | substitute_decl (CPPDeclaration::SubstDecl &subst, CPPScope *current_scope, CPPScope *global_scope) const |
CPPType * | find_type (const string &name, bool recurse=true) const |
CPPType * | find_type (const string &name, CPPDeclaration::SubstDecl &subst, CPPScope *global_scope, bool recurse=true) const |
CPPScope * | find_scope (const string &name, bool recurse=true) const |
CPPScope * | find_scope (const string &name, CPPDeclaration::SubstDecl &subst, CPPScope *global_scope, bool recurse=true) const |
CPPDeclaration * | find_symbol (const string &name, bool recurse=true) const |
CPPDeclaration * | find_template (const string &name, bool recurse=true) const |
virtual string | get_simple_name () const |
virtual string | get_local_name (CPPScope *scope=NULL) const |
virtual string | get_fully_scoped_name () const |
virtual void | output (ostream &out, CPPScope *scope) const |
void | write (ostream &out, int indent, CPPScope *scope) const |
CPPTemplateScope * | get_template_scope () |
Returns the nearest ancestor of this scope that is a template scope, or NULL if the scope is fully specified. | |
virtual CPPTemplateScope * | as_template_scope () |
Public Attributes | |
Declarations | _declarations |
ExtensionTypes | _structs |
ExtensionTypes | _classes |
ExtensionTypes | _unions |
ExtensionTypes | _enums |
Namespaces | _namespaces |
Typedefs | _typedefs |
Variables | _variables |
Variables | _enum_values |
Functions | _functions |
Templates | _templates |
CPPNameComponent | _name |
Protected Types | |
typedef set< CPPScope * > | Using |
Protected Attributes | |
CPPScope * | _parent_scope |
CPPStructType * | _struct_type |
Using | _using |
CPPVisibility | _current_vis |
Private Types | |
typedef map< const CPPTemplateParameterList *, CPPScope *, CPPTPLCompare > | Instantiations |
Private Member Functions | |
bool | copy_substitute_decl (CPPScope *to_scope, CPPDeclaration::SubstDecl &subst, CPPScope *global_scope) const |
This is in support of both substitute_decl() and instantiate(). | |
void | handle_declaration (CPPDeclaration *decl, CPPScope *global_scope) |
Does the right thing with a newly given declaration: adds it to the typedef list, or variables or functions, or whatever. | |
Private Attributes | |
Instantiations | _instantiations |
bool | _is_fully_specified |
bool | _fully_specified_known |
bool | _is_fully_specified_recursive_protect |
bool | _subst_decl_recursive_protect |
|
Definition at line 126 of file cppScope.h. |
|
Definition at line 129 of file cppScope.h. |
|
Definition at line 143 of file cppScope.h. |
|
Definition at line 157 of file cppScope.h. |
|
Definition at line 135 of file cppScope.h. |
|
Definition at line 145 of file cppScope.h. |
|
Definition at line 138 of file cppScope.h. |
|
Definition at line 152 of file cppScope.h. |
|
Definition at line 140 of file cppScope.h. |
|
Definition at line 50 of file cppScope.cxx. References _fully_specified_known, _is_fully_specified, _is_fully_specified_recursive_protect, _struct_type, _subst_decl_recursive_protect, and NULL. |
|
Definition at line 71 of file cppScope.cxx. References _struct_type. |
|
Reimplemented in CPPTemplateScope. Definition at line 155 of file cppScope.cxx. References _enum_values. Referenced by CPPTemplateScope::CPPTemplateScope(). |
|
Reimplemented in CPPTemplateScope. Definition at line 181 of file cppScope.cxx. References _enums, _unions, and CPPExtensionType::T_enum. Referenced by CPPTemplateScope::add_declaration(). |
|
Reimplemented in CPPTemplateScope. Definition at line 279 of file cppScope.cxx. References _is_fully_specified. |
|
Reimplemented in CPPTemplateScope. Definition at line 907 of file cppScope.cxx. Referenced by get_fully_scoped_name(), and is_fully_specified(). |
|
This is in support of both substitute_decl() and instantiate(). It's similar in purpose to substitute_decl(), but this function assumes the caller has already created a new, empty scope. All of the declarations in this scope are copied to the new scope, filtering through the subst decl. The return value is true if the scope is changed, false if it is not. Definition at line 936 of file cppScope.cxx. |
|
Reimplemented in CPPTemplateScope. Definition at line 198 of file cppScope.cxx. Referenced by CPPTemplateScope::add_enum_value(). |
|
Reimplemented in CPPTemplateScope. Definition at line 265 of file cppScope.cxx. Referenced by CPPTemplateScope::define_extension_type(). |
|
Definition at line 642 of file cppScope.cxx. |
|
Definition at line 587 of file cppScope.cxx. References CPPStructType::_scope, CPPDeclaration::as_struct_type(), find_type(), global_scope, and NULL. Referenced by CPPIdentifier::get_scope(), and CPPIdentifier::is_fully_specified(). |
|
Definition at line 663 of file cppScope.cxx. References NULL. |
|
Definition at line 729 of file cppScope.cxx. References _parent_scope, get_local_name(), CPPNameComponent::get_name_with_templ(), and NULL. |
|
Definition at line 538 of file cppScope.cxx. References _namespaces. |
|
Definition at line 493 of file cppScope.cxx. References _typedefs, current_scope, global_scope, and substitute_decl(). Referenced by find_scope(), CPPIdentifier::get_scope(), and substitute_decl(). |
|
Definition at line 143 of file cppScope.cxx. |
|
Reimplemented in CPPTemplateScope. Definition at line 814 of file cppScope.cxx. References _parent_scope, as_template_scope(), get_template_scope(), and NULL. Referenced by CPPIdentifier::get_scope(), and CPPIdentifier::is_tbd(). |
|
Reimplemented in CPPTemplateScope. Definition at line 791 of file cppScope.cxx. References CPPDeclaration::_vis, and indent(). Referenced by find_template(), CPPInstance::get_simple_name(), and is_fully_specified(). |
|
Returns the parent scope of this scope, if any.
Definition at line 119 of file cppScope.cxx. References _current_vis. |
|
Reimplemented in CPPTemplateScope. Definition at line 774 of file cppScope.cxx. References _parent_scope, NULL, and output(). |
|
Returns the class or struct that defines this scope, if any.
Definition at line 106 of file cppScope.cxx. References _current_vis. |
|
Returns the nearest ancestor of this scope that is a template scope, or NULL if the scope is fully specified.
Definition at line 889 of file cppScope.cxx. Referenced by get_fully_scoped_name(). |
|
Does the right thing with a newly given declaration: adds it to the typedef list, or variables or functions, or whatever.
Definition at line 1098 of file cppScope.cxx. |
|
Definition at line 359 of file cppScope.cxx. References NULL. Referenced by CPPIdentifier::get_scope(). |
|
Returns true if this declaration is an actual, factual declaration, or false if some part of the declaration depends on a template parameter which has not yet been instantiated.
Reimplemented in CPPParser, and CPPTemplateScope. Definition at line 318 of file cppScope.cxx. References _instantiations, _name, CPPTemplateScope::_parameters, _parent_scope, as_template_scope(), CPPTemplateParameterList::build_subst_decl(), current_scope, get_local_name(), global_scope, NULL, CPPDeclaration::SubstDecl, and CPPPreprocessor::warning(). |
|
Reimplemented in CPPTemplateScope. Definition at line 837 of file cppScope.cxx. Referenced by get_simple_name(), and CPPIdentifier::substitute_decl(). |
|
Definition at line 131 of file cppScope.cxx. References CPPDeclaration::_leading_comment, cppyyltype::file, cppyyltype::first_line, CPPPreprocessor::get_comment_before(), and NULL. |
|
Sets the struct or class that owns this scope. This should only be done once, when the scope and its associated struct are created. It's provided so the scope can check the struct's ancestry for inherited symbols. Definition at line 91 of file cppScope.cxx. References _parent_scope. |
|
Definition at line 440 of file cppScope.cxx. References CPPStructType::_derivation, _parent_scope, CPPStructType::_scope, _struct_type, _typedefs, _using, find_type(), and NULL. Referenced by find_type(). |
|
Definition at line 854 of file cppScope.cxx. References CPPStructType::Base::_base, CPPStructType::_derivation, CPPDeclaration::_file, CPPExtensionType::_ident, CPPStructType::_incomplete, _name, CPPIdentifier::_native_scope, _struct_type, CPPExtensionType::_type, CPPDeclaration::as_type(), global_scope, NULL, and CPPDeclaration::substitute_decl(). |
|
Definition at line 131 of file cppScope.h. |
|
Definition at line 154 of file cppScope.h. Referenced by get_parent_scope(), and get_struct_type(). |
|
Definition at line 127 of file cppScope.h. Referenced by InterrogateBuilder::remap_indices(), and TypeManager::wrap_const_pointer(). |
|
Definition at line 142 of file cppScope.h. Referenced by add_declaration(). |
|
Definition at line 133 of file cppScope.h. Referenced by add_enum_value(). |
|
Definition at line 161 of file cppScope.h. Referenced by CPPScope(). |
|
Definition at line 144 of file cppScope.h. Referenced by CPPStructType::check_virtual(). |
|
Definition at line 158 of file cppScope.h. Referenced by is_fully_specified(). |
|
Definition at line 160 of file cppScope.h. Referenced by add_using(), and CPPScope(). |
|
Definition at line 162 of file cppScope.h. Referenced by CPPScope(). |
|
Definition at line 147 of file cppScope.h. Referenced by is_fully_specified(), and write(). |
|
Definition at line 136 of file cppScope.h. Referenced by find_type(). |
|
|
Definition at line 151 of file cppScope.h. Referenced by CPPScope(), substitute_decl(), write(), and ~CPPScope(). |
|
Definition at line 130 of file cppScope.h. |
|
Definition at line 163 of file cppScope.h. Referenced by CPPScope(). |
|
Definition at line 146 of file cppScope.h. |
|
Definition at line 139 of file cppScope.h. Referenced by CPPTemplateScope::add_using(), find_type(), and substitute_decl(). |
|
Definition at line 132 of file cppScope.h. Referenced by add_enum_value(). |
|
Definition at line 153 of file cppScope.h. Referenced by substitute_decl(). |
|
Definition at line 141 of file cppScope.h. |