![]() |
|
Holder for character strings. More...
#include <csymbol.h>
Classes | |
| struct | SymbolCompare |
Public Member Functions | |
| CSymbol (const char *aName) | |
| Create a symbol. | |
| ~CSymbol (void) | |
| Destroy symbol. | |
| const char * | GetName (void) const |
| Get symbol's text. | |
| int | Escaped (void) const |
| Determine if string is an escaped symbol. | |
| int | External () const |
| Determine if symbol is external reference return non-zero if symbol is external. | |
Static Public Member Functions | |
| static CSymbol * | Lookup (const char *name) |
| Find symbol for given string. | |
| static CSymbol * | GenSymbol (const char *prefix) |
| Generated a new symbol with a unique name using the given prefix. | |
| static void | DumpTable (void) |
| Dump symbol table. | |
| static void | SetObstack (CObstack *aObstack) |
| Set heap to use for storage. | |
| static void | DumpStats () |
| Dump hash table stats. | |
Holder for character strings.
All tokens are registered as symbols to allow pointers to be compared for string equality instead of the contents of the strings.
| CSymbol::CSymbol | ( | const char * | aName | ) |
Create a symbol.
| aName | text for symbold. |
| CSymbol::~CSymbol | ( | void | ) |
Destroy symbol.
| static void CSymbol::DumpStats | ( | ) | [static] |
Dump hash table stats.
| static void CSymbol::DumpTable | ( | void | ) | [static] |
Dump symbol table.
| int CSymbol::Escaped | ( | void | ) | const |
Determine if string is an escaped symbol.
| int CSymbol::External | ( | ) | const |
Determine if symbol is external reference return non-zero if symbol is external.
| static CSymbol* CSymbol::GenSymbol | ( | const char * | prefix | ) | [static] |
Generated a new symbol with a unique name using the given prefix.
| prefix | to use when generating symbol. |
| const char* CSymbol::GetName | ( | void | ) | const |
Get symbol's text.
| static CSymbol* CSymbol::Lookup | ( | const char * | name | ) | [static] |
Find symbol for given string.
If not found create a symbol for it.
| name | text string to search for. |
| static void CSymbol::SetObstack | ( | CObstack * | aObstack | ) | [static] |
Set heap to use for storage.
1.7.1