Changes in src/Parser/parser.yy [936e9f4:cbce272]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r936e9f4 rcbce272 9 9 // Author : Peter A. Buhr 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Aug 16 18:09:14201713 // Update Count : 24 8511 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Aug 4 13:33:00 2017 13 // Update Count : 2475 14 14 // 15 15 … … 98 98 StatementNode * sn; 99 99 ConstantExpr * constant; 100 IfCtl * ifctl;101 100 ForCtl * fctl; 102 101 LabelNode * label; … … 176 175 %type<en> comma_expression comma_expression_opt 177 176 %type<en> argument_expression_list argument_expression default_initialize_opt 178 %type<ifctl> if_control_expression179 177 %type<fctl> for_control_expression 180 178 %type<en> subrange … … 796 794 797 795 selection_statement: 798 IF '(' if_control_expression ')' statement %prec THEN796 IF '(' comma_expression ')' statement %prec THEN 799 797 // explicitly deal with the shift/reduce conflict on if/else 800 798 { $$ = new StatementNode( build_if( $3, $5, nullptr ) ); } 801 | IF '(' if_control_expression ')' statement ELSE statement799 | IF '(' comma_expression ')' statement ELSE statement 802 800 { $$ = new StatementNode( build_if( $3, $5, $7 ) ); } 803 801 | SWITCH '(' comma_expression ')' case_clause // CFA … … 821 819 } 822 820 ; 823 824 if_control_expression:825 comma_expression826 { $$ = new IfCtl( nullptr, $1 ); }827 | c_declaration // no semi-coln828 { $$ = new IfCtl( $1, nullptr ); }829 | cfa_declaration // no semi-colon830 { $$ = new IfCtl( $1, nullptr ); }831 | declaration comma_expression832 { $$ = new IfCtl( $1, $2 ); }833 ;834 821 835 822 // CASE and DEFAULT clauses are only allowed in the SWITCH statement, precluding Duff's device. In addition, a case … … 1110 1097 1111 1098 KR_declaration_list: 1112 c_declaration ';'1113 | KR_declaration_list push c_declaration ';'1099 c_declaration 1100 | KR_declaration_list push c_declaration 1114 1101 { $$ = $1->appendList( $3 ); } 1115 1102 ; … … 1130 1117 ; 1131 1118 1132 declaration: // old & newstyle declarations1133 c _declaration ';'1134 | c fa_declaration ';' // CFA1119 declaration: // CFA, new & old style declarations 1120 cfa_declaration 1121 | c_declaration 1135 1122 ; 1136 1123 … … 1147 1134 1148 1135 cfa_declaration: // CFA 1149 cfa_variable_declaration pop 1150 | cfa_typedef_declaration pop 1151 | cfa_function_declaration pop 1152 | type_declaring_list pop 1153 | trait_specifier pop 1136 cfa_variable_declaration pop ';' 1137 | cfa_typedef_declaration pop ';' 1138 | cfa_function_declaration pop ';' 1139 | type_declaring_list pop ';' 1140 | trait_specifier pop ';' 1154 1141 ; 1155 1142 … … 1351 1338 1352 1339 c_declaration: 1353 declaration_specifier declaring_list pop 1340 declaration_specifier declaring_list pop ';' 1354 1341 { 1355 1342 $$ = distAttr( $1, $2 ); 1356 1343 } 1357 | typedef_declaration pop 1358 | typedef_expression pop // GCC, naming expression type1359 | sue_declaration_specifier pop 1344 | typedef_declaration pop ';' 1345 | typedef_expression pop ';' // GCC, naming expression type 1346 | sue_declaration_specifier pop ';' 1360 1347 ; 1361 1348
Note:
See TracChangeset
for help on using the changeset viewer.