The symbol table base class interface.
More...
#include <symbol_table_base.h>
The symbol table base class interface.
Definition at line 21 of file symbol_table_base.h.
◆ symbolst
◆ symbol_table_baset() [1/2]
◆ symbol_table_baset() [2/2]
◆ ~symbol_table_baset()
symbol_table_baset::~symbol_table_baset |
( |
| ) |
|
|
virtual |
◆ add()
bool symbol_table_baset::add |
( |
const symbolt & |
symbol | ) |
|
Add a new symbol to the symbol table.
- Parameters
-
symbol | The symbol to be added to the symbol table |
- Returns
- Returns true if the process failed, which should only happen if there is a symbol with the same name already in the symbol table.
Definition at line 18 of file symbol_table_base.cpp.
◆ begin()
virtual iteratort symbol_table_baset::begin |
( |
| ) |
|
|
pure virtual |
◆ clear()
virtual void symbol_table_baset::clear |
( |
| ) |
|
|
pure virtual |
◆ end()
virtual iteratort symbol_table_baset::end |
( |
| ) |
|
|
pure virtual |
◆ erase()
virtual void symbol_table_baset::erase |
( |
const symbolst::const_iterator & |
entry | ) |
|
|
pure virtual |
◆ get_symbol_table()
virtual const symbol_tablet& symbol_table_baset::get_symbol_table |
( |
| ) |
const |
|
pure virtual |
◆ get_writeable()
virtual symbolt* symbol_table_baset::get_writeable |
( |
const irep_idt & |
name | ) |
|
|
pure virtual |
◆ get_writeable_ref()
Find a symbol in the symbol table for read-write access.
- Parameters
-
name | The name of the symbol to look for. |
- Returns
- A reference to the symbol.
- Exceptions
-
<tt>std::out_of_range</tt> | if no such symbol exists |
Definition at line 110 of file symbol_table_base.h.
◆ has_symbol()
bool symbol_table_baset::has_symbol |
( |
const irep_idt & |
name | ) |
const |
|
inline |
Check whether a symbol exists in the symbol table.
- Parameters
-
name | The name of the symbol to look for |
- Returns
- True if the symbol exists
Definition at line 78 of file symbol_table_base.h.
◆ insert()
virtual std::pair<symbolt &, bool> symbol_table_baset::insert |
( |
symbolt |
symbol | ) |
|
|
pure virtual |
Move or copy a new symbol to the symbol table.
- Parameters
-
symbol | The symbol to be added to the symbol table - can be moved or copied in. |
- Returns
- : Returns a reference to the newly inserted symbol or to the existing symbol if a symbol with the same name already exists in the symbol table, along with a bool that is true if a new symbol was inserted.
Implemented in journalling_symbol_tablet, symbol_tablet, and symbol_table_buildert.
◆ lookup()
Find a symbol in the symbol table for read-only access.
- Parameters
-
name | The name of the symbol to look for |
- Returns
- A pointer to the found symbol if it exists, nullptr otherwise.
Definition at line 86 of file symbol_table_base.h.
◆ lookup_ref()
const symbolt& symbol_table_baset::lookup_ref |
( |
const irep_idt & |
name | ) |
const |
|
inline |
Find a symbol in the symbol table for read-only access.
- Parameters
-
name | The name of the symbol to look for |
- Returns
- A reference to the symbol
- Exceptions
-
<tt>std::out_of_range</tt> | if no such symbol exists |
Definition at line 96 of file symbol_table_base.h.
◆ move()
virtual bool symbol_table_baset::move |
( |
symbolt & |
symbol, |
|
|
symbolt *& |
new_symbol |
|
) |
| |
|
pure virtual |
◆ next_unused_suffix() [1/2]
std::size_t symbol_table_baset::next_unused_suffix |
( |
const std::string & |
prefix, |
|
|
std::size_t |
start_number |
|
) |
| const |
|
inline |
Find smallest unused integer i so that prefix + std::to_string(i) does not exist in the list symbols
.
- Parameters
-
prefix | A string denoting the prefix we want to find the smallest suffix of. |
start_number | The starting suffix number to search from. |
- Returns
- The small unused suffix size.
Definition at line 54 of file symbol_table_base.h.
◆ next_unused_suffix() [2/2]
virtual std::size_t symbol_table_baset::next_unused_suffix |
( |
const std::string & |
prefix | ) |
const |
|
inlinevirtual |
◆ operator const symbol_tablet &()
◆ operator=()
◆ remove()
bool symbol_table_baset::remove |
( |
const irep_idt & |
name | ) |
|
Remove a symbol from the symbol table.
- Parameters
-
name | The name of the symbol to remove |
- Returns
- Returns a boolean indicating whether the process failed i.e. false if the symbol was removed, or true if it didn't exist.
Definition at line 27 of file symbol_table_base.cpp.
◆ show()
void symbol_table_baset::show |
( |
std::ostream & |
out | ) |
const |
Print the contents of the symbol table.
- Parameters
-
out | The ostream to direct output to. |
Definition at line 38 of file symbol_table_base.cpp.
◆ symbol_base_map
◆ symbol_module_map
◆ symbols
const symbolst& symbol_table_baset::symbols |
The documentation for this class was generated from the following files: