![]() |
![]() |
Holder for character strings. More...
#include <csymbol.h>
Public Member Functions | |
CSymbol (const char *aName) | |
Create a symbol. More... | |
~CSymbol (void) | |
Destroy symbol. More... | |
const char * | GetName (void) const |
Get symbol's text. More... | |
int | Escaped (void) const |
Determine if string is an escaped symbol. More... | |
int | External () const |
Determine if symbol is external reference return non-zero if symbol is external. More... | |
![]() | |
void * | operator new (size_t size, CObstack *stack) |
Allocate object on CObstack heap. More... | |
void | operator delete (void *object) |
Destroy object. More... | |
Static Public Member Functions | |
static CSymbol * | Lookup (const char *name) |
Find symbol for given string. More... | |
static CSymbol * | GenSymbol (const char *prefix) |
Generated a new symbol with a unique name using the given prefix. More... | |
static void | DumpTable (void) |
Dump symbol table. More... | |
static void | SetObstack (CObstack *aObstack) |
Set heap to use for storage. More... | |
static void | DumpStats () |
Dump hash table stats. More... | |
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 |
Dump hash table stats.
|
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 |
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 |
Find symbol for given string.
If not found create a symbol for it.
name | text string to search for. |
|
static |
Set heap to use for storage.