Changes in src/Parser/parser.yy [b66d14a:a025ea8]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
rb66d14a ra025ea8 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jan 11 21:32:10 202113 // Update Count : 46 3312 // Last Modified On : Sat Oct 24 08:21:14 2020 13 // Update Count : 4624 14 14 // 15 15 … … 329 329 %type<en> conditional_expression constant_expression assignment_expression assignment_expression_opt 330 330 %type<en> comma_expression comma_expression_opt 331 %type<en> argument_expression_list_opt argument_expression default_initialize r_opt331 %type<en> argument_expression_list_opt argument_expression default_initialize_opt 332 332 %type<ifctl> if_control_expression 333 333 %type<fctl> for_control_expression for_control_expression_list … … 424 424 %type<decl> sue_declaration_specifier sue_declaration_specifier_nobody sue_type_specifier sue_type_specifier_nobody 425 425 426 %type<tclass> type_class new_type_class426 %type<tclass> type_class 427 427 %type<decl> type_declarator type_declarator_name type_declaring_list 428 428 … … 1545 1545 | cfa_function_declaration 1546 1546 | type_declaring_list 1547 { SemanticError( yylloc, "otype declaration is currently unimplemented." ); $$ = nullptr; }1548 1547 | trait_specifier 1549 1548 ; … … 2224 2223 ; 2225 2224 2226 cfa_parameter_ellipsis_list_opt: // CFA, abstract + real2225 cfa_parameter_ellipsis_list_opt: // CFA, abstract + real 2227 2226 // empty 2228 2227 { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); } … … 2281 2280 cfa_parameter_declaration: // CFA, new & old style parameter declaration 2282 2281 parameter_declaration 2283 | cfa_identifier_parameter_declarator_no_tuple identifier_or_type_name default_initialize r_opt2282 | cfa_identifier_parameter_declarator_no_tuple identifier_or_type_name default_initialize_opt 2284 2283 { $$ = $1->addName( $2 ); } 2285 | cfa_abstract_tuple identifier_or_type_name default_initialize r_opt2284 | cfa_abstract_tuple identifier_or_type_name default_initialize_opt 2286 2285 // To obtain LR(1), these rules must be duplicated here (see cfa_abstract_declarator). 2287 2286 { $$ = $1->addName( $2 ); } 2288 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name default_initialize r_opt2287 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name default_initialize_opt 2289 2288 { $$ = $2->addName( $3 )->addQualifiers( $1 ); } 2290 2289 | cfa_function_specifier … … 2303 2302 parameter_declaration: 2304 2303 // No SUE declaration in parameter list. 2305 declaration_specifier_nobody identifier_parameter_declarator default_initialize r_opt2304 declaration_specifier_nobody identifier_parameter_declarator default_initialize_opt 2306 2305 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 2307 | declaration_specifier_nobody type_parameter_redeclarator default_initialize r_opt2306 | declaration_specifier_nobody type_parameter_redeclarator default_initialize_opt 2308 2307 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 2309 2308 ; 2310 2309 2311 2310 abstract_parameter_declaration: 2312 declaration_specifier_nobody default_initialize r_opt2311 declaration_specifier_nobody default_initialize_opt 2313 2312 { $$ = $1->addInitializer( $2 ? new InitializerNode( $2 ) : nullptr ); } 2314 | declaration_specifier_nobody abstract_parameter_declarator default_initialize r_opt2313 | declaration_specifier_nobody abstract_parameter_declarator default_initialize_opt 2315 2314 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 2316 2315 ; … … 2442 2441 type_class identifier_or_type_name 2443 2442 { typedefTable.addToScope( *$2, TYPEDEFname, "9" ); } 2444 type_initializer_opt assertion_list_opt2443 type_initializer_opt assertion_list_opt 2445 2444 { $$ = DeclarationNode::newTypeParam( $1, $2 )->addTypeInitializer( $4 )->addAssertions( $5 ); } 2446 | identifier_or_type_name new_type_class 2447 { typedefTable.addToScope( *$1, TYPEDEFname, "9" ); } 2448 type_initializer_opt assertion_list_opt 2449 { $$ = DeclarationNode::newTypeParam( $2, $1 )->addTypeInitializer( $4 )->addAssertions( $5 ); } 2450 | '[' identifier_or_type_name ']' 2451 { 2452 typedefTable.addToScope( *$2, TYPEDEFname, "9" ); 2453 $$ = DeclarationNode::newTypeParam( TypeDecl::ALtype, $2 ); 2454 } 2455 // | type_specifier identifier_parameter_declarator 2445 | type_specifier identifier_parameter_declarator 2456 2446 | assertion_list 2457 2447 { $$ = DeclarationNode::newTypeParam( TypeDecl::Dtype, new string( DeclarationNode::anonymous.newName() ) )->addAssertions( $1 ); } 2458 ;2459 2460 new_type_class: // CFA2461 // empty2462 { $$ = TypeDecl::Otype; }2463 | '&'2464 { $$ = TypeDecl::Dtype; }2465 | '*'2466 { $$ = TypeDecl::DStype; } // dtype + sized2467 | ELLIPSIS2468 { $$ = TypeDecl::Ttype; }2469 2448 ; 2470 2449 … … 3497 3476 ; 3498 3477 3499 default_initialize r_opt:3478 default_initialize_opt: 3500 3479 // empty 3501 3480 { $$ = nullptr; }
Note:
See TracChangeset
for help on using the changeset viewer.