Ignore:
Timestamp:
Aug 4, 2016, 1:18:38 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
4819cac, 658fafe4, b87e2b60
Parents:
00c32e9 (diff), 76e8c55 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r00c32e9 rcf37a8e  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 23 17:01:30 2016
    13 // Update Count     : 1668
     12// Last Modified On : Thu Aug  4 11:28:18 2016
     13// Update Count     : 1672
    1414//
    1515
     
    150150%type<sn> block_item_list                               block_item
    151151%type<sn> case_clause
    152 %type<en> case_value                                    case_value_list
    153 %type<sn> case_label                                    case_label_list
     152%type<en> case_value
     153%type<sn> case_value_list                               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. Change also applies to choose statement.
     719                        // therefore, are removed from the grammar even though C allows it. The change also applies to choose
     720                        // statement.
    720721                        $$ = $7 != 0 ? new CompoundStmtNode( (StatementNode *)((new StatementNode( $7 ))->set_link( sw )) ) : sw;
    721722                }
     
    740741
    741742case_value_list:                                                                                // CFA
    742         case_value
    743         | case_value_list ',' case_value
    744                 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::TupleC ), (ExpressionNode *)(tupleContents( $1 ))->set_link( $3 ) ); }
     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 ) ) ); }
    745745        ;
    746746
    747747case_label:                                                                                             // CFA
    748         CASE case_value_list ':'                                        { $$ = new StatementNode( StatementNode::Case, $2, 0 ); }
     748        CASE case_value_list ':'                                        { $$ = $2; }
    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.