Changes in src/Parser/parser.yy [7f5566b:51b1202]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r7f5566b r51b1202 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Jul 30 15:29:19 201513 // Update Count : 13 2712 // Last Modified On : Tue Aug 11 16:01:49 2015 13 // Update Count : 1350 14 14 // 15 15 … … 338 338 | zero_one 339 339 { $$ = new VarRefNode( $1 ); } 340 | constant341 { $$ = $1; }342 | string_literal_list343 { $$ = $1; }344 340 | '(' comma_expression ')' 345 341 { $$ = $2; } … … 414 410 unary_expression: 415 411 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, &&3 414 | constant 415 { $$ = $1; } 416 | string_literal_list 417 { $$ = $1; } 416 418 | ICR unary_expression 417 419 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Incr ), $2 ); } … … 641 643 // requires its own scope 642 644 push push 643 l abel_declaration_opt// GCC, local labels645 local_label_declaration_opt // GCC, local labels 644 646 block_item_list pop '}' // C99, intermix declarations and statements 645 647 { $$ = new CompoundStmtNode( $5 ); } … … 949 951 ; 950 952 951 l abel_declaration_opt:// GCC, local label953 local_label_declaration_opt: // GCC, local label 952 954 // empty 953 | l abel_declaration_list954 ; 955 956 l abel_declaration_list:// GCC, local label957 LABEL l abel_list ';'958 | l abel_declaration_list LABELlabel_list ';'959 ; 960 961 l abel_list:// GCC, local label955 | local_label_declaration_list 956 ; 957 958 local_label_declaration_list: // GCC, local label 959 LABEL local_label_list ';' 960 | local_label_declaration_list LABEL local_label_list ';' 961 ; 962 963 local_label_list: // GCC, local label 962 964 no_attr_identifier_or_type_name {} 963 | l abel_list ',' no_attr_identifier_or_type_name {}965 | local_label_list ',' no_attr_identifier_or_type_name {} 964 966 ; 965 967 … … 1691 1693 1692 1694 designator: 1693 '.' no_attr_identifier_or_type_name // C99, field name 1694 { $$ = new VarRefNode( $2 ); } 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 ) ); } 1695 1700 | '[' push assignment_expression pop ']' // C99, single array element 1696 1701 // assignment_expression used instead of constant_expression because of shift/reduce conflicts with tuple. 1697 { $$ = $3; }1702 { $$ = new DesignatorNode( $3, true ); } 1698 1703 | '[' push subrange pop ']' // CFA, multiple array elements 1699 { $$ = $3; }1704 { $$ = new DesignatorNode( $3, true ); } 1700 1705 | '[' push constant_expression ELLIPSIS constant_expression pop ']' // GCC, multiple array elements 1701 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Range ), $3, $5); }1706 { $$ = new DesignatorNode( new CompositeExprNode( new OperatorNode( OperatorNode::Range ), $3, $5 ), true ); } 1702 1707 | '.' '[' push field_list pop ']' // CFA, tuple field selector 1703 { $$ = $4; }1708 { $$ = new DesignatorNode( $4 ); } 1704 1709 ; 1705 1710
Note:
See TracChangeset
for help on using the changeset viewer.