Changes in src/Parser/parser.yy [8b47e50:307a732]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r8b47e50 r307a732 9 9 // Author : Peter A. Buhr 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Jul 12 18:23:36201713 // Update Count : 24 2611 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Jun 30 15:38:00 2017 13 // Update Count : 2415 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 WITH// CFA131 %token CHOOSE DISABLE ENABLE FALLTHRU TRY CATCH CATCHRESUME FINALLY THROW THROWRESUME AT // 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 187 %type<sn> with_statement exception_statement asm_statement 186 %type<sn> iteration_statement jump_statement exception_statement asm_statement 188 187 %type<sn> fall_through_opt fall_through 189 188 %type<sn> statement statement_list 190 189 %type<sn> block_item_list block_item 191 %type<sn> with_clause_opt190 %type<sn> case_clause 192 191 %type<en> case_value 193 %type<sn> case_ clause case_value_list case_label case_label_list192 %type<sn> case_value_list case_label case_label_list 194 193 %type<sn> switch_clause_list_opt switch_clause_list choose_clause_list_opt choose_clause_list 195 194 %type<sn> /* handler_list */ handler_clause finally_clause … … 730 729 | iteration_statement 731 730 | jump_statement 732 | with_statement733 731 | exception_statement 734 732 | asm_statement … … 936 934 | THROWRESUME assignment_expression_opt AT assignment_expression ';' // handles reresume 937 935 { $$ = new StatementNode( build_resume_at( $2, $4 ) ); } 938 ;939 940 with_statement:941 WITH identifier_list compound_statement942 { $$ = (StatementNode *)0; } // FIX ME943 936 ; 944 937 … … 2183 2176 { 2184 2177 linkageStack.push( linkage ); // handle nested extern "C"/"Cforall" 2185 linkage = LinkageSpec::linkage Update( linkage,$2 );2178 linkage = LinkageSpec::linkageCheck( $2 ); 2186 2179 } 2187 2180 '{' external_definition_list_opt '}' … … 2219 2212 ; 2220 2213 2221 with_clause_opt:2222 // empty2223 { $$ = (StatementNode *)0; } // FIX ME2224 | WITH identifier_list2225 { $$ = (StatementNode *)0; } // FIX ME2226 ;2227 2228 2214 function_definition: 2229 cfa_function_declaration with_clause_opt compound_statement// CFA2215 cfa_function_declaration compound_statement // CFA 2230 2216 { 2231 2217 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2232 2218 typedefTable.leaveScope(); 2233 $$ = $1->addFunctionBody( $ 3);2234 } 2235 | declaration_specifier function_declarator with_clause_optcompound_statement2219 $$ = $1->addFunctionBody( $2 ); 2220 } 2221 | declaration_specifier function_declarator compound_statement 2236 2222 { 2237 2223 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2238 2224 typedefTable.leaveScope(); 2239 $$ = $2->addFunctionBody( $ 4)->addType( $1 );2240 } 2241 | type_qualifier_list function_declarator with_clause_optcompound_statement2225 $$ = $2->addFunctionBody( $3 )->addType( $1 ); 2226 } 2227 | type_qualifier_list function_declarator compound_statement 2242 2228 { 2243 2229 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2244 2230 typedefTable.leaveScope(); 2245 $$ = $2->addFunctionBody( $ 4)->addQualifiers( $1 );2246 } 2247 | declaration_qualifier_list function_declarator with_clause_optcompound_statement2231 $$ = $2->addFunctionBody( $3 )->addQualifiers( $1 ); 2232 } 2233 | declaration_qualifier_list function_declarator compound_statement 2248 2234 { 2249 2235 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2250 2236 typedefTable.leaveScope(); 2251 $$ = $2->addFunctionBody( $ 4)->addQualifiers( $1 );2252 } 2253 | declaration_qualifier_list type_qualifier_list function_declarator with_clause_optcompound_statement2237 $$ = $2->addFunctionBody( $3 )->addQualifiers( $1 ); 2238 } 2239 | declaration_qualifier_list type_qualifier_list function_declarator compound_statement 2254 2240 { 2255 2241 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2256 2242 typedefTable.leaveScope(); 2257 $$ = $3->addFunctionBody( $ 5)->addQualifiers( $2 )->addQualifiers( $1 );2243 $$ = $3->addFunctionBody( $4 )->addQualifiers( $2 )->addQualifiers( $1 ); 2258 2244 } 2259 2245 2260 2246 // Old-style K&R function definition, OBSOLESCENT (see 4) 2261 | declaration_specifier KR_function_declarator push KR_declaration_list_opt with_clause_optcompound_statement2247 | declaration_specifier KR_function_declarator push KR_declaration_list_opt compound_statement 2262 2248 { 2263 2249 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2264 2250 typedefTable.leaveScope(); 2265 $$ = $2->addOldDeclList( $4 )->addFunctionBody( $ 6)->addType( $1 );2266 } 2267 | type_qualifier_list KR_function_declarator push KR_declaration_list_opt with_clause_optcompound_statement2251 $$ = $2->addOldDeclList( $4 )->addFunctionBody( $5 )->addType( $1 ); 2252 } 2253 | type_qualifier_list KR_function_declarator push KR_declaration_list_opt compound_statement 2268 2254 { 2269 2255 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2270 2256 typedefTable.leaveScope(); 2271 $$ = $2->addOldDeclList( $4 )->addFunctionBody( $ 6)->addQualifiers( $1 );2257 $$ = $2->addOldDeclList( $4 )->addFunctionBody( $5 )->addQualifiers( $1 ); 2272 2258 } 2273 2259 2274 2260 // Old-style K&R function definition with "implicit int" type_specifier, OBSOLESCENT (see 4) 2275 | declaration_qualifier_list KR_function_declarator push KR_declaration_list_opt with_clause_optcompound_statement2261 | declaration_qualifier_list KR_function_declarator push KR_declaration_list_opt compound_statement 2276 2262 { 2277 2263 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2278 2264 typedefTable.leaveScope(); 2279 $$ = $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_optcompound_statement2265 $$ = $2->addOldDeclList( $4 )->addFunctionBody( $5 )->addQualifiers( $1 ); 2266 } 2267 | declaration_qualifier_list type_qualifier_list KR_function_declarator push KR_declaration_list_opt compound_statement 2282 2268 { 2283 2269 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2284 2270 typedefTable.leaveScope(); 2285 $$ = $3->addOldDeclList( $5 )->addFunctionBody( $ 7)->addQualifiers( $2 )->addQualifiers( $1 );2271 $$ = $3->addOldDeclList( $5 )->addFunctionBody( $6 )->addQualifiers( $2 )->addQualifiers( $1 ); 2286 2272 } 2287 2273 ; … … 2346 2332 | TYPEGENname 2347 2333 | CONST 2348 { $$ = Token{ new string( "__const__" ) , { nullptr, -1 }}; }2334 { $$ = Token{ new string( "__const__" ) }; } 2349 2335 ; 2350 2336
Note:
See TracChangeset
for help on using the changeset viewer.