diff options
author | Adrian Thurston <thurston@complang.org> | 2011-06-16 05:04:13 +0000 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2011-06-16 05:04:13 +0000 |
commit | 87e6253253c38e1e4c9662c393286dbdb46085aa (patch) | |
tree | b5fa058a6850e230805eb67369d07a619597f98f /colm | |
parent | 21c120cb8d263a25b98b183f2ec9701e1dd15ee0 (diff) | |
download | colm-87e6253253c38e1e4c9662c393286dbdb46085aa.tar.gz |
Last call to getKlangEl removed from the parser. The lhs and rhs variables are
now added in the declare pass.
Diffstat (limited to 'colm')
-rw-r--r-- | colm/lmparse.kl | 6 | ||||
-rw-r--r-- | colm/resolve.cc | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/colm/lmparse.kl b/colm/lmparse.kl index a8cac6c1..20bf2c3f 100644 --- a/colm/lmparse.kl +++ b/colm/lmparse.kl @@ -1244,11 +1244,11 @@ start_reduce: $$->localFrame = $1->localFrame; /* Get the language element. */ - KlangEl *prodName = getKlangEl( pd, namespaceStack.top(), curDefineId ); +// KlangEl *prodName = getKlangEl( pd, namespaceStack.top(), curDefineId ); /* References to the reduce item. */ - pd->addProdRedObjectVar( pd->curLocalFrame, prodName ); - pd->addProdRHSVars( pd->curLocalFrame, curProdElList ); +// pd->addProdRedObjectVar( pd->curLocalFrame, prodName ); +// pd->addProdRHSVars( pd->curLocalFrame, curProdElList ); }; nonterm lang_stmt_list diff --git a/colm/resolve.cc b/colm/resolve.cc index 5fd09fe5..31826cb8 100644 --- a/colm/resolve.cc +++ b/colm/resolve.cc @@ -408,8 +408,16 @@ void Namespace::declare( ParseData *pd ) langEl->contextIn = n->contextIn; langEl->defList.transfer( *n->defList ); - for ( LelDefList::Iter d = langEl->defList; d.lte(); d++ ) + for ( LelDefList::Iter d = langEl->defList; d.lte(); d++ ) { d->prodName = langEl; + + if ( d->redBlock != 0 ) { + pd->addProdRedObjectVar( d->redBlock->localFrame, langEl ); + pd->addProdRHSVars( d->redBlock->localFrame, d->prodElList ); + } + + /* References to the reduce item. */ + } } for ( NamespaceVect::Iter c = childNamespaces; c.lte(); c++ ) { |