Changes in src/Parser/parser.yy [097e2b0:02e5ab6]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r097e2b0 r02e5ab6 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Oct 8 17:17:54201513 // Update Count : 14 7312 // Last Modified On : Mon Sep 28 18:18:32 2015 13 // Update Count : 1402 14 14 // 15 15 … … 104 104 %token ANDassign ERassign ORassign // &= ^= |= 105 105 106 %token ATassign // @=107 108 106 // Types declaration 109 107 %union … … 122 120 } 123 121 124 %type<tok> identifier no_01_identifier no_attr_identifier zero_one122 %type<tok> identifier no_01_identifier no_attr_identifier no_attr_identifier_01 zero_one 125 123 %type<tok> identifier_or_type_name no_attr_identifier_or_type_name no_01_identifier_or_type_name 126 124 %type<constant> string_literal_list … … 145 143 // statements 146 144 %type<sn> labeled_statement compound_statement expression_statement selection_statement 147 %type<sn> iteration_statement jump_statement exception_statement asm_statement 145 %type<sn> iteration_statement jump_statement exception_statement asm_statement ctor_dtor 148 146 %type<sn> fall_through_opt fall_through 149 147 %type<sn> statement statement_list … … 319 317 ; 320 318 321 // no zero_one because ambiguity with 0.0 : double constant or field selection322 319 no_attr_identifier: 323 320 IDENTIFIER 321 ; 322 323 no_attr_identifier_01: 324 IDENTIFIER 325 | zero_one 324 326 ; 325 327 … … 367 369 | postfix_expression DECR 368 370 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::DecrPost ), $1 ); } 371 // GCC has priority: cast_expression 369 372 | '(' type_name_no_function ')' '{' initializer_list comma_opt '}' // C99 370 373 { $$ = 0; } 371 | postfix_expression '{' argument_expression_list '}' // CFA372 {373 Token fn; fn.str = new std::string( "?{}" ); // location undefined374 $$ = new CompositeExprNode( new VarRefNode( fn ), (ExpressionNode *)( $1 )->set_link( $3 ) );375 }376 374 ; 377 375 … … 634 632 | exception_statement 635 633 | asm_statement 636 | '^' postfix_expression '{' argument_expression_list '}' ';' // CFA 637 { 638 Token fn; fn.str = new std::string( "^?{}" ); // location undefined 639 $$ = new StatementNode( StatementNode::Exp, new CompositeExprNode( new VarRefNode( fn ), 640 (ExpressionNode *)(new CompositeExprNode( new OperatorNode( OperatorNode::AddressOf ), $2 ))->set_link( $4 ) ), 0 ); 641 } 634 | ctor_dtor 642 635 ; 643 636 … … 952 945 ; 953 946 947 ctor_dtor: // CFA, constructor/destructor 948 no_attr_identifier_01 '{' argument_expression_list '}' ';' 949 { 950 Token fn; fn.str = new std::string( "?{}" ); fn.loc = $1.loc; 951 $$ = new StatementNode( StatementNode::Exp, new CompositeExprNode( new VarRefNode( fn ), 952 (ExpressionNode *)((new CompositeExprNode( new OperatorNode( OperatorNode::AddressOf ), new VarRefNode( $1 ) ))->set_link( $3 )) ), 0 ); 953 } 954 | '^' no_attr_identifier_01 '{' '}' ';' 955 { 956 Token fn; fn.str = new std::string( "^?{}" ); fn.loc = $2.loc; 957 $$ = new StatementNode( StatementNode::Exp, new CompositeExprNode( new VarRefNode( fn ), 958 new CompositeExprNode( new OperatorNode( OperatorNode::AddressOf ), new VarRefNode( $2 ) ) ), 0 ); 959 } 960 ; 961 954 962 //******************************* DECLARATIONS ********************************* 955 963 … … 1681 1689 | '=' initializer 1682 1690 { $$ = $2; } 1683 | ATassign initializer1684 { $$ = $2; }1685 1691 ; 1686 1692 … … 1691 1697 1692 1698 initializer_list: 1693 // empty 1694 { $$ = 0; } 1695 | initializer 1699 initializer 1696 1700 | designation initializer { $$ = $2->set_designators( $1 ); } 1697 1701 | initializer_list ',' initializer { $$ = (InitializerNode *)( $1->set_link( $3 ) ); }
Note:
See TracChangeset
for help on using the changeset viewer.