Changeset 358cba0 for src/Parser/parser.yy
- Timestamp:
- May 15, 2018, 4:17:15 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 2e5fa345
- Parents:
- 7d0a3ba (diff), a61fa0bb (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
-
src/Parser/parser.yy (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r7d0a3ba r358cba0 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu May 3 08:20:09201813 // Update Count : 32 2512 // Last Modified On : Fri May 11 17:51:38 2018 13 // Update Count : 3261 14 14 // 15 15 … … 302 302 303 303 %type<decl> field_declaration field_declaration_list field_declarator field_declaring_list 304 %type<en> field field_list field_name fraction_constants 304 %type<en> field field_list field_name fraction_constants_opt 305 305 306 306 %type<decl> external_function_definition function_definition function_array function_declarator function_no_ptr function_ptr … … 499 499 | type_name '.' no_attr_identifier // CFA, nested type 500 500 { SemanticError( yylloc, "Qualified names are currently unimplemented." ); $$ = nullptr; } 501 // { $$ = nullptr; } 501 502 | type_name '.' '[' push field_list pop ']' // CFA, nested type / tuple field selector 502 503 { SemanticError( yylloc, "Qualified names are currently unimplemented." ); $$ = nullptr; } 504 // { $$ = nullptr; } 503 505 | GENERIC '(' assignment_expression ',' generic_assoc_list ')' // C11 504 506 { SemanticError( yylloc, "_Generic is currently unimplemented." ); $$ = nullptr; } … … 533 535 | postfix_expression '.' no_attr_identifier 534 536 { $$ = new ExpressionNode( build_fieldSel( $1, build_varref( $3 ) ) ); } 537 | postfix_expression '.' INTEGERconstant // CFA, tuple index 538 { $$ = new ExpressionNode( build_fieldSel( $1, build_constantInteger( *$3 ) ) ); } 539 | postfix_expression FLOATING_FRACTIONconstant // CFA, tuple index 540 { $$ = new ExpressionNode( build_fieldSel( $1, build_field_name_FLOATING_FRACTIONconstant( *$2 ) ) ); } 535 541 | postfix_expression '.' '[' push field_list pop ']' // CFA, tuple field selector 536 542 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $5 ) ) ); } 537 | postfix_expression FLOATING_FRACTIONconstant // CFA, tuple index538 { $$ = new ExpressionNode( build_fieldSel( $1, build_field_name_FLOATING_FRACTIONconstant( *$2 ) ) ); }539 543 | postfix_expression ARROW no_attr_identifier 540 544 { 541 545 $$ = new ExpressionNode( build_pfieldSel( $1, *$3 == "0" || *$3 == "1" ? build_constantInteger( *$3 ) : build_varref( $3 ) ) ); 542 546 } 543 | postfix_expression ARROW '[' push field_list pop ']' // CFA, tuple field selector544 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $5 ) ) ); }545 547 | postfix_expression ARROW INTEGERconstant // CFA, tuple index 546 548 { $$ = new ExpressionNode( build_pfieldSel( $1, build_constantInteger( *$3 ) ) ); } 549 | postfix_expression ARROW '[' push field_list pop ']' // CFA, tuple field selector 550 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $5 ) ) ); } 547 551 | postfix_expression ICR 548 552 { $$ = new ExpressionNode( build_unary_ptr( OperKinds::IncrPost, $1 ) ); } … … 597 601 598 602 field_name: 599 INTEGERconstant fraction_constants 603 INTEGERconstant fraction_constants_opt 600 604 { $$ = new ExpressionNode( build_field_name_fraction_constants( build_constantInteger( *$1 ), $2 ) ); } 601 | FLOATINGconstant fraction_constants 605 | FLOATINGconstant fraction_constants_opt 602 606 { $$ = new ExpressionNode( build_field_name_fraction_constants( build_field_name_FLOATINGconstant( *$1 ), $2 ) ); } 603 | no_attr_identifier fraction_constants 607 | no_attr_identifier fraction_constants_opt 604 608 { 605 609 $$ = new ExpressionNode( build_field_name_fraction_constants( build_varref( $1 ), $2 ) ); … … 607 611 ; 608 612 609 fraction_constants :613 fraction_constants_opt: 610 614 // empty 611 615 { $$ = nullptr; } 612 | fraction_constants FLOATING_FRACTIONconstant616 | fraction_constants_opt FLOATING_FRACTIONconstant 613 617 { 614 618 Expression * constant = build_field_name_FLOATING_FRACTIONconstant( *$2 ); … … 2390 2394 external_definition_list: 2391 2395 external_definition 2392 | external_definition_list { forall = xxx; } push external_definition 2396 | external_definition_list 2397 { forall = xxx; } 2398 push external_definition 2393 2399 { $$ = $1 ? $1->appendList( $4 ) : $4; } 2394 2400 ; … … 2430 2436 { 2431 2437 for ( DeclarationNode * iter = $5; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 2432 iter->addQualifiers( $1->clone() ); 2438 if ( isMangled( iter->linkage ) ) { // ignore extern "C" 2439 iter->addQualifiers( $1->clone() ); 2440 } // if 2433 2441 } // for 2434 2442 xxx = false; … … 2443 2451 { 2444 2452 for ( DeclarationNode * iter = $5; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 2445 iter->addQualifiers( $1->clone() ); 2453 if ( isMangled( iter->linkage ) ) { // ignore extern "C" 2454 iter->addQualifiers( $1->clone() ); 2455 } // if 2446 2456 } // for 2447 2457 xxx = false; … … 2457 2467 { 2458 2468 for ( DeclarationNode * iter = $6; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 2459 iter->addQualifiers( $1->clone() ); 2460 iter->addQualifiers( $2->clone() ); 2469 if ( isMangled( iter->linkage ) && isMangled( $2->linkage ) ) { // ignore extern "C" 2470 iter->addQualifiers( $1->clone() ); 2471 iter->addQualifiers( $2->clone() ); 2472 } // if 2461 2473 } // for 2462 2474 xxx = false;
Note:
See TracChangeset
for help on using the changeset viewer.