Changeset 35b06a8 for src/Parser/parser.yy
- Timestamp:
- Jul 13, 2017, 1:51:02 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- d6ff3ff
- Parents:
- a0b3e32 (diff), e9a3c69d (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
ra0b3e32 r35b06a8 9 9 // Author : Peter A. Buhr 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 // Last Modified By : Andrew Beach12 // Last Modified On : Tus Jul 11 13:39:00201713 // Update Count : 24 1611 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jul 12 18:23:36 2017 13 // Update Count : 2426 14 14 // 15 15 … … 129 129 %token ATTRIBUTE EXTENSION // GCC 130 130 %token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN 131 %token CHOOSE DISABLE ENABLE FALLTHRU TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT // CFA131 %token CHOOSE DISABLE ENABLE FALLTHRU TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT WITH // CFA 132 132 %token ASM // C99, extension ISO/IEC 9899:1999 Section J.5.10(1) 133 133 %token ALIGNAS ALIGNOF GENERIC STATICASSERT // C11 … … 184 184 // statements 185 185 %type<sn> labeled_statement compound_statement expression_statement selection_statement 186 %type<sn> iteration_statement jump_statement exception_statement asm_statement 186 %type<sn> iteration_statement jump_statement 187 %type<sn> with_statement exception_statement asm_statement 187 188 %type<sn> fall_through_opt fall_through 188 189 %type<sn> statement statement_list 189 190 %type<sn> block_item_list block_item 190 %type<sn> case_clause191 %type<sn> with_clause_opt 191 192 %type<en> case_value 192 %type<sn> case_ value_list case_label case_label_list193 %type<sn> case_clause case_value_list case_label case_label_list 193 194 %type<sn> switch_clause_list_opt switch_clause_list choose_clause_list_opt choose_clause_list 194 195 %type<sn> /* handler_list */ handler_clause finally_clause … … 729 730 | iteration_statement 730 731 | jump_statement 732 | with_statement 731 733 | exception_statement 732 734 | asm_statement … … 934 936 | THROWRESUME assignment_expression_opt AT assignment_expression ';' // handles reresume 935 937 { $$ = new StatementNode( build_resume_at( $2, $4 ) ); } 938 ; 939 940 with_statement: 941 WITH identifier_list compound_statement 942 { $$ = (StatementNode *)0; } // FIX ME 936 943 ; 937 944 … … 2212 2219 ; 2213 2220 2221 with_clause_opt: 2222 // empty 2223 { $$ = (StatementNode *)0; } // FIX ME 2224 | WITH identifier_list 2225 { $$ = (StatementNode *)0; } // FIX ME 2226 ; 2227 2214 2228 function_definition: 2215 cfa_function_declaration compound_statement// CFA2229 cfa_function_declaration with_clause_opt compound_statement // CFA 2216 2230 { 2217 2231 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2218 2232 typedefTable.leaveScope(); 2219 $$ = $1->addFunctionBody( $ 2);2220 } 2221 | declaration_specifier function_declarator compound_statement2233 $$ = $1->addFunctionBody( $3 ); 2234 } 2235 | declaration_specifier function_declarator with_clause_opt compound_statement 2222 2236 { 2223 2237 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2224 2238 typedefTable.leaveScope(); 2225 $$ = $2->addFunctionBody( $ 3)->addType( $1 );2226 } 2227 | type_qualifier_list function_declarator compound_statement2239 $$ = $2->addFunctionBody( $4 )->addType( $1 ); 2240 } 2241 | type_qualifier_list function_declarator with_clause_opt compound_statement 2228 2242 { 2229 2243 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2230 2244 typedefTable.leaveScope(); 2231 $$ = $2->addFunctionBody( $ 3)->addQualifiers( $1 );2232 } 2233 | declaration_qualifier_list function_declarator compound_statement2245 $$ = $2->addFunctionBody( $4 )->addQualifiers( $1 ); 2246 } 2247 | declaration_qualifier_list function_declarator with_clause_opt compound_statement 2234 2248 { 2235 2249 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2236 2250 typedefTable.leaveScope(); 2237 $$ = $2->addFunctionBody( $ 3)->addQualifiers( $1 );2238 } 2239 | declaration_qualifier_list type_qualifier_list function_declarator compound_statement2251 $$ = $2->addFunctionBody( $4 )->addQualifiers( $1 ); 2252 } 2253 | declaration_qualifier_list type_qualifier_list function_declarator with_clause_opt compound_statement 2240 2254 { 2241 2255 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2242 2256 typedefTable.leaveScope(); 2243 $$ = $3->addFunctionBody( $ 4)->addQualifiers( $2 )->addQualifiers( $1 );2257 $$ = $3->addFunctionBody( $5 )->addQualifiers( $2 )->addQualifiers( $1 ); 2244 2258 } 2245 2259 2246 2260 // Old-style K&R function definition, OBSOLESCENT (see 4) 2247 | declaration_specifier KR_function_declarator push KR_declaration_list_opt compound_statement2261 | declaration_specifier KR_function_declarator push KR_declaration_list_opt with_clause_opt compound_statement 2248 2262 { 2249 2263 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2250 2264 typedefTable.leaveScope(); 2251 $$ = $2->addOldDeclList( $4 )->addFunctionBody( $ 5)->addType( $1 );2252 } 2253 | type_qualifier_list KR_function_declarator push KR_declaration_list_opt compound_statement2265 $$ = $2->addOldDeclList( $4 )->addFunctionBody( $6 )->addType( $1 ); 2266 } 2267 | type_qualifier_list KR_function_declarator push KR_declaration_list_opt with_clause_opt compound_statement 2254 2268 { 2255 2269 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2256 2270 typedefTable.leaveScope(); 2257 $$ = $2->addOldDeclList( $4 )->addFunctionBody( $ 5)->addQualifiers( $1 );2271 $$ = $2->addOldDeclList( $4 )->addFunctionBody( $6 )->addQualifiers( $1 ); 2258 2272 } 2259 2273 2260 2274 // Old-style K&R function definition with "implicit int" type_specifier, OBSOLESCENT (see 4) 2261 | declaration_qualifier_list KR_function_declarator push KR_declaration_list_opt compound_statement2275 | declaration_qualifier_list KR_function_declarator push KR_declaration_list_opt with_clause_opt compound_statement 2262 2276 { 2263 2277 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2264 2278 typedefTable.leaveScope(); 2265 $$ = $2->addOldDeclList( $4 )->addFunctionBody( $ 5)->addQualifiers( $1 );2266 } 2267 | declaration_qualifier_list type_qualifier_list KR_function_declarator push KR_declaration_list_opt compound_statement2279 $$ = $2->addOldDeclList( $4 )->addFunctionBody( $6 )->addQualifiers( $1 ); 2280 } 2281 | declaration_qualifier_list type_qualifier_list KR_function_declarator push KR_declaration_list_opt with_clause_opt compound_statement 2268 2282 { 2269 2283 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2270 2284 typedefTable.leaveScope(); 2271 $$ = $3->addOldDeclList( $5 )->addFunctionBody( $ 6)->addQualifiers( $2 )->addQualifiers( $1 );2285 $$ = $3->addOldDeclList( $5 )->addFunctionBody( $7 )->addQualifiers( $2 )->addQualifiers( $1 ); 2272 2286 } 2273 2287 ;
Note: See TracChangeset
for help on using the changeset viewer.