CBMC
|
Author: Diffblue Ltd. More...
#include <symbol_table_builder.h>
Public Member Functions | |
symbol_table_buildert (symbol_table_baset &base_symbol_table) | |
symbol_table_buildert (symbol_table_buildert &&other) | |
symbol_table_buildert (const symbol_table_buildert &)=delete | |
symbol_table_buildert & | operator= (const symbol_table_buildert &)=delete |
symbol_table_buildert & | operator= (symbol_table_buildert &&)=delete |
const symbol_tablet & | get_symbol_table () const override |
void | erase (const symbolst::const_iterator &entry) override |
Remove a symbol from the symbol table. More... | |
void | clear () override |
bool | move (symbolt &symbol, symbolt *&new_symbol) override |
symbolt * | get_writeable (const irep_idt &identifier) override |
Find a symbol in the symbol table for read-write access. More... | |
std::pair< symbolt &, bool > | insert (symbolt symbol) override |
Move or copy a new symbol to the symbol table. More... | |
iteratort | begin () override |
iteratort | end () override |
void | validate (const validation_modet vm=validation_modet::INVARIANT) const override |
std::size_t | next_unused_suffix (const std::string &prefix) const override |
Try to find the next free identity for the passed-in prefix in this symbol table. More... | |
virtual iteratort | begin ()=0 |
virtual const_iteratort | begin () const |
virtual iteratort | end ()=0 |
virtual const_iteratort | end () const |
Public Member Functions inherited from symbol_table_baset | |
symbol_table_baset (const symbolst &symbols, const symbol_base_mapt &symbol_base_map, const symbol_module_mapt &symbol_module_map) | |
symbol_table_baset (const symbol_table_baset &other)=delete | |
symbol_table_baset & | operator= (const symbol_table_baset &other)=delete |
virtual | ~symbol_table_baset () |
Author: Diffblue Ltd. More... | |
std::size_t | next_unused_suffix (const std::string &prefix, std::size_t start_number) const |
Find smallest unused integer i so that prefix + std::to_string(i) does not exist in the list symbols . More... | |
operator const symbol_tablet & () const | |
Permits implicit cast to const symbol_tablet &. More... | |
bool | has_symbol (const irep_idt &name) const |
Check whether a symbol exists in the symbol table. More... | |
const symbolt * | lookup (const irep_idt &name) const |
Find a symbol in the symbol table for read-only access. More... | |
const symbolt & | lookup_ref (const irep_idt &name) const |
Find a symbol in the symbol table for read-only access. More... | |
std::list< symbolst::const_iterator > | match_name_or_base_name (const irep_idt &id) const |
Collect all symbols the name of which matches id or the base name of which matches id . More... | |
symbolt & | get_writeable_ref (const irep_idt &name) |
Find a symbol in the symbol table for read-write access. More... | |
bool | add (const symbolt &symbol) |
Add a new symbol to the symbol table. More... | |
bool | remove (const irep_idt &name) |
Remove a symbol from the symbol table. More... | |
void | show (std::ostream &out) const |
Print the contents of the symbol table. More... | |
std::vector< irep_idt > | sorted_symbol_names () const |
Build and return a lexicographically sorted vector of symbol names from all symbols stored in this symbol table. More... | |
virtual const_iteratort | begin () const |
virtual const_iteratort | end () const |
Static Public Member Functions | |
static symbol_table_buildert | wrap (symbol_table_baset &base_symbol_table) |
Private Attributes | |
symbol_table_baset & | base_symbol_table |
std::map< std::string, std::size_t > | next_free_suffix_for_prefix |
Additional Inherited Members | |
Public Types inherited from symbol_table_baset | |
typedef std::unordered_map< irep_idt, symbolt > | symbolst |
using | const_iteratort = symbolst::const_iterator |
Public Attributes inherited from symbol_table_baset | |
const symbolst & | symbols |
Read-only field, used to look up symbols given their names. More... | |
const symbol_base_mapt & | symbol_base_map |
Read-only field, used to look up symbol names given their base names. More... | |
const symbol_module_mapt & | symbol_module_map |
Read-only field, used to look up symbol names given their modules. More... | |
Author: Diffblue Ltd.
Wrapper around a symbol table that keeps track of suffixes for faster calculation of the smallest unused suffix.
Definition at line 13 of file symbol_table_builder.h.
|
inlineexplicit |
Definition at line 20 of file symbol_table_builder.h.
|
inline |
Definition at line 29 of file symbol_table_builder.h.
|
delete |
|
virtual |
Implements symbol_table_baset.
Definition at line 273 of file symbol_table_base.cpp.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 78 of file symbol_table_builder.h.
|
virtual |
Implements symbol_table_baset.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 57 of file symbol_table_builder.h.
|
virtual |
Implements symbol_table_baset.
Definition at line 274 of file symbol_table_base.cpp.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 83 of file symbol_table_builder.h.
|
virtual |
Implements symbol_table_baset.
|
inlineoverridevirtual |
Remove a symbol from the symbol table.
entry | an iterator pointing at the symbol to remove |
Implements symbol_table_baset.
Definition at line 52 of file symbol_table_builder.h.
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 47 of file symbol_table_builder.h.
Find a symbol in the symbol table for read-write access.
name | The name of the symbol to look for |
Implements symbol_table_baset.
Definition at line 68 of file symbol_table_builder.h.
Move or copy a new symbol to the symbol table.
symbol | The symbol to be added to the symbol table - can be moved or copied in. |
Implements symbol_table_baset.
Definition at line 73 of file symbol_table_builder.h.
Implements symbol_table_baset.
Definition at line 63 of file symbol_table_builder.h.
|
inlineoverridevirtual |
Try to find the next free identity for the passed-in prefix in this symbol table.
Due to this requirement we don't do anything fancy in regards to attempting to find the absolute earliest free suffix if one has been deleted, only the next free increment from our last stored value.
Reimplemented from symbol_table_baset.
Definition at line 107 of file symbol_table_builder.h.
|
delete |
|
delete |
|
inlineoverridevirtual |
Implements symbol_table_baset.
Definition at line 91 of file symbol_table_builder.h.
|
inlinestatic |
Definition at line 42 of file symbol_table_builder.h.
|
private |
Definition at line 16 of file symbol_table_builder.h.
|
mutableprivate |
Definition at line 17 of file symbol_table_builder.h.