Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/StatementNode.cc

    rc0aa336 r837a17c  
    1010// Created On       : Sat May 16 14:59:41 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  2 22:16:40 2017
    13 // Update Count     : 327
     12// Last Modified On : Sun Aug 21 11:59:37 2016
     13// Update Count     : 325
    1414//
    1515
     
    2828
    2929StatementNode::StatementNode( DeclarationNode *decl ) {
    30         assert( decl );
    31         DeclarationNode *agg = decl->extractAggregate();
    32         if ( agg ) {
    33                 StatementNode *nextStmt = new StatementNode( new DeclStmt( noLabels, maybeBuild< Declaration >( decl ) ) );
    34                 set_next( nextStmt );
    35                 if ( decl->get_next() ) {
    36                         get_next()->set_next( new StatementNode( dynamic_cast< DeclarationNode * >(decl->get_next()) ) );
    37                         decl->set_next( 0 );
     30        if ( decl ) {
     31                DeclarationNode *agg = decl->extractAggregate();
     32                if ( agg ) {
     33                        StatementNode *nextStmt = new StatementNode( new DeclStmt( noLabels, maybeBuild< Declaration >( decl ) ) );
     34                        set_next( nextStmt );
     35                        if ( decl->get_next() ) {
     36                                get_next()->set_next( new StatementNode( dynamic_cast< DeclarationNode * >(decl->get_next()) ) );
     37                                decl->set_next( 0 );
     38                        } // if
     39                } else {
     40                        if ( decl->get_next() ) {
     41                                set_next(new StatementNode( dynamic_cast< DeclarationNode * >( decl->get_next() ) ) );
     42                                decl->set_next( 0 );
     43                        } // if
     44                        agg = decl;
    3845                } // if
     46                stmt.reset( new DeclStmt( noLabels, maybeMoveBuild< Declaration >(agg) ) );
    3947        } else {
    40                 if ( decl->get_next() ) {
    41                         set_next( new StatementNode( dynamic_cast< DeclarationNode * >( decl->get_next() ) ) );
    42                         decl->set_next( 0 );
    43                 } // if
    44                 agg = decl;
     48                assert( false );
    4549        } // if
    46         stmt.reset( new DeclStmt( noLabels, maybeMoveBuild< Declaration >(agg) ) );
    47 } // StatementNode::StatementNode
     50}
    4851
    4952StatementNode *StatementNode::append_last_case( StatementNode *stmt ) {
Note: See TracChangeset for help on using the changeset viewer.