In file symboltable.hpp:

template<class T> class SymbolTable

A symbol table.

Documentation

A symbol table.

The symboltable provides a mapping from string identifiers to the generic type T. The strings are copied.


Inheritance:


Public Methods

[more]inline SymbolTable()
Creates a symboltable
[more]inline int Size() const
number of identifiers
[more]T& operator[] (const char* name)
Returns reference to element.
[more]T& operator[] (const string & name)
Returns reference to element.
[more]const T& operator[] (const char* name) const
Returns element, error if not used
[more]T& operator[] (int i)
Returns reference to i-th element
[more]const T& operator[] (int i) const
Returns const reference to i-th element
[more]inline const char* GetName(int i) const
Returns name of i-th element
[more]inline void Set(const char* name, const T & el)
Associates el to the string name, overrides if name is used
[more]inline bool Used(const char* name) const
Checks whether name is used
[more]inline void DeleteAll()
Deletes symboltable

Private Fields

[more]ARRAY<T> data
the data

Private Methods

[more]SymbolTable<T> & operator= (SymbolTable<T> &)
prohibits copiing


Inherited from BaseSymbolTable:

Public Methods

ovoid DelNames()
ovoid AppendName(const char* name)
oint Index(const char* name) const
oint CheckIndex(const char* name) const

Protected Fields

oARRAY<char*> names

oARRAY<T> data
the data

oinline SymbolTable()
Creates a symboltable

oinline int Size() const
number of identifiers

oT& operator[] (const char* name)
Returns reference to element. exception for unused identifier

oT& operator[] (const string & name)
Returns reference to element. exception for unused identifier

oconst T& operator[] (const char* name) const
Returns element, error if not used

oT& operator[] (int i)
Returns reference to i-th element

oconst T& operator[] (int i) const
Returns const reference to i-th element

oinline const char* GetName(int i) const
Returns name of i-th element

oinline void Set(const char* name, const T & el)
Associates el to the string name, overrides if name is used

oinline bool Used(const char* name) const
Checks whether name is used

oinline void DeleteAll()
Deletes symboltable

oSymbolTable<T> & operator= (SymbolTable<T> &)
prohibits copiing


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.