20 if(!
symbols.insert(std::pair<irep_idt, symbolt>(symbol.
name, symbol)).second)
24 std::pair<irep_idt, irep_idt>(symbol.
base_name, symbol.
name));
26 std::pair<irep_idt, irep_idt>(symbol.
module, symbol.
name));
50 std::pair<symbolst::iterator, bool> result=
51 symbols.insert(std::pair<irep_idt, symbolt>(symbol.
name, tmp));
55 new_symbol=&result.first->second;
60 std::pair<irep_idt, irep_idt>(symbol.
base_name, symbol.
name));
62 std::pair<irep_idt, irep_idt>(symbol.
module, symbol.
name));
64 result.first->second.swap(symbol);
65 new_symbol=&result.first->second;
75 symbolst::iterator entry=
symbols.find(name);
80 for(symbol_base_mapt::iterator
91 for(symbol_module_mapt::iterator
111 out <<
"\n" <<
"Symbols:" <<
"\n";
123 symbolst::const_iterator it=
symbols.find(identifier);
126 throw "symbol "+
id2string(identifier)+
" not found";
137 symbolst::iterator it=
symbols.find(identifier);
140 throw "symbol "+
id2string(identifier)+
" not found";
150 symbol_table.
show(out);
irep_idt name
The unique identifier.
symbolt & lookup(const irep_idt &identifier)
Find a symbol in the symbol table.
const std::string & id2string(const irep_idt &d)
#define forall_symbols(it, expr)
std::ostream & operator<<(std::ostream &out, const symbol_tablet &symbol_table)
Print the contents of the symbol table.
irep_idt module
Name of module the symbol belongs to.
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
bool remove(const irep_idt &name)
Remove a symbol from the symbol table.
symbol_module_mapt symbol_module_map
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.
void show(std::ostream &out) const
Print the contents of the symbol table.
irep_idt base_name
Base (non-scoped) name.