#include <symboltable.h>
Symbolic names are restricted to printable ascii, no quoatation ("), and no blanks. Indices are of type faudes Idx aka (long unsigned) integer and must be positive. Both, indices and symbolic names must be unique within each SymbolTable. Consistency checks on input data are preformed, regardless of the FAUDES_CHECKED compiletime option.
Generators refer to a global symboltable for event names and hold a local symboltable for state names.
Definition at line 52 of file symboltable.h.
Public Member Functions | |
SymbolTable (void) | |
Creates a new SymbolTable. | |
std::string | Name (void) const |
Return name of SymbolTable. | |
void | Name (const std::string &rName) |
Set name of SymbolTable. | |
Idx | Size (void) |
Size of symboltabel. | |
void | Clear (void) |
Clear all entries. | |
Idx | MaxIndex (void) const |
Get maximum index which this SymbolTable accepts. | |
void | MaxIndex (Idx index) |
Set maximum index which this SymbolTable accapts. | |
Idx | LastIndex (void) const |
Get the largest index in use. | |
std::string | Symbol (Idx index) const |
Symbolic name lookup. | |
Idx | Index (const std::string &rName) const |
Index lookup. | |
bool | Exists (Idx index) const |
Test existence of index. | |
bool | Exists (const std::string &rName) const |
Test existence of symbol. | |
std::string | UniqueSymbol (const std::string &rName) const |
Create unique symbolic name by adding an underscore and extra digits. | |
Idx | InsEntry (Idx index, const std::string &rName) |
Add new entry (aka symbolic name and index) to symboltable,. | |
Idx | InsEntry (const std::string &rName) |
Merge a symbolic name with symboltable. | |
void | SetEntry (Idx index, const std::string &rName) |
Set symbolic name for existing entry. | |
void | SetDefaultSymbol (Idx index) |
Set default names ("1", "2", "3", . | |
void | ClrEntry (Idx index) |
Delete entry by index. | |
void | ClrEntry (const std::string &rName) |
Delete entry by symbol. | |
Static Public Member Functions | |
static bool | ValidSymbol (const std::string &rName) |
Test validiy of candidate symbol. | |
static SymbolTable * | GlobalEventSymbolTablep (void) |
Get Static Symboltable ref. | |
Private Attributes | |
std::string | mMyName |
Name of the SymbolTable. | |
std::map< std::string, Idx > | mIndexMap |
Index lookup map. | |
std::map< Idx, std::string > | mNameMap |
Name lookup map. | |
Idx | mMaxIndex |
Upper limit (incl). | |
Idx | mNextIndex |
Largest used index + 1. | |
Static Private Attributes | |
static SymbolTable | msEventSymbolTable |
static event symbol table (should go to faudes::vGenerator, or faudes) |
|
Creates a new SymbolTable.
Definition at line 33 of file symboltable.cpp. |
|
Clear all entries.
Definition at line 50 of file symboltable.cpp. |
|
Delete entry by symbol.
Definition at line 200 of file symboltable.cpp. |
|
Delete entry by index.
Definition at line 192 of file symboltable.cpp. |
|
Test existence of symbol.
Definition at line 234 of file symboltable.cpp. |
|
Test existence of index.
Definition at line 228 of file symboltable.cpp. |
|
Get Static Symboltable ref.
Definition at line 241 of file symboltable.cpp. |
|
Index lookup.
Definition at line 208 of file symboltable.cpp. |
|
Merge a symbolic name with symboltable. If the symbol does not exist, find a new index and add the new entry. If the symbol does exist, lookup its index.
Definition at line 156 of file symboltable.cpp. |
|
Add new entry (aka symbolic name and index) to symboltable,.
Definition at line 124 of file symboltable.cpp. |
|
Get the largest index in use.
Definition at line 79 of file symboltable.cpp. |
|
Set maximum index which this SymbolTable accapts.
Definition at line 68 of file symboltable.cpp. |
|
Get maximum index which this SymbolTable accepts.
Definition at line 63 of file symboltable.cpp. |
|
Set name of SymbolTable.
Definition at line 45 of file symboltable.cpp. |
|
Return name of SymbolTable.
Definition at line 40 of file symboltable.cpp. |
|
Set default names ("1", "2", "3", . ..) for index.
Definition at line 181 of file symboltable.cpp. |
|
Set symbolic name for existing entry.
Definition at line 164 of file symboltable.cpp. |
|
Size of symboltabel.
Definition at line 58 of file symboltable.cpp. |
|
Symbolic name lookup.
Definition at line 217 of file symboltable.cpp. |
|
Create unique symbolic name by adding an underscore and extra digits. The current implementation tries to be smart and overwrites any previously added digits. It is also slow.
Definition at line 100 of file symboltable.cpp. |
|
Test validiy of candidate symbol. The current implementation insists in printable ascii, no quotes (") and no blanks. The no-quotes-restriction simplifies file io (see tokenreader.h), other restrictions are cosmetic.
Definition at line 84 of file symboltable.cpp. |
|
Index lookup map.
Definition at line 239 of file symboltable.h. |
|
Upper limit (incl).
Definition at line 245 of file symboltable.h. |
|
Name of the SymbolTable.
Definition at line 236 of file symboltable.h. |
|
Name lookup map.
Definition at line 242 of file symboltable.h. |
|
Largest used index + 1.
Definition at line 248 of file symboltable.h. |
|
static event symbol table (should go to faudes::vGenerator, or faudes)
Definition at line 251 of file symboltable.h. |