diff options
author | Adrian Thurston <thurston@complang.org> | 2015-10-05 16:57:12 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2015-10-05 16:57:12 -0400 |
commit | 3e73bf22f0e3819276369f8d1ea3d546002956b9 (patch) | |
tree | a9df873323200180bec8f42601bab8c83f1360f9 /src/loadcolm.cc | |
parent | cbca35717204e8a02e71c3a3e67eaf9f5a0f4019 (diff) | |
download | colm-3e73bf22f0e3819276369f8d1ea3d546002956b9.tar.gz |
load reduction nonterms
Diffstat (limited to 'src/loadcolm.cc')
-rw-r--r-- | src/loadcolm.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/loadcolm.cc b/src/loadcolm.cc index dedb4353..374793cc 100644 --- a/src/loadcolm.cc +++ b/src/loadcolm.cc @@ -2346,14 +2346,24 @@ struct LoadColm namespaceStack.pop(); } + void walkRedNonTerm( red_nonterm RN ) + { + InputLoc loc = RN.ROPEN().loc(); + String text = RN.HostItems().text().c_str(); + TypeRef *typeRef = walkTypeRef( RN.type_ref() ); + + ReduceNonTerm *rnt = new ReduceNonTerm( loc, typeRef, text ); + curReduction()->reduceNonTerms.append( rnt ); + } + void walkRedAction( red_action RA ) { - InputLoc loc = RA.NonTerm().loc(); + InputLoc loc = RA.id().loc(); String text = RA.HostItems().text().c_str(); - TypeRef *typeRef = walkTypeRef( RA.NonTerm() ); + TypeRef *typeRef = walkTypeRef( RA.type_ref() ); - ReduceAction *ra = new ReduceAction( loc, typeRef, RA.Prod().data(), text ); + ReduceAction *ra = new ReduceAction( loc, typeRef, RA.id().data(), text ); curReduction()->reduceActions.append( ra ); } @@ -2361,6 +2371,7 @@ struct LoadColm { switch ( reductionItem.prodName() ) { case reduction_item::NonTerm: { + walkRedNonTerm( reductionItem.red_nonterm() ); break; } case reduction_item::Action: { |