Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r8688ce1 r4e05d27  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug  4 11:28:18 2016
    13 // Update Count     : 1672
     12// Last Modified On : Sat Jul 23 17:01:30 2016
     13// Update Count     : 1668
    1414//
    1515
     
    150150%type<sn> block_item_list                               block_item
    151151%type<sn> case_clause
    152 %type<en> case_value
    153 %type<sn> case_value_list                               case_label                                      case_label_list
     152%type<en> case_value                                    case_value_list
     153%type<sn> case_label                                    case_label_list
    154154%type<sn> switch_clause_list_opt                switch_clause_list                      choose_clause_list_opt          choose_clause_list
    155155%type<pn> handler_list                                  handler_clause                          finally_clause
     
    717717                        // *before* the transfer to the appropriate case clause by hoisting the declarations into a compound
    718718                        // statement around the switch.  Statements after the initial declaration list can never be executed, and
    719                         // therefore, are removed from the grammar even though C allows it. The change also applies to choose
    720                         // statement.
     719                        // therefore, are removed from the grammar even though C allows it. Change also applies to choose statement.
    721720                        $$ = $7 != 0 ? new CompoundStmtNode( (StatementNode *)((new StatementNode( $7 ))->set_link( sw )) ) : sw;
    722721                }
     
    741740
    742741case_value_list:                                                                                // CFA
    743         case_value                                                                      { $$ = new StatementNode( StatementNode::Case, $1, 0 ); }
    744         | case_value_list ',' case_value                        { $$ = (StatementNode *)($1->set_link( new StatementNode( StatementNode::Case, $3, 0 ) ) ); }
     742        case_value
     743        | case_value_list ',' case_value
     744                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::TupleC ), (ExpressionNode *)(tupleContents( $1 ))->set_link( $3 ) ); }
    745745        ;
    746746
    747747case_label:                                                                                             // CFA
    748         CASE case_value_list ':'                                        { $$ = $2; }
     748        CASE case_value_list ':'                                        { $$ = new StatementNode( StatementNode::Case, $2, 0 ); }
    749749        | DEFAULT ':'                                                           { $$ = new StatementNode( StatementNode::Default ); }
    750750                // A semantic check is required to ensure only one default clause per switch/choose statement.
Note: See TracChangeset for help on using the changeset viewer.