Changes in src/Parser/parser.yy [a025ea8:b66d14a]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
ra025ea8 rb66d14a 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Oct 24 08:21:14 202013 // Update Count : 46 2412 // Last Modified On : Mon Jan 11 21:32:10 2021 13 // Update Count : 4633 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 _opt331 %type<en> argument_expression_list_opt argument_expression default_initializer_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 426 %type<tclass> type_class new_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; } 1547 1548 | trait_specifier 1548 1549 ; … … 2223 2224 ; 2224 2225 2225 cfa_parameter_ellipsis_list_opt: // CFA, abstract + real2226 cfa_parameter_ellipsis_list_opt: // CFA, abstract + real 2226 2227 // empty 2227 2228 { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); } … … 2280 2281 cfa_parameter_declaration: // CFA, new & old style parameter declaration 2281 2282 parameter_declaration 2282 | cfa_identifier_parameter_declarator_no_tuple identifier_or_type_name default_initialize _opt2283 | cfa_identifier_parameter_declarator_no_tuple identifier_or_type_name default_initializer_opt 2283 2284 { $$ = $1->addName( $2 ); } 2284 | cfa_abstract_tuple identifier_or_type_name default_initialize _opt2285 | cfa_abstract_tuple identifier_or_type_name default_initializer_opt 2285 2286 // To obtain LR(1), these rules must be duplicated here (see cfa_abstract_declarator). 2286 2287 { $$ = $1->addName( $2 ); } 2287 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name default_initialize _opt2288 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name default_initializer_opt 2288 2289 { $$ = $2->addName( $3 )->addQualifiers( $1 ); } 2289 2290 | cfa_function_specifier … … 2302 2303 parameter_declaration: 2303 2304 // No SUE declaration in parameter list. 2304 declaration_specifier_nobody identifier_parameter_declarator default_initialize _opt2305 declaration_specifier_nobody identifier_parameter_declarator default_initializer_opt 2305 2306 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 2306 | declaration_specifier_nobody type_parameter_redeclarator default_initialize _opt2307 | declaration_specifier_nobody type_parameter_redeclarator default_initializer_opt 2307 2308 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 2308 2309 ; 2309 2310 2310 2311 abstract_parameter_declaration: 2311 declaration_specifier_nobody default_initialize _opt2312 declaration_specifier_nobody default_initializer_opt 2312 2313 { $$ = $1->addInitializer( $2 ? new InitializerNode( $2 ) : nullptr ); } 2313 | declaration_specifier_nobody abstract_parameter_declarator default_initialize _opt2314 | declaration_specifier_nobody abstract_parameter_declarator default_initializer_opt 2314 2315 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 2315 2316 ; … … 2441 2442 type_class identifier_or_type_name 2442 2443 { typedefTable.addToScope( *$2, TYPEDEFname, "9" ); } 2443 type_initializer_opt assertion_list_opt2444 type_initializer_opt assertion_list_opt 2444 2445 { $$ = DeclarationNode::newTypeParam( $1, $2 )->addTypeInitializer( $4 )->addAssertions( $5 ); } 2445 | type_specifier identifier_parameter_declarator 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 2446 2456 | assertion_list 2447 2457 { $$ = DeclarationNode::newTypeParam( TypeDecl::Dtype, new string( DeclarationNode::anonymous.newName() ) )->addAssertions( $1 ); } 2458 ; 2459 2460 new_type_class: // CFA 2461 // empty 2462 { $$ = TypeDecl::Otype; } 2463 | '&' 2464 { $$ = TypeDecl::Dtype; } 2465 | '*' 2466 { $$ = TypeDecl::DStype; } // dtype + sized 2467 | ELLIPSIS 2468 { $$ = TypeDecl::Ttype; } 2448 2469 ; 2449 2470 … … 3476 3497 ; 3477 3498 3478 default_initialize _opt:3499 default_initializer_opt: 3479 3500 // empty 3480 3501 { $$ = nullptr; }
Note:
See TracChangeset
for help on using the changeset viewer.