![]() |
![]() |
Aux class used to create symbol table scoping. More...
#include <csymtab.h>
Public Member Functions | |
CSymtab () | |
Create a symbol table. | |
void | PopScope () |
Jump back to parent scope. | |
void | PushScope () |
Create a new scope for table. | |
void | Add (CSymbol *sym, T1 *obj) |
Add a symbol and it's assocated object at the current level. | |
T1 * | LookupTop (CSymbol *sym) |
Lookup symbol only in current scope. | |
T1 * | Lookup (CSymbol *sym) |
Lookup symbol in all scopes starting at the current scope. | |
void | Dump (FILE *f, int recurse) |
Dump all symbols in table to file descriptor. |
Aux class used to create symbol table scoping.
Class for a type safe hierarchical symbol table. Each level of the table represents a different nested scope. Searches a the leaves of the table seach upward to the table root if needed.
Add a symbol and it's assocated object at the current level.
Create a new level if needed.
sym | symbol to add to table. |
obj | object to associated with symbol. |
Dump all symbols in table to file descriptor.
f | file descriptor. |
recurse | zero if only current depth should be dumped. |
Lookup symbol in all scopes starting at the current scope.
sym | symbol to search for. |
Lookup symbol only in current scope.
sym | symbol to search for. |