Changes in src/Parser/parser.yy [51b1202:7f5566b]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r51b1202 r7f5566b 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Aug 11 16:01:49 201513 // Update Count : 13 5012 // Last Modified On : Thu Jul 30 15:29:19 2015 13 // Update Count : 1327 14 14 // 15 15 … … 338 338 | zero_one 339 339 { $$ = new VarRefNode( $1 ); } 340 | constant 341 { $$ = $1; } 342 | string_literal_list 343 { $$ = $1; } 340 344 | '(' comma_expression ')' 341 345 { $$ = $2; } … … 410 414 unary_expression: 411 415 postfix_expression 412 // first location where constant/string can have operator applied: sizeof 3/sizeof "abc"413 // still requires semantics checks, e.g., ++3, 3--, *3, &&3414 | constant415 { $$ = $1; }416 | string_literal_list417 { $$ = $1; }418 416 | ICR unary_expression 419 417 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Incr ), $2 ); } … … 643 641 // requires its own scope 644 642 push push 645 l ocal_label_declaration_opt// GCC, local labels643 label_declaration_opt // GCC, local labels 646 644 block_item_list pop '}' // C99, intermix declarations and statements 647 645 { $$ = new CompoundStmtNode( $5 ); } … … 951 949 ; 952 950 953 l ocal_label_declaration_opt:// GCC, local label951 label_declaration_opt: // GCC, local label 954 952 // empty 955 | l ocal_label_declaration_list956 ; 957 958 l ocal_label_declaration_list:// GCC, local label959 LABEL l ocal_label_list ';'960 | l ocal_label_declaration_list LABEL local_label_list ';'961 ; 962 963 l ocal_label_list:// GCC, local label953 | label_declaration_list 954 ; 955 956 label_declaration_list: // GCC, local label 957 LABEL label_list ';' 958 | label_declaration_list LABEL label_list ';' 959 ; 960 961 label_list: // GCC, local label 964 962 no_attr_identifier_or_type_name {} 965 | l ocal_label_list ',' no_attr_identifier_or_type_name {}963 | label_list ',' no_attr_identifier_or_type_name {} 966 964 ; 967 965 … … 1693 1691 1694 1692 designator: 1695 // only ".0" and ".1" allowed => semantic check 1696 FLOATINGconstant 1697 { $$ = new DesignatorNode( new VarRefNode( $1 ) ); } 1698 | '.' no_attr_identifier_or_type_name // C99, field name 1699 { $$ = new DesignatorNode( new VarRefNode( $2 ) ); } 1693 '.' no_attr_identifier_or_type_name // C99, field name 1694 { $$ = new VarRefNode( $2 ); } 1700 1695 | '[' push assignment_expression pop ']' // C99, single array element 1701 1696 // assignment_expression used instead of constant_expression because of shift/reduce conflicts with tuple. 1702 { $$ = new DesignatorNode( $3, true ); }1697 { $$ = $3; } 1703 1698 | '[' push subrange pop ']' // CFA, multiple array elements 1704 { $$ = new DesignatorNode( $3, true ); }1699 { $$ = $3; } 1705 1700 | '[' push constant_expression ELLIPSIS constant_expression pop ']' // GCC, multiple array elements 1706 { $$ = new DesignatorNode( new CompositeExprNode( new OperatorNode( OperatorNode::Range ), $3, $5 ), true); }1701 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Range ), $3, $5 ); } 1707 1702 | '.' '[' push field_list pop ']' // CFA, tuple field selector 1708 { $$ = new DesignatorNode( $4 ); }1703 { $$ = $4; } 1709 1704 ; 1710 1705
Note:
See TracChangeset
for help on using the changeset viewer.