Changeset 9997fee
- Timestamp:
- Apr 28, 2018, 10:34:40 AM (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, with_gc
- Children:
- 534d84e
- Parents:
- 6926a6d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r6926a6d r9997fee 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Apr 17 17:10:30201813 // Update Count : 3 14412 // Last Modified On : Sat Apr 28 09:37:03 2018 13 // Update Count : 3201 14 14 // 15 15 … … 133 133 } // build_postfix_name 134 134 135 bool forall = false ;// aggregate have one or more forall qualifiers ?135 bool forall = false, xxx = 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 _opt284 %type<decl> assertion assertion_list 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 update 1869 forall = false; // reset 1868 1870 $$ = DeclarationNode::newAggregate( $1, $3, nullptr, nullptr, false )->addQualifiers( $2 ); 1869 1871 } … … 2235 2237 { $$ = DeclarationNode::newTypeParam( $1, $2 )->addTypeInitializer( $4 )->addAssertions( $5 ); } 2236 2238 | type_specifier identifier_parameter_declarator 2239 | assertion_list 2240 { $$ = DeclarationNode::newTypeParam( DeclarationNode::Dtype, new string( DeclarationNode::anonymous.newName() ) )->addAssertions( $1 ); } 2237 2241 ; 2238 2242 … … 2251 2255 // empty 2252 2256 { $$ = nullptr; } 2253 | assertion_list_opt assertion 2257 | assertion_list 2258 ; 2259 2260 assertion_list: // CFA 2261 assertion 2262 | assertion_list assertion 2254 2263 { $$ = $1 ? $1->appendList( $2 ) : $2; } 2255 2264 ; … … 2378 2387 external_definition_list: 2379 2388 external_definition 2380 | external_definition_list push external_definition2381 { $$ = $1 ? $1->appendList( $ 3 ) : $3; }2389 | external_definition_list { forall = xxx; } push external_definition 2390 { $$ = $1 ? $1->appendList( $4 ) : $4; } 2382 2391 ; 2383 2392 … … 2411 2420 $$ = $2; 2412 2421 } 2413 | type_qualifier_list '{' external_definition_list '}' // CFA, namespace 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 } 2414 2463 ; 2415 2464 … … 2437 2486 with_clause_opt: 2438 2487 // empty 2439 { $$ = nullptr; }2488 { $$ = nullptr; forall = false; } 2440 2489 | WITH '(' tuple_expression_list ')' 2441 { $$ = $3; }2490 { $$ = $3; forall = false; } 2442 2491 ; 2443 2492
Note: See TracChangeset
for help on using the changeset viewer.