Changes in src/Parser/parser.yy [9997fee:9a705dc8]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r9997fee r9a705dc8 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Apr 28 09:37:03201813 // Update Count : 3 20112 // Last Modified On : Tue Apr 17 17:10:30 2018 13 // Update Count : 3144 14 14 // 15 15 … … 133 133 } // build_postfix_name 134 134 135 bool forall = false , xxx = false;// aggregate have one or more forall qualifiers ?135 bool forall = false; // aggregate have one or more forall qualifiers ? 136 136 137 137 // https://www.gnu.org/software/bison/manual/bison.html#Location-Type … … 282 282 %type<decl> aggregate_type aggregate_type_nobody 283 283 284 %type<decl> assertion assertion_list assertion_list_opt284 %type<decl> assertion assertion_list_opt 285 285 286 286 %type<en> bit_subrange_size_opt bit_subrange_size … … 1866 1866 { 1867 1867 typedefTable.makeTypedef( *$3 ); 1868 if ( forall ) typedefTable.changeKind( *$3, TypedefTable::TG ); // possibly update1869 forall = false; // reset1870 1868 $$ = DeclarationNode::newAggregate( $1, $3, nullptr, nullptr, false )->addQualifiers( $2 ); 1871 1869 } … … 2237 2235 { $$ = DeclarationNode::newTypeParam( $1, $2 )->addTypeInitializer( $4 )->addAssertions( $5 ); } 2238 2236 | type_specifier identifier_parameter_declarator 2239 | assertion_list2240 { $$ = DeclarationNode::newTypeParam( DeclarationNode::Dtype, new string( DeclarationNode::anonymous.newName() ) )->addAssertions( $1 ); }2241 2237 ; 2242 2238 … … 2255 2251 // empty 2256 2252 { $$ = nullptr; } 2257 | assertion_list 2258 ; 2259 2260 assertion_list: // CFA 2261 assertion 2262 | assertion_list assertion 2253 | assertion_list_opt assertion 2263 2254 { $$ = $1 ? $1->appendList( $2 ) : $2; } 2264 2255 ; … … 2387 2378 external_definition_list: 2388 2379 external_definition 2389 | external_definition_list { forall = xxx; }push external_definition2390 { $$ = $1 ? $1->appendList( $ 4 ) : $4; }2380 | external_definition_list push external_definition 2381 { $$ = $1 ? $1->appendList( $3 ) : $3; } 2391 2382 ; 2392 2383 … … 2420 2411 $$ = $2; 2421 2412 } 2422 | type_qualifier_list 2423 { 2424 if ( $1->type->forall ) xxx = forall = true; // remember generic type 2425 } 2426 push '{' external_definition_list '}' // CFA, namespace 2427 { 2428 for ( DeclarationNode * iter = $5; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 2429 iter->addQualifiers( $1->clone() ); 2430 } // for 2431 xxx = false; 2432 delete $1; 2433 $$ = $5; 2434 } 2435 | declaration_qualifier_list 2436 { 2437 if ( $1->type->forall ) xxx = forall = true; // remember generic type 2438 } 2439 push '{' external_definition_list '}' // CFA, namespace 2440 { 2441 for ( DeclarationNode * iter = $5; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 2442 iter->addQualifiers( $1->clone() ); 2443 } // for 2444 xxx = false; 2445 delete $1; 2446 $$ = $5; 2447 } 2448 | declaration_qualifier_list type_qualifier_list 2449 { 2450 if ( $1->type->forall ) xxx = forall = true; // remember generic type 2451 } 2452 push '{' external_definition_list '}' // CFA, namespace 2453 { 2454 for ( DeclarationNode * iter = $6; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 2455 iter->addQualifiers( $1->clone() ); 2456 iter->addQualifiers( $2->clone() ); 2457 } // for 2458 xxx = false; 2459 delete $1; 2460 delete $2; 2461 $$ = $6; 2462 } 2413 | type_qualifier_list '{' external_definition_list '}' // CFA, namespace 2463 2414 ; 2464 2415 … … 2486 2437 with_clause_opt: 2487 2438 // empty 2488 { $$ = nullptr; forall = false;}2439 { $$ = nullptr; } 2489 2440 | WITH '(' tuple_expression_list ')' 2490 { $$ = $3; forall = false;}2441 { $$ = $3; } 2491 2442 ; 2492 2443
Note:
See TracChangeset
for help on using the changeset viewer.