- Timestamp:
- Jan 10, 2021, 5:47:10 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 64aeca0
- Parents:
- a6e5091
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
ra6e5091 r5a51798 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S at Oct 24 08:21:14 202013 // Update Count : 462 412 // Last Modified On : Sun Jan 10 17:41:00 2021 13 // Update Count : 4625 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 … … 2223 2223 ; 2224 2224 2225 cfa_parameter_ellipsis_list_opt: 2225 cfa_parameter_ellipsis_list_opt: // CFA, abstract + real 2226 2226 // empty 2227 2227 { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); } … … 2280 2280 cfa_parameter_declaration: // CFA, new & old style parameter declaration 2281 2281 parameter_declaration 2282 | cfa_identifier_parameter_declarator_no_tuple identifier_or_type_name default_initialize _opt2282 | cfa_identifier_parameter_declarator_no_tuple identifier_or_type_name default_initializer_opt 2283 2283 { $$ = $1->addName( $2 ); } 2284 | cfa_abstract_tuple identifier_or_type_name default_initialize _opt2284 | cfa_abstract_tuple identifier_or_type_name default_initializer_opt 2285 2285 // To obtain LR(1), these rules must be duplicated here (see cfa_abstract_declarator). 2286 2286 { $$ = $1->addName( $2 ); } 2287 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name default_initialize _opt2287 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name default_initializer_opt 2288 2288 { $$ = $2->addName( $3 )->addQualifiers( $1 ); } 2289 2289 | cfa_function_specifier … … 2302 2302 parameter_declaration: 2303 2303 // No SUE declaration in parameter list. 2304 declaration_specifier_nobody identifier_parameter_declarator default_initialize _opt2304 declaration_specifier_nobody identifier_parameter_declarator default_initializer_opt 2305 2305 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 2306 | declaration_specifier_nobody type_parameter_redeclarator default_initialize _opt2306 | declaration_specifier_nobody type_parameter_redeclarator default_initializer_opt 2307 2307 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 2308 2308 ; 2309 2309 2310 2310 abstract_parameter_declaration: 2311 declaration_specifier_nobody default_initialize _opt2311 declaration_specifier_nobody default_initializer_opt 2312 2312 { $$ = $1->addInitializer( $2 ? new InitializerNode( $2 ) : nullptr ); } 2313 | declaration_specifier_nobody abstract_parameter_declarator default_initialize _opt2313 | declaration_specifier_nobody abstract_parameter_declarator default_initializer_opt 2314 2314 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 2315 2315 ; … … 2441 2441 type_class identifier_or_type_name 2442 2442 { typedefTable.addToScope( *$2, TYPEDEFname, "9" ); } 2443 type_initializer_opt assertion_list_opt2443 type_initializer_opt assertion_list_opt 2444 2444 { $$ = DeclarationNode::newTypeParam( $1, $2 )->addTypeInitializer( $4 )->addAssertions( $5 ); } 2445 | type_specifier identifier_parameter_declarator 2445 | identifier_or_type_name new_type_class 2446 { typedefTable.addToScope( *$1, TYPEDEFname, "9" ); } 2447 type_initializer_opt assertion_list_opt 2448 { $$ = DeclarationNode::newTypeParam( $2, $1 )->addTypeInitializer( $4 )->addAssertions( $5 ); } 2449 | '[' identifier_or_type_name ']' 2450 { typedefTable.addToScope( *$2, TYPEDEFname, "9" ); } 2451 // | type_specifier identifier_parameter_declarator 2446 2452 | assertion_list 2447 2453 { $$ = DeclarationNode::newTypeParam( TypeDecl::Dtype, new string( DeclarationNode::anonymous.newName() ) )->addAssertions( $1 ); } 2454 ; 2455 2456 new_type_class: // CFA 2457 // empty 2458 { $$ = TypeDecl::Otype; } 2459 | '&' 2460 { $$ = TypeDecl::Dtype; } 2461 | '*' 2462 { $$ = TypeDecl::Dtype; } 2463 | ELLIPSIS 2464 { $$ = TypeDecl::Ttype; } 2448 2465 ; 2449 2466 … … 3476 3493 ; 3477 3494 3478 default_initialize _opt:3495 default_initializer_opt: 3479 3496 // empty 3480 3497 { $$ = nullptr; }
Note: See TracChangeset
for help on using the changeset viewer.