Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r321f55d r2f22cc4  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 10 23:03:05 2016
    13 // Update Count     : 1846
     12// Last Modified On : Wed Aug 10 13:09:53 2016
     13// Update Count     : 1844
    1414//
    1515
     
    723723        IF '(' comma_expression ')' statement                           %prec THEN
    724724                // explicitly deal with the shift/reduce conflict on if/else
     725                //{ $$ = new StatementNode( StatementNode::If, $3, $5 ); }
    725726                { $$ = new StatementNode2( build_if( $3, $5, nullptr ) ); }
    726727        | IF '(' comma_expression ')' statement ELSE statement
     728                //{ $$ = new StatementNode( StatementNode::If, $3, (StatementNode *)mkList((*$5, *$7 )) ); }
    727729                { $$ = new StatementNode2( build_if( $3, $5, $7 ) ); }
    728730        | SWITCH '(' comma_expression ')' case_clause           // CFA
     731                //{ $$ = new StatementNode( StatementNode::Switch, $3, $5 ); }
    729732                { $$ = new StatementNode2( build_switch( $3, $5 ) ); }
    730733        | SWITCH '(' comma_expression ')' '{' push declaration_list_opt switch_clause_list_opt '}' // CFA
     
    739742                }
    740743        | CHOOSE '(' comma_expression ')' case_clause           // CFA
     744                //{ $$ = new StatementNode( StatementNode::Switch, $3, $5 ); }
    741745                { $$ = new StatementNode2( build_switch( $3, $5 ) ); }
    742746        | CHOOSE '(' comma_expression ')' '{' push declaration_list_opt choose_clause_list_opt '}' // CFA
    743747                {
     748                        //StatementNode *sw = new StatementNode( StatementNode::Switch, $3, $8 );
    744749                        StatementNode *sw = new StatementNode2( build_switch( $3, $8 ) );
    745750                        $$ = $7 != 0 ? new CompoundStmtNode( (StatementNode *)((new StatementNode( $7 ))->set_link( sw )) ) : sw;
     
    839844jump_statement:
    840845        GOTO IDENTIFIER ';'
    841                 //{ $$ = new StatementNode( StatementNode::Goto, $2 ); }
    842                 { $$ = new StatementNode2( build_branch( *$2, BranchStmt::Goto ) ); }
     846                { $$ = new StatementNode( StatementNode::Goto, $2 ); }
    843847        | GOTO '*' comma_expression ';'                                         // GCC, computed goto
    844848                // The syntax for the GCC computed goto violates normal expression precedence, e.g., goto *i+3; => goto *(i+3);
     
    847851        | CONTINUE ';'
    848852                // A semantic check is required to ensure this statement appears only in the body of an iteration statement.
    849                 //{ $$ = new StatementNode( StatementNode::Continue ); }
    850                 { $$ = new StatementNode2( build_branch( "", BranchStmt::Continue ) ); }
     853                { $$ = new StatementNode( StatementNode::Continue ); }
    851854        | CONTINUE IDENTIFIER ';'                                                       // CFA, multi-level continue
    852855                // A semantic check is required to ensure this statement appears only in the body of an iteration statement, and
    853856                // the target of the transfer appears only at the start of an iteration statement.
    854                 //{ $$ = new StatementNode( StatementNode::Continue, $2 ); }
    855                 { $$ = new StatementNode2( build_branch( *$2, BranchStmt::Continue ) ); delete $2; }
     857                { $$ = new StatementNode( StatementNode::Continue, $2 ); }
    856858        | BREAK ';'
    857859                // A semantic check is required to ensure this statement appears only in the body of an iteration statement.
    858                 //{ $$ = new StatementNode( StatementNode::Break ); }
    859                 { $$ = new StatementNode2( build_branch( "", BranchStmt::Break ) ); }
     860                { $$ = new StatementNode( StatementNode::Break ); }
    860861        | BREAK IDENTIFIER ';'                                                          // CFA, multi-level exit
    861862                // A semantic check is required to ensure this statement appears only in the body of an iteration statement, and
    862863                // the target of the transfer appears only at the start of an iteration statement.
    863                 //{ $$ = new StatementNode( StatementNode::Break, $2 ); }
    864                 { $$ = new StatementNode2( build_branch( *$2, BranchStmt::Break ) ); delete $2; }
     864                { $$ = new StatementNode( StatementNode::Break, $2 ); }
    865865        | RETURN comma_expression_opt ';'
    866866                { $$ = new StatementNode( StatementNode::Return, $2, 0 ); }
Note: See TracChangeset for help on using the changeset viewer.