Changeset 63be3387 for src/Parser/parser.yy
- Timestamp:
- Nov 14, 2022, 11:52:44 AM (3 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 7d9598d8
- Parents:
- b77f0e1 (diff), 19a8c40 (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
rb77f0e1 r63be3387 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Oct 14 14:04:43202213 // Update Count : 5 75112 // Last Modified On : Wed Nov 2 21:31:21 2022 13 // Update Count : 5810 14 14 // 15 15 … … 278 278 279 279 // Types declaration for productions 280 280 281 %union { 281 282 Token tok; … … 290 291 CondCtl * ifctl; 291 292 ForCtrl * fctl; 292 enumOperKinds compop;293 OperKinds compop; 293 294 LabelNode * label; 294 295 InitializerNode * in; … … 296 297 std::string * str; 297 298 bool flag; 299 EnumHiding hide; 298 300 CatchStmt::Kind catch_kind; 299 301 GenericExpr * genexpr; … … 364 366 %type<constant> string_literal 365 367 %type<str> string_literal_list 368 369 %type<hide> hide_opt visible_hide_opt 366 370 367 371 // expressions … … 2553 2557 | ENUM attribute_list_opt identifier 2554 2558 { typedefTable.makeTypedef( *$3 ); } 2555 '{' enumerator_list comma_opt '}'2556 { $$ = DeclarationNode::newEnum( $3, $6, true, false )->addQualifiers( $2 ); }2559 hide_opt '{' enumerator_list comma_opt '}' 2560 { $$ = DeclarationNode::newEnum( $3, $7, true, false )->addQualifiers( $2 ); } 2557 2561 | ENUM attribute_list_opt typedef_name // unqualified type name 2558 '{' enumerator_list comma_opt '}'2559 { $$ = DeclarationNode::newEnum( $3->name, $ 5, true, false )->addQualifiers( $2 ); }2562 hide_opt '{' enumerator_list comma_opt '}' 2563 { $$ = DeclarationNode::newEnum( $3->name, $6, true, false )->addQualifiers( $2 ); } 2560 2564 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt '{' enumerator_list comma_opt '}' 2561 2565 { … … 2574 2578 typedefTable.makeTypedef( *$6 ); 2575 2579 } 2576 '{' enumerator_list comma_opt '}'2577 { 2578 $$ = DeclarationNode::newEnum( $6, $1 0, true, true, $3 )->addQualifiers( $5 )->addQualifiers( $7 );2580 hide_opt '{' enumerator_list comma_opt '}' 2581 { 2582 $$ = DeclarationNode::newEnum( $6, $11, true, true, $3 )->addQualifiers( $5 )->addQualifiers( $7 ); 2579 2583 } 2580 2584 | ENUM '(' ')' attribute_list_opt identifier attribute_list_opt 2581 '{' enumerator_list comma_opt '}' 2582 { 2583 $$ = DeclarationNode::newEnum( $5, $8, true, true, nullptr )->addQualifiers( $4 )->addQualifiers( $6 ); 2584 } 2585 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt typedef_name attribute_list_opt '{' enumerator_list comma_opt '}' 2586 { 2587 $$ = DeclarationNode::newEnum( $6->name, $9, true, true, $3 )->addQualifiers( $5 )->addQualifiers( $7 ); 2588 } 2589 | ENUM '(' ')' attribute_list_opt typedef_name attribute_list_opt '{' enumerator_list comma_opt '}' 2590 { 2591 $$ = DeclarationNode::newEnum( $5->name, $8, true, true, nullptr )->addQualifiers( $4 )->addQualifiers( $6 ); 2585 hide_opt '{' enumerator_list comma_opt '}' 2586 { 2587 $$ = DeclarationNode::newEnum( $5, $9, true, true, nullptr )->addQualifiers( $4 )->addQualifiers( $6 ); 2588 } 2589 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt typedef_name attribute_list_opt 2590 hide_opt '{' enumerator_list comma_opt '}' 2591 { 2592 $$ = DeclarationNode::newEnum( $6->name, $10, true, true, $3 )->addQualifiers( $5 )->addQualifiers( $7 ); 2593 } 2594 | ENUM '(' ')' attribute_list_opt typedef_name attribute_list_opt 2595 hide_opt '{' enumerator_list comma_opt '}' 2596 { 2597 $$ = DeclarationNode::newEnum( $5->name, $9, true, true, nullptr )->addQualifiers( $4 )->addQualifiers( $6 ); 2592 2598 } 2593 2599 | enum_type_nobody 2600 ; 2601 2602 hide_opt: 2603 // empty 2604 { $$ = EnumHiding::Visible; } 2605 | '!' 2606 { $$ = EnumHiding::Hide; } 2594 2607 ; 2595 2608 … … 2602 2615 2603 2616 enumerator_list: 2604 identifier_or_type_name enumerator_value_opt2605 { $$ = DeclarationNode::newEnumValueGeneric( $ 1, $2); }2617 visible_hide_opt identifier_or_type_name enumerator_value_opt 2618 { $$ = DeclarationNode::newEnumValueGeneric( $2, $3 ); } 2606 2619 | INLINE type_name 2607 2620 { $$ = DeclarationNode::newEnumInLine( *$2->type->symbolic.name ); } 2608 | enumerator_list ',' identifier_or_type_name enumerator_value_opt2609 { $$ = $1->appendList( DeclarationNode::newEnumValueGeneric( $ 3, $4) ); }2621 | enumerator_list ',' visible_hide_opt identifier_or_type_name enumerator_value_opt 2622 { $$ = $1->appendList( DeclarationNode::newEnumValueGeneric( $4, $5 ) ); } 2610 2623 | enumerator_list ',' INLINE type_name enumerator_value_opt 2611 2624 { $$ = $1->appendList( DeclarationNode::newEnumValueGeneric( new string("inline"), nullptr ) ); } 2625 ; 2626 2627 visible_hide_opt: 2628 hide_opt 2629 | '^' 2630 { $$ = EnumHiding::Visible; } 2612 2631 ; 2613 2632
Note:
See TracChangeset
for help on using the changeset viewer.