Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/StatementNode.cc

    r321f55d r2f22cc4  
    1010// Created On       : Sat May 16 14:59:41 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 10 22:08:38 2016
    13 // Update Count     : 173
     12// Last Modified On : Wed Aug 10 13:54:21 2016
     13// Update Count     : 170
    1414//
    1515
     
    224224          case Case:
    225225                return new CaseStmt( labs, maybeBuild<Expression>(get_control() ), branches );
    226                 assert( false );
    227226          case Default:
    228227                return new CaseStmt( labs, 0, branches, true );
    229                 assert( false );
    230228          case While:
    231229                // assert( branches.size() == 1 );
     
    270268          case Break:
    271269                return new BranchStmt( labs, get_target(), BranchStmt::Break );
    272                 assert( false );
    273270          case Continue:
    274271                return new BranchStmt( labs, get_target(), BranchStmt::Continue );
    275                 assert( false );
    276272          case Return:
    277273          case Throw :
     
    318314        std::list<Statement *> branches;
    319315        buildList<Statement, StatementNode>( then_stmt, branches );
    320         assert( branches.size() == 1 );
     316        assert( branches.size() >= 1 );
    321317        thenb = branches.front();
    322318
     
    324320                std::list<Statement *> branches;
    325321                buildList<Statement, StatementNode>( else_stmt, branches );
    326                 assert( branches.size() == 1 );
     322                assert( branches.size() >= 1 );
    327323                elseb = branches.front();
    328324        } // if
     
    333329        std::list<Statement *> branches;
    334330        buildList<Statement, StatementNode>( stmt, branches );
    335         assert( branches.size() >= 0 );                                         // size == 0 for switch (...) {}, i.e., no declaration or statements
     331        assert( branches.size() >= 1 );
    336332        return new SwitchStmt( noLabels, maybeBuild<Expression>(ctl), branches );
    337 }
    338 Statement *build_case( ExpressionNode *ctl ) {
    339         std::list<Statement *> branches;
    340         buildList<Statement, StatementNode>( nullptr, branches );
    341         return new CaseStmt( noLabels, maybeBuild<Expression>(ctl), branches );
    342 }
    343 Statement *build_default() {
    344         std::list<Statement *> branches;
    345         return new CaseStmt( noLabels, nullptr, branches, true );
    346333}
    347334
     
    373360        delete forctl;
    374361        return new ForStmt( noLabels, init, cond, incr, branches.front() );
    375 }
    376 
    377 Statement *build_branch( std::string identifier, BranchStmt::Type kind ) {
    378         return new BranchStmt( noLabels, identifier, kind );
    379362}
    380363
Note: See TracChangeset for help on using the changeset viewer.