CSymbol Class Reference
Holder for character strings.
More...
#include <csymbol.h>
List of all members.
Public Member Functions |
| CSymbol (const char *aName, int caseSensitive, int escape) |
| Create a symbol.
|
| ~CSymbol (void) |
| Destroy symbol.
|
const char * | GetName (void) |
| Get symbol's text.
|
int | Escaped () |
| Get symbol's escaped attribute.
|
Static Public Member Functions |
static CSymbol * | Lookup (const char *name, int caseSensitive, int escaped=FALSE) |
| 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 int | StringCompare (const char *s1, const char *s2, int caseSensitive) |
| Compare two strings for equality.
|
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, |
|
|
int |
caseSensitive, |
|
|
int |
escape | |
|
) |
| | |
Create a symbol.
- Parameters:
-
| aName | text for symbold. |
| caseSensitive | non-zero if symbol is case sensitive. |
| escape | non-zero if symbol has been escaped. ie verilog text escaping rules. |
CSymbol::~CSymbol |
( |
void |
|
) |
|
Member Function Documentation
static void CSymbol::DumpStats |
( |
|
) |
[static] |
static void CSymbol::DumpTable |
( |
void |
|
) |
[static] |
int CSymbol::Escaped |
( |
|
) |
[inline] |
Get symbol's escaped attribute.
- Returns:
- non-zero if symbol was escaped.
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 |
|
) |
|
Get symbol's text.
- Returns:
- text string for symbol.
static CSymbol* CSymbol::Lookup |
( |
const char * |
name, |
|
|
int |
caseSensitive, |
|
|
int |
escaped = FALSE | |
|
) |
| | [static] |
Find symbol for given string.
If not found create a symbol for it. A match requires both the caseSensitive and escaped attributes to match.
- Parameters:
-
| name | text string to search for. |
| caseSensitive | non-zero if string is case sensitive in searches. |
| escaped | non-zero if string has been escaped |
- Returns:
- symbol for name
static void CSymbol::SetObstack |
( |
CObstack * |
aObstack |
) |
[static] |
Set heap to use for storage.
static int CSymbol::StringCompare |
( |
const char * |
s1, |
|
|
const char * |
s2, |
|
|
int |
caseSensitive | |
|
) |
| | [static] |
Compare two strings for equality.
- Parameters:
-
| s1 | first string to compare. |
| s2 | second string to compare. |
| caseSensitive | non-zero if case influences match. |
- Returns:
- non-zero if match fails.
The documentation for this class was generated from the following file:
- /net/fileserver/nas/home/mdh/vrq/src/csymbol.h