Changes in src/Parser/parser.yy [df22130:637dd9c]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
rdf22130 r637dd9c 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed May 9 17:17:35201813 // Update Count : 32 4412 // Last Modified On : Thu May 3 08:20:09 2018 13 // Update Count : 3225 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 _opt304 %type<en> field field_list field_name fraction_constants 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; }502 501 | type_name '.' '[' push field_list pop ']' // CFA, nested type / tuple field selector 503 502 { SemanticError( yylloc, "Qualified names are currently unimplemented." ); $$ = nullptr; } 504 // { $$ = nullptr; }505 503 | GENERIC '(' assignment_expression ',' generic_assoc_list ')' // C11 506 504 { SemanticError( yylloc, "_Generic is currently unimplemented." ); $$ = nullptr; } … … 535 533 | postfix_expression '.' no_attr_identifier 536 534 { $$ = new ExpressionNode( build_fieldSel( $1, build_varref( $3 ) ) ); } 537 | postfix_expression '.' INTEGERconstant // CFA, tuple index538 { $$ = new ExpressionNode( build_fieldSel( $1, build_ constantInteger( *$3) ) ); }535 | postfix_expression '.' '[' push field_list pop ']' // CFA, tuple field selector 536 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $5 ) ) ); } 539 537 | postfix_expression FLOATING_FRACTIONconstant // CFA, tuple index 540 538 { $$ = new ExpressionNode( build_fieldSel( $1, build_field_name_FLOATING_FRACTIONconstant( *$2 ) ) ); } 541 | postfix_expression '.' '[' push field_list pop ']' // CFA, tuple field selector542 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $5 ) ) ); }543 539 | postfix_expression ARROW no_attr_identifier 544 540 { 545 541 $$ = new ExpressionNode( build_pfieldSel( $1, *$3 == "0" || *$3 == "1" ? build_constantInteger( *$3 ) : build_varref( $3 ) ) ); 546 542 } 543 | postfix_expression ARROW '[' push field_list pop ']' // CFA, tuple field selector 544 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $5 ) ) ); } 547 545 | postfix_expression ARROW INTEGERconstant // CFA, tuple index 548 546 { $$ = new ExpressionNode( build_pfieldSel( $1, build_constantInteger( *$3 ) ) ); } 549 | postfix_expression ARROW '[' push field_list pop ']' // CFA, tuple field selector550 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $5 ) ) ); }551 547 | postfix_expression ICR 552 548 { $$ = new ExpressionNode( build_unary_ptr( OperKinds::IncrPost, $1 ) ); } … … 601 597 602 598 field_name: 603 INTEGERconstant fraction_constants _opt599 INTEGERconstant fraction_constants 604 600 { $$ = new ExpressionNode( build_field_name_fraction_constants( build_constantInteger( *$1 ), $2 ) ); } 605 | FLOATINGconstant fraction_constants _opt601 | FLOATINGconstant fraction_constants 606 602 { $$ = new ExpressionNode( build_field_name_fraction_constants( build_field_name_FLOATINGconstant( *$1 ), $2 ) ); } 607 | no_attr_identifier fraction_constants _opt603 | no_attr_identifier fraction_constants 608 604 { 609 605 $$ = new ExpressionNode( build_field_name_fraction_constants( build_varref( $1 ), $2 ) ); … … 611 607 ; 612 608 613 fraction_constants _opt:609 fraction_constants: 614 610 // empty 615 611 { $$ = nullptr; } 616 | fraction_constants _optFLOATING_FRACTIONconstant612 | fraction_constants FLOATING_FRACTIONconstant 617 613 { 618 614 Expression * constant = build_field_name_FLOATING_FRACTIONconstant( *$2 ); … … 2394 2390 external_definition_list: 2395 2391 external_definition 2396 | external_definition_list 2397 { forall = xxx; } 2398 push external_definition 2392 | external_definition_list { forall = xxx; } push external_definition 2399 2393 { $$ = $1 ? $1->appendList( $4 ) : $4; } 2400 2394 ;
Note:
See TracChangeset
for help on using the changeset viewer.