vrq
Classes | Public Member Functions | Static Public Member Functions

CSymbol Class Reference

Holder for character strings. More...

#include <csymbol.h>

Inheritance diagram for CSymbol:
CObject

List of all members.

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 CSymbolLookup (const char *name)
 Find symbol for given string.
static CSymbolGenSymbol (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.

Detailed Description

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.


Constructor & Destructor Documentation

CSymbol::CSymbol ( const char *  aName  ) 

Create a symbol.

Parameters:
aName text for symbold.
CSymbol::~CSymbol ( void   ) 

Destroy symbol.


Member Function Documentation

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.

Returns:
non-zero if string is escaped
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.

Parameters:
prefix to use when generating symbol.
Returns:
new symbol.
const char* CSymbol::GetName ( void   )  const

Get symbol's text.

Returns:
text string for symbol.
static CSymbol* CSymbol::Lookup ( const char *  name  )  [static]

Find symbol for given string.

If not found create a symbol for it.

Parameters:
name text string to search for.
Returns:
symbol for name
static void CSymbol::SetObstack ( CObstack aObstack  )  [static]

Set heap to use for storage.


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