Changeset 9fa61f5
- Timestamp:
- Mar 14, 2023, 11:19:51 AM (21 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- a96ce07
- Parents:
- 15596d7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r15596d7 r9fa61f5 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 25 13:23:16202313 // Update Count : 59 8912 // Last Modified On : Tue Mar 14 09:37:58 2023 13 // Update Count : 5990 14 14 // 15 15 … … 2055 2055 basic_type_specifier 2056 2056 | sue_type_specifier 2057 {2058 // printf( "sue_type_specifier2 %p %s\n", $$, $$->type->aggregate.name ? $$->type->aggregate.name->c_str() : "(nil)" );2059 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) {2060 // printf( "\tattr %s\n", attr->name.c_str() );2061 // } // for2062 }2063 2057 | type_type_specifier 2064 2058 ; … … 2400 2394 '{' field_declaration_list_opt '}' type_parameters_opt 2401 2395 { 2402 // printf( "aggregate_type1 %s\n", $3.str->c_str() );2403 // if ( $2 )2404 // for ( Attribute * attr: reverseIterate( $2->attributes ) ) {2405 // printf( "copySpecifiers12 %s\n", attr->name.c_str() );2406 // } // for2407 2396 $$ = DeclarationNode::newAggregate( $1, $3, $8, $6, true )->addQualifiers( $2 ); 2408 // printf( "aggregate_type2 %p %s\n", $$, $$->type->aggregate.name ? $$->type->aggregate.name->c_str() : "(nil)" );2409 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) {2410 // printf( "aggregate_type3 %s\n", attr->name.c_str() );2411 // } // for2412 2397 } 2413 2398 | aggregate_key attribute_list_opt TYPEDEFname // unqualified type name … … 2418 2403 '{' field_declaration_list_opt '}' type_parameters_opt 2419 2404 { 2420 // printf( "AGG3\n" );2421 2405 DeclarationNode::newFromTypedef( $3 ); 2422 2406 $$ = DeclarationNode::newAggregate( $1, $3, $8, $6, true )->addQualifiers( $2 ); … … 2429 2413 '{' field_declaration_list_opt '}' type_parameters_opt 2430 2414 { 2431 // printf( "AGG4\n" );2432 2415 DeclarationNode::newFromTypeGen( $3, nullptr ); 2433 2416 $$ = DeclarationNode::newAggregate( $1, $3, $8, $6, true )->addQualifiers( $2 ); … … 2456 2439 // switched to a TYPEGENname. Link any generic arguments from typegen_name to new generic declaration and 2457 2440 // delete newFromTypeGen. 2458 $$ = DeclarationNode::newAggregate( $1, $3->type->symbolic.name, $3->type->symbolic.actuals, nullptr, false )->addQualifiers( $2 ); 2459 $3->type->symbolic.name = nullptr; 2460 $3->type->symbolic.actuals = nullptr; 2461 delete $3; 2441 if ( $3->type->kind == TypeData::SymbolicInst && ! $3->type->symbolic.isTypedef ) { 2442 $$ = $3->addQualifiers( $2 ); 2443 } else { 2444 $$ = DeclarationNode::newAggregate( $1, $3->type->symbolic.name, $3->type->symbolic.actuals, nullptr, false )->addQualifiers( $2 ); 2445 $3->type->symbolic.name = nullptr; // copied to $$ 2446 $3->type->symbolic.actuals = nullptr; 2447 delete $3; 2448 } 2462 2449 } 2463 2450 ; … … 2796 2783 type_no_function: // sizeof, alignof, cast (constructor) 2797 2784 cfa_abstract_declarator_tuple // CFA 2798 | type_specifier 2785 | type_specifier // cannot be type_specifier_nobody, e.g., (struct S {}){} is a thing 2799 2786 | type_specifier abstract_declarator 2800 2787 { $$ = $2->addType( $1 ); }
Note: See TracChangeset
for help on using the changeset viewer.