Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

SymbolTable Class Reference

#include <symtab.h>

List of all members.

Classes

class  Entry

Public Types

enum  symb_type {
  ST_NONE, ST_PARAM, ST_VAR, ST_CONS,
  ST_OBJ, ST_SET
}

Public Member Functions

 SymbolTable ()
void copy (const SymbolTable &src)
bool defineSymbol (symb_type, char *id, ModelComp *mc)
const EntryfindSymbol (const std::string &id) const
std::list< EntrygetListByType (const symb_type type) const

Private Member Functions

unsigned long hash_function (const char *str) const

Private Attributes

std::list< Entrytable_ [n_hash]

Static Private Attributes

static const int n_hash = 100
 Number of available hash codes.
static const bool logSymtab = false

Member Enumeration Documentation

Enumerator:
ST_NONE 
ST_PARAM 
ST_VAR 
ST_CONS 
ST_OBJ 
ST_SET 

Constructor & Destructor Documentation

SymbolTable::SymbolTable (  )  [inline]

Member Function Documentation

void SymbolTable::copy ( const SymbolTable src  )  [inline]

References n_hash, and table_.

Referenced by StochModel::expandToFlatModel().

bool SymbolTable::defineSymbol ( symb_type  type,
char *  id,
ModelComp mc 
)

References hash_function(), logSymtab, n_hash, and table_.

Referenced by yyparse().

const SymbolTable::Entry * SymbolTable::findSymbol ( const std::string &  id  )  const

References hash_function(), n_hash, and table_.

Referenced by AmplModel::findComponent(), and yyparse().

list< SymbolTable::Entry > SymbolTable::getListByType ( const symb_type  type  )  const

References n_hash, and table_.

Referenced by AmplModel::getObjList().

unsigned long SymbolTable::hash_function ( const char *  str  )  const [private]

Referenced by defineSymbol(), and findSymbol().


Member Data Documentation

const bool SymbolTable::logSymtab = false [static, private]

Referenced by defineSymbol().

const int SymbolTable::n_hash = 100 [static, private]

Number of available hash codes.

Referenced by copy(), defineSymbol(), findSymbol(), and getListByType().

std::list<Entry> SymbolTable::table_[n_hash] [private]

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