58 static const int kHashTableSize = 511;
59 static Symbol* gSymbolTable[kHashTableSize];
73 bool equiv (
unsigned int hash,
const char* str)
const ;
74 static unsigned int calcHashKey (
const char* str);
77 static Symbol*
get (
const string& str);
78 static Symbol*
get (
const char* str);
79 static Symbol* prefix (
const char* str);
80 static bool isnew (
const char* str);
83 ostream&
print (ostream& fout)
const;
void setUserData(Symbol *sym, void *d)
Set user data.
Symbol * unique(const char *str)
Returns a new unique symbol of name strxxx.
ostream & print(ostream &fout) const
print a symbol on a stream
static Symbol * get(const string &str)
Get the symbol of name str.
ostream & operator<<(ostream &s, const Symbol &n)
void * fData
Field to user disposal to store additional data.
Symbol * fNext
Next symbol in the hash table entry.
static Symbol * prefix(const char *str)
Creates a new symbol of name prefixed by str.
char * fName
Name of the symbol.
unsigned int fHash
Hash key computed from the name and used to determine the hash table entry.
const char * name(Symbol *sym)
Returns the name of a symbol.
Symbols are unique objects with a name stored in a hash table.
void * getUserData(Symbol *sym)
Returns user data.
Symbol * symbol(const char *str)
Returns (and creates if new) the symbol of name str.
void print(Tree t, FILE *out)