Changeset cf37a8e for src/Parser/parser.yy
- Timestamp:
- Aug 4, 2016, 1:18:38 PM (8 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r00c32e9 rcf37a8e 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 23 17:01:30201613 // Update Count : 16 6812 // Last Modified On : Thu Aug 4 11:28:18 2016 13 // Update Count : 1672 14 14 // 15 15 … … 150 150 %type<sn> block_item_list block_item 151 151 %type<sn> case_clause 152 %type<en> case_value case_value_list153 %type<sn> case_ label case_label_list152 %type<en> case_value 153 %type<sn> case_value_list case_label case_label_list 154 154 %type<sn> switch_clause_list_opt switch_clause_list choose_clause_list_opt choose_clause_list 155 155 %type<pn> handler_list handler_clause finally_clause … … 717 717 // *before* the transfer to the appropriate case clause by hoisting the declarations into a compound 718 718 // 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. 720 721 $$ = $7 != 0 ? new CompoundStmtNode( (StatementNode *)((new StatementNode( $7 ))->set_link( sw )) ) : sw; 721 722 } … … 740 741 741 742 case_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 ) ) ); } 745 745 ; 746 746 747 747 case_label: // CFA 748 CASE case_value_list ':' { $$ = new StatementNode( StatementNode::Case, $2, 0 ); }748 CASE case_value_list ':' { $$ = $2; } 749 749 | DEFAULT ':' { $$ = new StatementNode( StatementNode::Default ); } 750 750 // 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.