CBMC
|
A multi namespace is essentially a namespace, with a list of namespaces. More...
#include <namespace.h>
Public Member Functions | |
multi_namespacet () | |
multi_namespacet (const symbol_table_baset &symbol_table) | |
bool | lookup (const irep_idt &name, const symbolt *&symbol) const override |
See documentation for namespace_baset::lookup(). | |
std::size_t | smallest_unused_suffix (const std::string &prefix) const override |
See documentation for namespace_baset::smallest_unused_suffix(). | |
void | add (const symbol_table_baset &symbol_table) |
Add symbol table to the list of symbol tables this multi-namespace is working with. | |
const symbolt & | lookup (const irep_idt &name) const |
Lookup a symbol in the namespace. | |
const symbolt & | lookup (const symbol_exprt &) const |
Generic lookup function for a symbol expression in a symbol table. | |
const symbolt & | lookup (const tag_typet &) const |
Generic lookup function for a tag type in a symbol table. | |
virtual bool | lookup (const irep_idt &name, const symbolt *&symbol) const=0 |
Searches for a symbol named name . | |
![]() | |
namespacet (const symbol_table_baset &_symbol_table) | |
namespacet (const symbol_table_baset &_symbol_table1, const symbol_table_baset &_symbol_table2) | |
namespacet (const symbol_table_baset *_symbol_table1, const symbol_table_baset *_symbol_table2) | |
bool | lookup (const irep_idt &name, const symbolt *&symbol) const override |
See documentation for namespace_baset::lookup(). | |
std::size_t | smallest_unused_suffix (const std::string &prefix) const override |
See documentation for namespace_baset::smallest_unused_suffix(). | |
const symbol_table_baset & | get_symbol_table () const |
Return first symbol table registered with the namespace. | |
const symbolt & | lookup (const irep_idt &name) const |
Lookup a symbol in the namespace. | |
const symbolt & | lookup (const symbol_exprt &) const |
Generic lookup function for a symbol expression in a symbol table. | |
const symbolt & | lookup (const tag_typet &) const |
Generic lookup function for a tag type in a symbol table. | |
virtual bool | lookup (const irep_idt &name, const symbolt *&symbol) const=0 |
Searches for a symbol named name . | |
![]() | |
const symbolt & | lookup (const irep_idt &name) const |
Lookup a symbol in the namespace. | |
const symbolt & | lookup (const symbol_exprt &) const |
Generic lookup function for a symbol expression in a symbol table. | |
const symbolt & | lookup (const tag_typet &) const |
Generic lookup function for a tag type in a symbol table. | |
virtual | ~namespace_baset () |
void | follow_macros (exprt &) const |
Follow macros to their values in a given expression. | |
const union_typet & | follow_tag (const union_tag_typet &) const |
Follow type tag of union type. | |
const struct_typet & | follow_tag (const struct_tag_typet &) const |
Follow type tag of struct type. | |
const c_enum_typet & | follow_tag (const c_enum_tag_typet &) const |
Follow type tag of enum type. | |
const struct_union_typet & | follow_tag (const struct_or_union_tag_typet &) const |
Resolve a struct_tag_typet or union_tag_typet to the complete version. | |
Protected Types | |
typedef std::vector< const symbol_table_baset * > | symbol_table_listt |
Protected Attributes | |
symbol_table_listt | symbol_table_list |
![]() | |
const symbol_table_baset * | symbol_table1 |
const symbol_table_baset * | symbol_table2 |
A multi namespace is essentially a namespace, with a list of namespaces.
It's difference with namespacet is that it can use more than two symbol tables to lookup symbols in.
Definition at line 136 of file namespace.h.
|
protected |
Definition at line 168 of file namespace.h.
|
inline |
Definition at line 140 of file namespace.h.
|
inlineexplicit |
Definition at line 144 of file namespace.h.
|
inline |
Add symbol table to the list of symbol tables this multi-namespace is working with.
symbol_table | Reference to the symbol table to be added to this namespace. |
Definition at line 162 of file namespace.h.
Lookup a symbol in the namespace.
name | The name of the symbol to lookup. |
Definition at line 45 of file namespace.h.
|
overridevirtual |
See documentation for namespace_baset::lookup().
Iterate through the symbol tables in the multi-namespace and lookup the symbol.
name | The name of the symbol to be looked up. |
symbol | The const pointer to the reference of the symbol if it's found during lookup. |
Implements namespace_baset.
Definition at line 185 of file namespace.cpp.
|
virtual |
Searches for a symbol named name
.
Iff found, set symbol
to point to the symbol and return false; else symbol
is unmodified and true
is returned. With multiple symbol tables, symbol_table1
is searched first and then symbol_table2.
Implements namespace_baset.
const symbolt & namespace_baset::lookup | ( | const symbol_exprt & | expr | ) | const |
Generic lookup function for a symbol expression in a symbol table.
expr | The symbol expression to lookup. |
Definition at line 57 of file namespace.cpp.
Generic lookup function for a tag type in a symbol table.
type | The tag type to lookup. |
Definition at line 58 of file namespace.cpp.
|
overridevirtual |
See documentation for namespace_baset::smallest_unused_suffix().
Find smallest unused suffix in the all the symbol tables.
prefix | The prefix to find smallest unused suffix of. |
Implements namespace_baset.
Definition at line 169 of file namespace.cpp.
|
protected |
Definition at line 169 of file namespace.h.