Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

CPPScope Class Reference

#include <cppScope.h>

Inheritance diagram for CPPScope:

CPPParser CPPTemplateScope List of all members.

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)
CPPStructTypeget_struct_type () const
CPPScope * get_parent_scope () const
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
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
CPPTypefind_type (const string &name, bool recurse=true) const
CPPTypefind_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
CPPDeclarationfind_symbol (const string &name, bool recurse=true) const
CPPDeclarationfind_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
CPPTemplateScopeget_template_scope ()
virtual CPPTemplateScopeas_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
void handle_declaration (CPPDeclaration *decl, CPPScope *global_scope)

Private Attributes

Instantiations _instantiations
bool _is_fully_specified
bool _fully_specified_known
bool _is_fully_specified_recursive_protect
bool _subst_decl_recursive_protect

Member Typedef Documentation

typedef vector<CPPDeclaration *> CPPScope::Declarations
 

Definition at line 121 of file cppScope.h.

typedef map<string, CPPType *> CPPScope::ExtensionTypes
 

Definition at line 124 of file cppScope.h.

typedef map<string, CPPFunctionGroup *> CPPScope::Functions
 

Definition at line 138 of file cppScope.h.

typedef map<const CPPTemplateParameterList *, CPPScope *, CPPTPLCompare> CPPScope::Instantiations [private]
 

Definition at line 152 of file cppScope.h.

typedef map<string, CPPNamespace *> CPPScope::Namespaces
 

Definition at line 130 of file cppScope.h.

typedef map<string, CPPDeclaration *> CPPScope::Templates
 

Definition at line 140 of file cppScope.h.

typedef map<string, CPPTypedef *> CPPScope::Typedefs
 

Definition at line 133 of file cppScope.h.

typedef set<CPPScope *> CPPScope::Using [protected]
 

Definition at line 147 of file cppScope.h.

typedef map<string, CPPInstance *> CPPScope::Variables
 

Definition at line 135 of file cppScope.h.


Constructor & Destructor Documentation

CPPScope::CPPScope CPPScope *  parent_scope,
const CPPNameComponent name,
CPPVisibility  starting_vis
 

Definition at line 45 of file cppScope.cxx.

References _fully_specified_known, _is_fully_specified, _is_fully_specified_recursive_protect, _struct_type, _subst_decl_recursive_protect, and NULL.

Referenced by instantiate(), and substitute_decl().

CPPScope::~CPPScope  )  [virtual]
 

Definition at line 64 of file cppScope.cxx.


Member Function Documentation

void CPPScope::add_declaration CPPDeclaration decl,
CPPScope *  global_scope,
CPPPreprocessor preprocessor,
const cppyyltype pos
[virtual]
 

Reimplemented in CPPTemplateScope.

Definition at line 128 of file cppScope.cxx.

References _current_vis, _declarations, CPPDeclaration::_leading_comment, CPPDeclaration::_vis, cppyyltype::file, cppyyltype::first_line, CPPPreprocessor::get_comment_before(), global_scope, handle_declaration(), and NULL.

Referenced by CPPTemplateScope::add_declaration().

void CPPScope::add_enum_value CPPInstance inst  )  [virtual]
 

Reimplemented in CPPTemplateScope.

Definition at line 152 of file cppScope.cxx.

References _current_vis, _enum_values, CPPDeclaration::_vis, and CPPInstance::get_simple_name().

Referenced by CPPEnumType::add_element(), and CPPTemplateScope::add_enum_value().

void CPPScope::add_using CPPUsing using_decl,
CPPScope *  global_scope,
CPPPreprocessor error_sink = NULL
[virtual]
 

Reimplemented in CPPTemplateScope.

Definition at line 244 of file cppScope.cxx.

References CPPUsing::_full_namespace, CPPUsing::_ident, _using, CPPIdentifier::find_scope(), CPPIdentifier::find_symbol(), CPPIdentifier::get_fully_scoped_name(), global_scope, handle_declaration(), NULL, and CPPPreprocessor::warning().

Referenced by CPPTemplateScope::add_using().

CPPTemplateScope * CPPScope::as_template_scope  )  [virtual]
 

Reimplemented in CPPTemplateScope.

Definition at line 833 of file cppScope.cxx.

References NULL.

Referenced by get_template_scope(), InterrogateBuilder::get_type(), instantiate(), and substitute_decl().

bool CPPScope::copy_substitute_decl CPPScope *  to_scope,
CPPDeclaration::SubstDecl subst,
CPPScope *  global_scope
const [private]
 

Definition at line 851 of file cppScope.cxx.

References _classes, _declarations, CPPStructType::_derivation, _enums, CPPDeclaration::_file, _functions, CPPExtensionType::_ident, CPPStructType::_incomplete, CPPFunctionGroup::_instances, CPPFunctionGroup::_name, _name, CPPIdentifier::_native_scope, _struct_type, _structs, _templates, CPPExtensionType::_type, _typedefs, _unions, _variables, CPPDeclaration::as_type(), assert, b, global_scope, NULL, and CPPDeclaration::substitute_decl().

Referenced by instantiate(), and substitute_decl().

void CPPScope::define_extension_type CPPExtensionType type  )  [virtual]
 

Reimplemented in CPPTemplateScope.

Definition at line 167 of file cppScope.cxx.

References _classes, _enums, _structs, _templates, _typedefs, _unions, CPPDeclaration::as_type(), assert, CPPDeclaration::get_subtype(), CPPType::is_incomplete(), CPPDeclaration::is_template(), NULL, CPPDeclaration::ST_extension, CPPExtensionType::T_class, CPPExtensionType::T_enum, CPPExtensionType::T_struct, CPPExtensionType::T_union, and type.

Referenced by CPPTemplateScope::define_extension_type(), and handle_declaration().

void CPPScope::define_namespace CPPNamespace scope  )  [virtual]
 

Reimplemented in CPPTemplateScope.

Definition at line 232 of file cppScope.cxx.

References _namespaces, and CPPNamespace::get_simple_name().

Referenced by CPPTemplateScope::define_namespace().

CPPScope * CPPScope::find_scope const string &  name,
CPPDeclaration::SubstDecl subst,
CPPScope *  global_scope,
bool  recurse = true
const
 

Definition at line 589 of file cppScope.cxx.

References CPPStructType::_scope, find_type(), global_scope, NULL, and type.

CPPScope * CPPScope::find_scope const string &  name,
bool  recurse = true
const
 

Definition at line 536 of file cppScope.cxx.

References CPPStructType::_derivation, _namespaces, _parent_scope, CPPStructType::_scope, _struct_type, _typedefs, _using, find_type(), NULL, and type.

Referenced by CPPIdentifier::find_scope(), and CPPIdentifier::get_scope().

CPPDeclaration * CPPScope::find_symbol const string &  name,
bool  recurse = true
const
 

Definition at line 608 of file cppScope.cxx.

References CPPStructType::_derivation, _enum_values, _functions, _parent_scope, CPPStructType::_scope, _struct_type, _typedefs, _using, _variables, get_simple_name(), and NULL.

Referenced by CPPIdentifier::find_symbol().

CPPDeclaration * CPPScope::find_template const string &  name,
bool  recurse = true
const
 

Definition at line 672 of file cppScope.cxx.

References CPPStructType::_derivation, _parent_scope, CPPStructType::_scope, _struct_type, _templates, _using, and NULL.

Referenced by CPPIdentifier::find_symbol(), CPPIdentifier::find_template(), and handle_declaration().

CPPType * CPPScope::find_type const string &  name,
CPPDeclaration::SubstDecl subst,
CPPScope *  global_scope,
bool  recurse = true
const
 

Definition at line 489 of file cppScope.cxx.

References CPPStructType::_derivation, _parent_scope, CPPStructType::_scope, _struct_type, _typedefs, _using, current_scope, find_type(), global_scope, NULL, substitute_decl(), and type.

CPPType * CPPScope::find_type const string &  name,
bool  recurse = true
const
 

Definition at line 446 of file cppScope.cxx.

References CPPStructType::_derivation, _parent_scope, CPPStructType::_scope, _struct_type, _typedefs, _using, NULL, and type.

Referenced by find_scope(), find_type(), and CPPIdentifier::find_type().

CPPVisibility CPPScope::get_current_vis  )  const
 

Definition at line 118 of file cppScope.cxx.

References _current_vis.

string CPPScope::get_fully_scoped_name  )  const [virtual]
 

Reimplemented in CPPTemplateScope.

Definition at line 751 of file cppScope.cxx.

References _name, _parent_scope, CPPNameComponent::get_name_with_templ(), and NULL.

Referenced by CPPTemplateScope::get_fully_scoped_name(), CPPIdentifier::get_scope(), and show_type_or_expression().

string CPPScope::get_local_name CPPScope *  scope = NULL  )  const [virtual]
 

Reimplemented in CPPTemplateScope.

Definition at line 730 of file cppScope.cxx.

References _name, _parent_scope, CPPNameComponent::get_name_with_templ(), and NULL.

Referenced by CPPInstance::check_for_constructor(), CPPTemplateScope::get_local_name(), CPPIdentifier::get_local_name(), InterrogateBuilder::get_type(), instantiate(), and CPPIdentifier::output_local_name().

CPPScope * CPPScope::get_parent_scope  )  const
 

Definition at line 98 of file cppScope.cxx.

References _parent_scope.

Referenced by InterrogateBuilder::get_type(), and CPPStructType::substitute_decl().

string CPPScope::get_simple_name  )  const [virtual]
 

Reimplemented in CPPTemplateScope.

Definition at line 715 of file cppScope.cxx.

References _name, and CPPNameComponent::get_name().

Referenced by find_symbol(), and CPPTemplateScope::get_simple_name().

CPPStructType * CPPScope::get_struct_type  )  const
 

Definition at line 88 of file cppScope.cxx.

References _struct_type.

Referenced by InterrogateBuilder::get_type(), CPPStructType::instantiate(), and InterrogateBuilder::scan_function().

CPPTemplateScope * CPPScope::get_template_scope  ) 
 

Definition at line 817 of file cppScope.cxx.

References _parent_scope, as_template_scope(), and NULL.

void CPPScope::handle_declaration CPPDeclaration decl,
CPPScope *  global_scope
[private]
 

Definition at line 1008 of file cppScope.cxx.

References _functions, CPPFunctionGroup::_instances, _templates, CPPInstance::_type, _typedefs, _variables, CPPDeclaration::as_extension_type(), CPPDeclaration::as_function_type(), CPPDeclaration::as_instance(), CPPDeclaration::as_type_declaration(), CPPDeclaration::as_typedef(), CPPInstance::check_for_constructor(), define_extension_type(), find_template(), CPPInstance::get_scope(), CPPInstance::get_simple_name(), global_scope, CPPDeclaration::is_template(), and NULL.

Referenced by add_declaration(), and add_using().

CPPScope * CPPScope::instantiate const CPPTemplateParameterList actual_params,
CPPScope *  current_scope,
CPPScope *  global_scope,
CPPPreprocessor error_sink = NULL
const
 

Definition at line 316 of file cppScope.cxx.

References CPPClassTemplateParameter::_ident, _instantiations, _name, CPPTemplateParameterList::_parameters, CPPTemplateScope::_parameters, _parent_scope, _typedefs, CPPDeclaration::as_class_template_parameter(), as_template_scope(), CPPTemplateParameterList::build_subst_decl(), copy_substitute_decl(), CPPScope(), current_scope, CPPIdentifier::get_local_name(), get_local_name(), global_scope, is_fully_specified(), NULL, CPPNameComponent::set_templ(), V_public, and CPPPreprocessor::warning().

Referenced by CPPIdentifier::get_scope(), and CPPStructType::instantiate().

bool CPPScope::is_fully_specified  )  const [virtual]
 

Reimplemented in CPPParser, and CPPTemplateScope.

Definition at line 277 of file cppScope.cxx.

References _declarations, _is_fully_specified, _parent_scope, and NULL.

Referenced by instantiate(), CPPStructType::is_fully_specified(), and substitute_decl().

void CPPScope::output ostream out,
CPPScope *  scope
const [virtual]
 

Reimplemented in CPPTemplateScope.

Definition at line 772 of file cppScope.cxx.

References _name, _parent_scope, and NULL.

Referenced by operator<<(), CPPTemplateScope::output(), and CPPIdentifier::output_fully_scoped_name().

void CPPScope::set_current_vis CPPVisibility  current_vis  ) 
 

Definition at line 108 of file cppScope.cxx.

References _current_vis.

void CPPScope::set_struct_type CPPStructType struct_type  ) 
 

Definition at line 77 of file cppScope.cxx.

References _struct_type.

Referenced by CPPStructType::substitute_decl().

CPPScope * CPPScope::substitute_decl CPPDeclaration::SubstDecl subst,
CPPScope *  current_scope,
CPPScope *  global_scope
const
 

Definition at line 395 of file cppScope.cxx.

References _name, CPPTemplateScope::_parameters, _parent_scope, _subst_decl_recursive_protect, as_template_scope(), copy_substitute_decl(), CPPScope(), current_scope, global_scope, is_fully_specified(), NULL, p, and V_public.

Referenced by find_type(), and CPPStructType::substitute_decl().

void CPPScope::write ostream out,
int  indent,
CPPScope *  scope
const
 

Definition at line 787 of file cppScope.cxx.

References _declarations, CPPDeclaration::_vis, CPPDeclaration::as_namespace(), CPPDeclaration::as_type(), CPPDeclaration::as_typedef(), CPPVisibility, indent(), NULL, CPPDeclaration::output(), and V_unknown.

Referenced by main(), CPPStructType::output(), and CPPNamespace::output().


Member Data Documentation

ExtensionTypes CPPScope::_classes
 

Definition at line 126 of file cppScope.h.

Referenced by copy_substitute_decl(), and define_extension_type().

CPPVisibility CPPScope::_current_vis [protected]
 

Definition at line 149 of file cppScope.h.

Referenced by add_declaration(), add_enum_value(), get_current_vis(), and set_current_vis().

Declarations CPPScope::_declarations
 

Definition at line 122 of file cppScope.h.

Referenced by add_declaration(), InterrogateBuilder::build(), copy_substitute_decl(), InterrogateBuilder::define_struct_type(), TypeManager::has_protected_destructor(), TypeManager::involves_unpublished(), is_fully_specified(), InterrogateBuilder::scan_struct_type(), and write().

Variables CPPScope::_enum_values
 

Definition at line 137 of file cppScope.h.

Referenced by add_enum_value(), and find_symbol().

ExtensionTypes CPPScope::_enums
 

Definition at line 128 of file cppScope.h.

Referenced by copy_substitute_decl(), and define_extension_type().

bool CPPScope::_fully_specified_known [private]
 

Definition at line 156 of file cppScope.h.

Referenced by CPPScope().

Functions CPPScope::_functions
 

Definition at line 139 of file cppScope.h.

Referenced by copy_substitute_decl(), find_symbol(), CPPStructType::get_destructor(), TypeManager::get_pointer_type(), CPPStructType::get_virtual_funcs(), handle_declaration(), and show_methods().

Instantiations CPPScope::_instantiations [private]
 

Definition at line 153 of file cppScope.h.

Referenced by instantiate().

bool CPPScope::_is_fully_specified [private]
 

Definition at line 155 of file cppScope.h.

Referenced by CPPScope(), and is_fully_specified().

bool CPPScope::_is_fully_specified_recursive_protect [private]
 

Definition at line 157 of file cppScope.h.

Referenced by CPPScope().

CPPNameComponent CPPScope::_name
 

Definition at line 142 of file cppScope.h.

Referenced by copy_substitute_decl(), get_fully_scoped_name(), get_local_name(), get_simple_name(), instantiate(), output(), CPPStructType::substitute_decl(), and substitute_decl().

Namespaces CPPScope::_namespaces
 

Definition at line 131 of file cppScope.h.

Referenced by define_namespace(), and find_scope().

CPPScope* CPPScope::_parent_scope [protected]
 

Definition at line 145 of file cppScope.h.

Referenced by CPPTemplateScope::add_declaration(), CPPTemplateScope::add_enum_value(), CPPTemplateScope::add_using(), CPPTemplateScope::define_extension_type(), CPPTemplateScope::define_namespace(), find_scope(), find_symbol(), find_template(), find_type(), CPPTemplateScope::get_fully_scoped_name(), get_fully_scoped_name(), CPPTemplateScope::get_local_name(), get_local_name(), get_parent_scope(), CPPTemplateScope::get_simple_name(), get_template_scope(), instantiate(), is_fully_specified(), output(), and substitute_decl().

CPPStructType* CPPScope::_struct_type [protected]
 

Definition at line 146 of file cppScope.h.

Referenced by copy_substitute_decl(), CPPScope(), find_scope(), find_symbol(), find_template(), find_type(), get_struct_type(), and set_struct_type().

ExtensionTypes CPPScope::_structs
 

Definition at line 125 of file cppScope.h.

Referenced by copy_substitute_decl(), and define_extension_type().

bool CPPScope::_subst_decl_recursive_protect [private]
 

Definition at line 158 of file cppScope.h.

Referenced by CPPScope(), and substitute_decl().

Templates CPPScope::_templates
 

Definition at line 141 of file cppScope.h.

Referenced by copy_substitute_decl(), define_extension_type(), find_template(), and handle_declaration().

Typedefs CPPScope::_typedefs
 

Definition at line 134 of file cppScope.h.

Referenced by CPPTemplateScope::add_template_parameter(), copy_substitute_decl(), define_extension_type(), find_scope(), find_symbol(), find_type(), handle_declaration(), instantiate(), and show_typedefs().

ExtensionTypes CPPScope::_unions
 

Definition at line 127 of file cppScope.h.

Referenced by copy_substitute_decl(), and define_extension_type().

Using CPPScope::_using [protected]
 

Definition at line 148 of file cppScope.h.

Referenced by add_using(), find_scope(), find_symbol(), find_template(), and find_type().

Variables CPPScope::_variables
 

Definition at line 136 of file cppScope.h.

Referenced by CPPTemplateScope::add_template_parameter(), copy_substitute_decl(), find_symbol(), handle_declaration(), and show_data_members().


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 01:34:52 2003 for DTool by doxygen1.3