User Guide
nmodl::symtab::SymbolTable::Table Class Reference

Helper class for implementing symbol table. More...

Detailed Description

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.

Todo:
Re-implement pretty printing

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< Symbollookup (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...
 

Member Function Documentation

◆ insert()

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.

◆ lookup()

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.

◆ print()

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.

Member Data Documentation

◆ counter

int nmodl::symtab::SymbolTable::Table::counter = 0
staticprivate

number of tables

Definition at line 70 of file symbol_table.hpp.

◆ symbols

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.


The documentation for this class was generated from the following files: