diff options
author | Adrian Thurston <thurston@complang.org> | 2013-05-19 22:40:19 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2013-05-19 22:40:19 -0400 |
commit | 51b5957878dd5689476529fcc4e44e5d01815574 (patch) | |
tree | 55cf449649343dc85e3f6e0768af8783157e1c04 /colm/loadcolm.cc | |
parent | 7447c624a1c536abef03c069b2aedd776d56d622 (diff) | |
download | colm-51b5957878dd5689476529fcc4e44e5d01815574.tar.gz |
trying out more production labels
Diffstat (limited to 'colm/loadcolm.cc')
-rw-r--r-- | colm/loadcolm.cc | 70 |
1 files changed, 36 insertions, 34 deletions
diff --git a/colm/loadcolm.cc b/colm/loadcolm.cc index 660b1986..e159d1cc 100644 --- a/colm/loadcolm.cc +++ b/colm/loadcolm.cc @@ -1789,67 +1789,69 @@ struct LoadColm void walkRootItem( root_item &rootItem, StmtList *stmtList ) { - if ( rootItem.RlDef() != 0 ) { + switch ( rootItem.prodType() ) { + case root_item::RlProd: walkRlDef( rootItem.RlDef() ); - } - else if ( rootItem.TokenDef() != 0 ) { + break; + case root_item::TokenProd: walkTokenDef( rootItem.TokenDef() ); - } - else if ( rootItem.IgnoreDef() != 0 ) { + break; + case root_item::IgnoreProd: walkIgnoreDef( rootItem.IgnoreDef() ); - } - else if ( rootItem.LiteralDef() != 0 ) { + break; + case root_item::LiteralProd: walkLiteralDef( rootItem.LiteralDef() ); - } - else if ( rootItem.CflDef() != 0 ) { + break; + case root_item::CflProd: walkCflDef( rootItem.CflDef() ); - } - else if ( rootItem.RegionDef() != 0 ) { + break; + case root_item::RegionProd: walkLexRegion( rootItem.RegionDef() ); - } - else if ( rootItem.Statement() != 0 ) { + break; + case root_item::StatementProd: { LangStmt *stmt = walkStatement( rootItem.Statement() ); if ( stmt != 0 ) stmtList->append( stmt ); + break; } - else if ( rootItem.ContextDef() != 0 ) { + case root_item::ContextProd: walkContextDef( rootItem.ContextDef() ); - } - else if ( rootItem.NamespaceDef() != 0 ) { + break; + case root_item::NamespaceProd: walkNamespaceDef( rootItem.NamespaceDef() ); - } - else if ( rootItem.FunctionDef() != 0 ) { + break; + case root_item::FunctionProd: walkFunctionDef( rootItem.FunctionDef() ); - } - else if ( rootItem.IterDef() != 0 ) { - walkIterDef( rootItem.IterDef() ); - } - else if ( rootItem.IterDef() != 0 ) { + break; + case root_item::IterProd: walkIterDef( rootItem.IterDef() ); - } - else if ( rootItem.PreEofDef() != 0 ) { + break; + case root_item::PreEofProd: walkPreEof( rootItem.PreEofDef() ); - } - else if ( rootItem.ExportDef() != 0 ) { + break; + case root_item::ExportProd: { LangStmt *stmt = walkExportDef( rootItem.ExportDef() ); if ( stmt != 0 ) stmtList->append( stmt ); + break; } - else if ( rootItem.AliasDef() != 0 ) { + case root_item::AliasProd: walkAliasDef( rootItem.AliasDef() ); - } - else if ( rootItem.PrecedenceDef() != 0 ) { + break; + case root_item::PrecedenceProd: walkPrecedenceDef( rootItem.PrecedenceDef() ); - } - else if ( rootItem.Include() != 0 ) { + break; + case root_item::IncludeProd: { StmtList *includeList = walkInclude( rootItem.Include() ); stmtList->append( *includeList ); + break; } - else if ( rootItem.GlobalDef() != 0 ) { + case root_item::GlobalProd: { LangStmt *stmt = walkGlobalDef( rootItem.GlobalDef() ); if ( stmt != 0 ) stmtList->append( stmt ); - } + break; + }} } bool walkOptNoIgnore( opt_no_ignore OptNoIngore ) |