cprover
|
#include <cpp_scope.h>
Public Types | |
enum | lookup_kindt { SCOPE_ONLY, QUALIFIED, RECURSIVE } |
typedef std::set< cpp_idt * > | id_sett |
![]() | |
enum | id_classt { id_classt::UNKNOWN, id_classt::SYMBOL, id_classt::TYPEDEF, id_classt::CLASS, id_classt::ENUM, id_classt::TEMPLATE, id_classt::TEMPLATE_PARAMETER, id_classt::NAMESPACE, id_classt::BLOCK_SCOPE, id_classt::TEMPLATE_SCOPE, id_classt::ROOT_SCOPE } |
Public Member Functions | |
cpp_scopet () | |
void | lookup (const irep_idt &base_name, lookup_kindt kind, id_sett &id_set) |
void | lookup (const irep_idt &base_name, lookup_kindt kind, cpp_idt::id_classt id_class, id_sett &id_set) |
void | lookup_identifier (const irep_idt &identifier, cpp_idt::id_classt id_class, id_sett &id_set) |
cpp_idt & | insert (const irep_idt &_base_name) |
cpp_idt & | insert (const cpp_idt &cpp_id) |
bool | contains (const irep_idt &base_name) |
bool | is_root_scope () const |
bool | is_global_scope () const |
bool | is_template_scope () const |
cpp_scopet & | get_parent () const |
cpp_scopet & | get_global_scope () |
void | add_secondary_scope (cpp_scopet &other) |
void | add_using_scope (cpp_scopet &other) |
class cpp_scopet & | new_scope (const irep_idt &new_scope_name) |
![]() | |
cpp_idt () | |
bool | is_class () const |
bool | is_enum () const |
bool | is_namespace () const |
bool | is_typedef () const |
cpp_idt & | get_parent () const |
void | set_parent (cpp_idt &_parent) |
void | clear () |
void | print (std::ostream &out, unsigned indent=0) const |
void | print_fields (std::ostream &out, unsigned indent=0) const |
Additional Inherited Members | |
![]() | |
bool | is_member |
bool | is_method |
bool | is_static_member |
bool | is_scope |
bool | is_constructor |
id_classt | id_class |
irep_idt | identifier |
irep_idt | base_name |
irep_idt | class_identifier |
exprt | this_expr |
std::string | prefix |
std::string | suffix |
unsigned | compound_counter |
![]() | |
typedef std::multimap< irep_idt, cpp_idt > | cpp_id_mapt |
typedef std::vector< cpp_idt * > | scope_listt |
![]() | |
cpp_id_mapt | sub |
scope_listt | using_scopes |
scope_listt | secondary_scopes |
cpp_idt * | parent |
Definition at line 20 of file cpp_scope.h.
typedef std::set<cpp_idt *> cpp_scopet::id_sett |
Definition at line 28 of file cpp_scope.h.
Enumerator | |
---|---|
SCOPE_ONLY | |
QUALIFIED | |
RECURSIVE |
Definition at line 30 of file cpp_scope.h.
|
inline |
Definition at line 23 of file cpp_scope.h.
References cpp_idt::is_scope.
|
inline |
Definition at line 104 of file cpp_scope.h.
References cpp_idt::is_scope, and cpp_idt::secondary_scopes.
Referenced by cpp_typecheckt::typecheck_compound_bases().
|
inline |
Definition at line 110 of file cpp_scope.h.
References cpp_idt::is_scope, and cpp_idt::using_scopes.
Referenced by cpp_typecheckt::convert(), and cpp_typecheckt::instantiate_template().
bool cpp_scopet::contains | ( | const irep_idt & | base_name | ) |
Definition at line 212 of file cpp_scope.cpp.
References cpp_idt::base_name, id_set, lookup(), and SCOPE_ONLY.
Referenced by cpp_typecheckt::add_anonymous_members_to_scope(), and cpp_typecheckt::convert_anonymous_union().
|
inline |
Definition at line 94 of file cpp_scope.h.
References get_parent(), and is_global_scope().
Referenced by cpp_scopest::get_global_scope().
|
inline |
Definition at line 89 of file cpp_scope.h.
References cpp_idt::get_parent().
Referenced by cpp_typecheckt::check_component_access(), cpp_typecheck_resolvet::filter_for_named_scopes(), get_global_scope(), cpp_typecheckt::instantiate_template(), lookup(), lookup_identifier(), cpp_scopest::print_current(), cpp_typecheckt::typecheck_member_function(), and cpp_typecheckt::typecheck_template_parameters().
Definition at line 48 of file cpp_scope.h.
References cpp_idt::cpp_idt(), and cpp_idt::sub.
Referenced by cpp_typecheckt::add_anonymous_members_to_scope(), cpp_typecheckt::convert(), cpp_typecheckt::convert_anonymous_union(), new_scope(), cpp_typecheckt::put_compound_into_scope(), cpp_scopest::put_into_scope(), cpp_typecheck_resolvet::resolve(), and cpp_typecheckt::typecheck_template_parameters().
Definition at line 60 of file cpp_scope.h.
References cpp_idt::base_name, and cpp_idt::sub.
|
inline |
Definition at line 78 of file cpp_scope.h.
References cpp_idt::id_class, cpp_idt::NAMESPACE, and cpp_idt::ROOT_SCOPE.
Referenced by cpp_declarator_convertert::convert(), cpp_declarator_convertert::convert_new_symbol(), and get_global_scope().
|
inline |
Definition at line 73 of file cpp_scope.h.
References cpp_idt::id_class, and cpp_idt::ROOT_SCOPE.
Referenced by cpp_typecheckt::check_component_access(), lookup(), cpp_scopest::print_current(), and cpp_typecheck_resolvet::resolve().
|
inline |
Definition at line 84 of file cpp_scope.h.
References cpp_idt::id_class, and cpp_idt::TEMPLATE_SCOPE.
Referenced by cpp_typecheckt::typecheck_member_function().
void cpp_scopet::lookup | ( | const irep_idt & | base_name, |
lookup_kindt | kind, | ||
id_sett & | id_set | ||
) |
Definition at line 29 of file cpp_scope.cpp.
References cpp_idt::base_name, get_parent(), id_set, is_root_scope(), lookup(), QUALIFIED, SCOPE_ONLY, cpp_idt::secondary_scopes, cpp_idt::sub, and cpp_idt::using_scopes.
Referenced by contains(), cpp_typecheckt::convert(), cpp_typecheckt::convert_class_template_specialization(), cpp_declarator_convertert::convert_new_symbol(), cpp_typecheckt::convert_template_function_or_member_specialization(), cpp_typecheck_resolvet::guess_template_args(), cpp_typecheckt::instantiate_template(), lookup(), cpp_typecheckt::put_compound_into_scope(), cpp_typecheck_resolvet::resolve(), cpp_typecheck_resolvet::resolve_namespace(), cpp_typecheck_resolvet::resolve_scope(), cpp_typecheck_resolvet::resolve_with_arguments(), cpp_typecheckt::tag_scope(), cpp_typecheckt::typecheck_class_template(), and cpp_typecheckt::typecheck_class_template_member().
void cpp_scopet::lookup | ( | const irep_idt & | base_name, |
lookup_kindt | kind, | ||
cpp_idt::id_classt | id_class, | ||
id_sett & | id_set | ||
) |
Definition at line 92 of file cpp_scope.cpp.
References cpp_idt::base_name, get_parent(), cpp_idt::id_class, id_set, cpp_idt::identifier, is_root_scope(), lookup(), QUALIFIED, SCOPE_ONLY, cpp_idt::secondary_scopes, cpp_idt::sub, cpp_idt::TEMPLATE, and cpp_idt::using_scopes.
void cpp_scopet::lookup_identifier | ( | const irep_idt & | identifier, |
cpp_idt::id_classt | id_class, | ||
id_sett & | id_set | ||
) |
Definition at line 172 of file cpp_scope.cpp.
References get_parent(), cpp_idt::id_class, id_set, cpp_idt::identifier, cpp_idt::parent, and cpp_idt::sub.
Referenced by cpp_declarator_convertert::convert().
cpp_scopet & cpp_scopet::new_scope | ( | const irep_idt & | new_scope_name | ) |
Definition at line 200 of file cpp_scope.cpp.
References cpp_idt::class_identifier, id2string(), insert(), cpp_idt::prefix, and cpp_idt::this_expr.
Referenced by cpp_typecheckt::instantiate_template(), cpp_scopest::new_scope(), and cpp_typecheckt::typecheck_template_parameters().