summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2011-06-16 05:04:13 +0000
committerAdrian Thurston <thurston@complang.org>2011-06-16 05:04:13 +0000
commit87e6253253c38e1e4c9662c393286dbdb46085aa (patch)
treeb5fa058a6850e230805eb67369d07a619597f98f
parent21c120cb8d263a25b98b183f2ec9701e1dd15ee0 (diff)
downloadcolm-87e6253253c38e1e4c9662c393286dbdb46085aa.tar.gz
Last call to getKlangEl removed from the parser. The lhs and rhs variables are
now added in the declare pass.
-rw-r--r--colm/lmparse.kl6
-rw-r--r--colm/resolve.cc10
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++ ) {