10 #ifndef CPROVER_UTIL_SYMBOL_TABLE_H 11 #define CPROVER_UTIL_SYMBOL_TABLE_H 24 #include <unordered_map> 28 #define forall_symbols(it, expr) \ 29 for(symbol_tablet::symbolst::const_iterator it=(expr).begin(); \ 30 it!=(expr).end(); ++it) 32 #define Forall_symbols(it, expr) \ 33 for(symbol_tablet::symbolst::iterator it=(expr).begin(); \ 34 it!=(expr).end(); ++it) 39 #define forall_symbol_base_map(it, expr, base_name) \ 40 for(symbol_base_mapt::const_iterator it=(expr).lower_bound(base_name), \ 41 it_end=(expr).upper_bound(base_name); \ 44 #define forall_symbol_module_map(it, expr, module) \ 45 for(symbol_module_mapt::const_iterator it=(expr).lower_bound(module), \ 46 it_end=(expr).upper_bound(module); \ 55 typedef std::unordered_map<irep_idt, symbolt, irep_id_hash>
symbolst;
67 {
symbolt *new_symbol;
return move(symbol, new_symbol); }
78 void show(std::ostream &out)
const;
100 #endif // CPROVER_UTIL_SYMBOL_TABLE_H
symbolt & lookup(const irep_idt &identifier)
Find a symbol in the symbol table.
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
symbol_base_mapt symbol_base_map
symbol_module_mapt symbol_module_map
std::multimap< irep_idt, irep_idt > symbol_base_mapt
std::unordered_map< irep_idt, symbolt, irep_id_hash > symbolst
bool add(const symbolt &symbol)
Add a new symbol to the symbol table.
bool move(symbolt &symbol, symbolt *&new_symbol)
Move a symbol into the symbol table.
bool move(symbolt &symbol)
void show(std::ostream &out) const
Print the contents of the symbol table.
std::ostream & operator<<(std::ostream &out, const symbol_tablet &symbol_table)
Print the contents of the symbol table.
bool has_symbol(const irep_idt &name) const
void swap(symbol_tablet &other)
std::multimap< irep_idt, irep_idt > symbol_module_mapt