![]() |
User Guide
|
Helper class for implementing symbol table. More...
Helper class for implementing symbol table.
Table is used to store information about every block construct encountered in the nmodl file. Each symbol has name but for fast lookup, we create map with the associated name.
Definition at line 68 of file symbol_table.hpp.
Public Member Functions | |
void | insert (const std::shared_ptr< Symbol > &symbol) |
insert new symbol into table More... | |
std::shared_ptr< Symbol > | lookup (const std::string &name) const |
check if symbol with given name exist More... | |
void | print (std::ostream &stream, std::string title, int indent) const |
pretty print More... | |
Public Attributes | |
std::vector< std::shared_ptr< Symbol > > | symbols |
map of symbol name and associated symbol for faster lookup More... | |
Static Private Attributes | |
static int | counter = 0 |
number of tables More... | |
void nmodl::symtab::SymbolTable::Table::insert | ( | const std::shared_ptr< Symbol > & | symbol | ) |
insert new symbol into table
Insert symbol into current symbol table.
There are certain cases where we were getting re-insertion errors.
Definition at line 30 of file symbol_table.cpp.
std::shared_ptr< Symbol > nmodl::symtab::SymbolTable::Table::lookup | ( | const std::string & | name | ) | const |
check if symbol with given name exist
Definition at line 40 of file symbol_table.cpp.
void nmodl::symtab::SymbolTable::Table::print | ( | std::ostream & | stream, |
std::string | title, | ||
int | indent | ||
) | const |
pretty print
Definition at line 453 of file symbol_table.cpp.
|
staticprivate |
number of tables
Definition at line 70 of file symbol_table.hpp.
std::vector<std::shared_ptr<Symbol> > nmodl::symtab::SymbolTable::Table::symbols |
map of symbol name and associated symbol for faster lookup
Definition at line 74 of file symbol_table.hpp.