Add a constructor to PSymbolTable that takes a parent table as input

This commit is contained in:
Randy Heit 2013-10-29 21:52:28 -05:00
parent e696fff0be
commit fe21ceec56
3 changed files with 7 additions and 1 deletions

View file

@ -2507,6 +2507,11 @@ PSymbolTable::PSymbolTable()
{ {
} }
PSymbolTable::PSymbolTable(PSymbolTable *parent)
: ParentSymbolTable(parent)
{
}
PSymbolTable::~PSymbolTable () PSymbolTable::~PSymbolTable ()
{ {
ReleaseSymbols(); ReleaseSymbols();

View file

@ -73,6 +73,7 @@ public:
struct PSymbolTable struct PSymbolTable
{ {
PSymbolTable(); PSymbolTable();
PSymbolTable(PSymbolTable *parent);
~PSymbolTable(); ~PSymbolTable();
size_t MarkSymbols(); size_t MarkSymbols();

View file

@ -255,7 +255,7 @@ static void DoParse(const char *filename)
ZCCParse(parser, 0, value, &state); ZCCParse(parser, 0, value, &state);
ZCCParseFree(parser, free); ZCCParseFree(parser, free);
PSymbolTable symbols; PSymbolTable symbols(&GlobalSymbols);
ZCCCompiler cc(state, NULL, symbols); ZCCCompiler cc(state, NULL, symbols);
cc.Compile(); cc.Compile();
#ifdef _DEBUG #ifdef _DEBUG