From afc5c481f97b85b803b9b973d52684deceb715d0 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 30 Jul 2013 14:26:50 -0400 Subject: Start new branch that adds comments to profiling. --- awkgram.c | 462 +++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 260 insertions(+), 202 deletions(-) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index 947f4a30..d087b140 100644 --- a/awkgram.c +++ b/awkgram.c @@ -187,6 +187,8 @@ static INSTRUCTION *ip_end; static INSTRUCTION *ip_endfile; static INSTRUCTION *ip_beginfile; +static INSTRUCTION *comment = NULL; + static inline INSTRUCTION *list_create(INSTRUCTION *x); static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x); static inline INSTRUCTION *list_prepend(INSTRUCTION *l, INSTRUCTION *x); @@ -199,7 +201,7 @@ extern double fmod(double x, double y); #define is_identchar(c) (isalnum(c) || (c) == '_') /* Line 371 of yacc.c */ -#line 203 "awkgram.c" +#line 205 "awkgram.c" # ifndef YY_NULL # if defined __cplusplus && 201103L <= __cplusplus @@ -368,7 +370,7 @@ int yyparse (); /* Copy the second part of user declarations. */ /* Line 390 of yacc.c */ -#line 372 "awkgram.c" +#line 374 "awkgram.c" #ifdef short # undef short @@ -744,25 +746,25 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 200, 200, 202, 207, 208, 214, 226, 230, 241, - 247, 252, 260, 268, 270, 275, 283, 285, 291, 292, - 294, 320, 331, 342, 348, 357, 367, 369, 371, 377, - 382, 383, 387, 406, 405, 439, 441, 446, 447, 460, - 465, 466, 470, 472, 474, 481, 571, 613, 655, 768, - 775, 782, 792, 801, 810, 819, 830, 846, 845, 869, - 881, 881, 979, 979, 1012, 1042, 1048, 1049, 1055, 1056, - 1063, 1068, 1080, 1094, 1096, 1104, 1109, 1111, 1119, 1121, - 1130, 1131, 1139, 1144, 1144, 1155, 1159, 1167, 1168, 1171, - 1173, 1178, 1179, 1188, 1189, 1194, 1199, 1205, 1207, 1209, - 1216, 1217, 1223, 1224, 1229, 1231, 1236, 1238, 1246, 1251, - 1260, 1267, 1269, 1271, 1287, 1297, 1304, 1306, 1311, 1313, - 1315, 1323, 1325, 1330, 1332, 1337, 1339, 1341, 1391, 1393, - 1395, 1397, 1399, 1401, 1403, 1405, 1428, 1433, 1438, 1463, - 1469, 1471, 1473, 1475, 1477, 1479, 1484, 1488, 1520, 1522, - 1528, 1534, 1547, 1548, 1549, 1554, 1559, 1563, 1567, 1582, - 1595, 1600, 1636, 1654, 1655, 1661, 1662, 1667, 1669, 1676, - 1693, 1710, 1712, 1719, 1724, 1732, 1742, 1754, 1763, 1767, - 1771, 1775, 1779, 1783, 1786, 1788, 1792, 1796, 1800 + 0, 202, 202, 204, 209, 210, 216, 228, 232, 243, + 249, 254, 262, 270, 272, 277, 285, 287, 293, 294, + 296, 322, 333, 344, 350, 359, 369, 371, 373, 379, + 384, 385, 389, 408, 407, 441, 443, 448, 449, 472, + 477, 478, 482, 484, 486, 493, 583, 625, 667, 780, + 787, 794, 804, 813, 822, 831, 842, 858, 857, 881, + 893, 893, 991, 991, 1024, 1054, 1060, 1061, 1067, 1068, + 1075, 1080, 1092, 1106, 1108, 1116, 1121, 1123, 1131, 1133, + 1142, 1143, 1151, 1156, 1156, 1167, 1171, 1179, 1180, 1183, + 1185, 1190, 1191, 1200, 1201, 1206, 1211, 1217, 1219, 1221, + 1228, 1229, 1235, 1236, 1241, 1243, 1248, 1250, 1258, 1263, + 1272, 1279, 1281, 1283, 1299, 1309, 1316, 1318, 1323, 1325, + 1327, 1335, 1337, 1342, 1344, 1349, 1351, 1353, 1403, 1405, + 1407, 1409, 1411, 1413, 1415, 1417, 1440, 1445, 1450, 1475, + 1481, 1483, 1485, 1487, 1489, 1491, 1496, 1500, 1532, 1534, + 1540, 1546, 1559, 1560, 1561, 1566, 1571, 1575, 1579, 1594, + 1607, 1612, 1648, 1666, 1667, 1673, 1674, 1679, 1681, 1688, + 1705, 1722, 1724, 1731, 1736, 1744, 1754, 1766, 1775, 1779, + 1783, 1787, 1791, 1795, 1798, 1800, 1804, 1808, 1812 }; #endif @@ -2049,7 +2051,7 @@ yyreduce: { case 3: /* Line 1787 of yacc.c */ -#line 203 "awkgram.y" +#line 205 "awkgram.y" { rule = 0; yyerrok; @@ -2058,7 +2060,7 @@ yyreduce: case 5: /* Line 1787 of yacc.c */ -#line 209 "awkgram.y" +#line 211 "awkgram.y" { next_sourcefile(); if (sourcefile == srcfiles) @@ -2068,7 +2070,7 @@ yyreduce: case 6: /* Line 1787 of yacc.c */ -#line 215 "awkgram.y" +#line 217 "awkgram.y" { rule = 0; /* @@ -2081,7 +2083,7 @@ yyreduce: case 7: /* Line 1787 of yacc.c */ -#line 227 "awkgram.y" +#line 229 "awkgram.y" { (void) append_rule((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); } @@ -2089,7 +2091,7 @@ yyreduce: case 8: /* Line 1787 of yacc.c */ -#line 231 "awkgram.y" +#line 233 "awkgram.y" { if (rule != Rule) { msg(_("%s blocks must have an action part"), ruletab[rule]); @@ -2104,7 +2106,7 @@ yyreduce: case 9: /* Line 1787 of yacc.c */ -#line 242 "awkgram.y" +#line 244 "awkgram.y" { in_function = NULL; (void) mk_function((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); @@ -2114,7 +2116,7 @@ yyreduce: case 10: /* Line 1787 of yacc.c */ -#line 248 "awkgram.y" +#line 250 "awkgram.y" { want_source = false; yyerrok; @@ -2123,7 +2125,7 @@ yyreduce: case 11: /* Line 1787 of yacc.c */ -#line 253 "awkgram.y" +#line 255 "awkgram.y" { want_source = false; yyerrok; @@ -2132,7 +2134,7 @@ yyreduce: case 12: /* Line 1787 of yacc.c */ -#line 261 "awkgram.y" +#line 263 "awkgram.y" { if (include_source((yyvsp[(1) - (1)])) < 0) YYABORT; @@ -2144,19 +2146,19 @@ yyreduce: case 13: /* Line 1787 of yacc.c */ -#line 269 "awkgram.y" +#line 271 "awkgram.y" { (yyval) = NULL; } break; case 14: /* Line 1787 of yacc.c */ -#line 271 "awkgram.y" +#line 273 "awkgram.y" { (yyval) = NULL; } break; case 15: /* Line 1787 of yacc.c */ -#line 276 "awkgram.y" +#line 278 "awkgram.y" { if (load_library((yyvsp[(1) - (1)])) < 0) YYABORT; @@ -2168,31 +2170,31 @@ yyreduce: case 16: /* Line 1787 of yacc.c */ -#line 284 "awkgram.y" +#line 286 "awkgram.y" { (yyval) = NULL; } break; case 17: /* Line 1787 of yacc.c */ -#line 286 "awkgram.y" +#line 288 "awkgram.y" { (yyval) = NULL; } break; case 18: /* Line 1787 of yacc.c */ -#line 291 "awkgram.y" +#line 293 "awkgram.y" { (yyval) = NULL; rule = Rule; } break; case 19: /* Line 1787 of yacc.c */ -#line 293 "awkgram.y" +#line 295 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); rule = Rule; } break; case 20: /* Line 1787 of yacc.c */ -#line 295 "awkgram.y" +#line 297 "awkgram.y" { INSTRUCTION *tp; @@ -2222,7 +2224,7 @@ yyreduce: case 21: /* Line 1787 of yacc.c */ -#line 321 "awkgram.y" +#line 323 "awkgram.y" { static int begin_seen = 0; if (do_lint_old && ++begin_seen == 2) @@ -2237,7 +2239,7 @@ yyreduce: case 22: /* Line 1787 of yacc.c */ -#line 332 "awkgram.y" +#line 334 "awkgram.y" { static int end_seen = 0; if (do_lint_old && ++end_seen == 2) @@ -2252,7 +2254,7 @@ yyreduce: case 23: /* Line 1787 of yacc.c */ -#line 343 "awkgram.y" +#line 345 "awkgram.y" { (yyvsp[(1) - (1)])->in_rule = rule = BEGINFILE; (yyvsp[(1) - (1)])->source_file = source; @@ -2262,7 +2264,7 @@ yyreduce: case 24: /* Line 1787 of yacc.c */ -#line 349 "awkgram.y" +#line 351 "awkgram.y" { (yyvsp[(1) - (1)])->in_rule = rule = ENDFILE; (yyvsp[(1) - (1)])->source_file = source; @@ -2272,7 +2274,7 @@ yyreduce: case 25: /* Line 1787 of yacc.c */ -#line 358 "awkgram.y" +#line 360 "awkgram.y" { if ((yyvsp[(2) - (5)]) == NULL) (yyval) = list_create(instruction(Op_no_op)); @@ -2283,19 +2285,19 @@ yyreduce: case 26: /* Line 1787 of yacc.c */ -#line 368 "awkgram.y" +#line 370 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 27: /* Line 1787 of yacc.c */ -#line 370 "awkgram.y" +#line 372 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 28: /* Line 1787 of yacc.c */ -#line 372 "awkgram.y" +#line 374 "awkgram.y" { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); @@ -2305,13 +2307,13 @@ yyreduce: case 29: /* Line 1787 of yacc.c */ -#line 378 "awkgram.y" +#line 380 "awkgram.y" { (yyval) = (yyvsp[(2) - (2)]); } break; case 32: /* Line 1787 of yacc.c */ -#line 388 "awkgram.y" +#line 390 "awkgram.y" { (yyvsp[(1) - (6)])->source_file = source; if (install_function((yyvsp[(2) - (6)])->lextok, (yyvsp[(1) - (6)]), (yyvsp[(4) - (6)])) < 0) @@ -2326,13 +2328,13 @@ yyreduce: case 33: /* Line 1787 of yacc.c */ -#line 406 "awkgram.y" +#line 408 "awkgram.y" { want_regexp = true; } break; case 34: /* Line 1787 of yacc.c */ -#line 408 "awkgram.y" +#line 410 "awkgram.y" { NODE *n, *exp; char *re; @@ -2365,54 +2367,64 @@ yyreduce: case 35: /* Line 1787 of yacc.c */ -#line 440 "awkgram.y" +#line 442 "awkgram.y" { bcfree((yyvsp[(1) - (1)])); } break; case 37: /* Line 1787 of yacc.c */ -#line 446 "awkgram.y" +#line 448 "awkgram.y" { (yyval) = NULL; } break; case 38: /* Line 1787 of yacc.c */ -#line 448 "awkgram.y" +#line 450 "awkgram.y" { - if ((yyvsp[(2) - (2)]) == NULL) - (yyval) = (yyvsp[(1) - (2)]); - else { - add_lint((yyvsp[(2) - (2)]), LINT_no_effect); - if ((yyvsp[(1) - (2)]) == NULL) - (yyval) = (yyvsp[(2) - (2)]); + if ((yyvsp[(2) - (2)]) == NULL) { + if (comment == NULL) + (yyval) = (yyvsp[(1) - (2)]); else + (yyval) = list_prepend((yyvsp[(1) - (2)]), comment); + } else { + add_lint((yyvsp[(2) - (2)]), LINT_no_effect); + if ((yyvsp[(1) - (2)]) == NULL) { + if (comment == NULL) + (yyval) = (yyvsp[(2) - (2)]); + else + (yyval) = list_prepend((yyvsp[(2) - (2)]), comment); + } else { + if (comment != NULL) + list_append((yyvsp[(1) - (2)]), comment); (yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); + } } - yyerrok; + comment = NULL; + yyerrok; } break; case 39: /* Line 1787 of yacc.c */ -#line 461 "awkgram.y" +#line 473 "awkgram.y" { (yyval) = NULL; } break; case 42: /* Line 1787 of yacc.c */ -#line 471 "awkgram.y" +#line 483 "awkgram.y" { (yyval) = NULL; } break; case 43: /* Line 1787 of yacc.c */ -#line 473 "awkgram.y" +#line 485 "awkgram.y" { (yyval) = (yyvsp[(2) - (3)]); } break; case 44: /* Line 1787 of yacc.c */ -#line 475 "awkgram.y" +#line 487 "awkgram.y" { if (do_pretty_print) (yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_exec_count)); @@ -2423,7 +2435,7 @@ yyreduce: case 45: /* Line 1787 of yacc.c */ -#line 482 "awkgram.y" +#line 494 "awkgram.y" { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2517,7 +2529,7 @@ yyreduce: case 46: /* Line 1787 of yacc.c */ -#line 572 "awkgram.y" +#line 584 "awkgram.y" { /* * ----------------- @@ -2563,7 +2575,7 @@ yyreduce: case 47: /* Line 1787 of yacc.c */ -#line 614 "awkgram.y" +#line 626 "awkgram.y" { /* * ----------------- @@ -2609,7 +2621,7 @@ yyreduce: case 48: /* Line 1787 of yacc.c */ -#line 656 "awkgram.y" +#line 668 "awkgram.y" { INSTRUCTION *ip; char *var_name = (yyvsp[(3) - (8)])->lextok; @@ -2726,7 +2738,7 @@ regular_loop: case 49: /* Line 1787 of yacc.c */ -#line 769 "awkgram.y" +#line 781 "awkgram.y" { (yyval) = mk_for_loop((yyvsp[(1) - (12)]), (yyvsp[(3) - (12)]), (yyvsp[(6) - (12)]), (yyvsp[(9) - (12)]), (yyvsp[(12) - (12)])); @@ -2737,7 +2749,7 @@ regular_loop: case 50: /* Line 1787 of yacc.c */ -#line 776 "awkgram.y" +#line 788 "awkgram.y" { (yyval) = mk_for_loop((yyvsp[(1) - (11)]), (yyvsp[(3) - (11)]), (INSTRUCTION *) NULL, (yyvsp[(8) - (11)]), (yyvsp[(11) - (11)])); @@ -2748,7 +2760,7 @@ regular_loop: case 51: /* Line 1787 of yacc.c */ -#line 783 "awkgram.y" +#line 795 "awkgram.y" { if (do_pretty_print) (yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_exec_count)); @@ -2759,7 +2771,7 @@ regular_loop: case 52: /* Line 1787 of yacc.c */ -#line 793 "awkgram.y" +#line 805 "awkgram.y" { if (! break_allowed) error_ln((yyvsp[(1) - (2)])->source_line, @@ -2772,7 +2784,7 @@ regular_loop: case 53: /* Line 1787 of yacc.c */ -#line 802 "awkgram.y" +#line 814 "awkgram.y" { if (! continue_allowed) error_ln((yyvsp[(1) - (2)])->source_line, @@ -2785,7 +2797,7 @@ regular_loop: case 54: /* Line 1787 of yacc.c */ -#line 811 "awkgram.y" +#line 823 "awkgram.y" { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2798,7 +2810,7 @@ regular_loop: case 55: /* Line 1787 of yacc.c */ -#line 820 "awkgram.y" +#line 832 "awkgram.y" { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2813,7 +2825,7 @@ regular_loop: case 56: /* Line 1787 of yacc.c */ -#line 831 "awkgram.y" +#line 843 "awkgram.y" { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2832,7 +2844,7 @@ regular_loop: case 57: /* Line 1787 of yacc.c */ -#line 846 "awkgram.y" +#line 858 "awkgram.y" { if (! in_function) yyerror(_("`return' used outside function context")); @@ -2841,7 +2853,7 @@ regular_loop: case 58: /* Line 1787 of yacc.c */ -#line 849 "awkgram.y" +#line 861 "awkgram.y" { if ((yyvsp[(3) - (4)]) == NULL) { (yyval) = list_create((yyvsp[(1) - (4)])); @@ -2866,13 +2878,13 @@ regular_loop: case 60: /* Line 1787 of yacc.c */ -#line 881 "awkgram.y" +#line 893 "awkgram.y" { in_print = true; in_parens = 0; } break; case 61: /* Line 1787 of yacc.c */ -#line 882 "awkgram.y" +#line 894 "awkgram.y" { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2973,13 +2985,13 @@ regular_print: case 62: /* Line 1787 of yacc.c */ -#line 979 "awkgram.y" +#line 991 "awkgram.y" { sub_counter = 0; } break; case 63: /* Line 1787 of yacc.c */ -#line 980 "awkgram.y" +#line 992 "awkgram.y" { char *arr = (yyvsp[(2) - (4)])->lextok; @@ -3016,7 +3028,7 @@ regular_print: case 64: /* Line 1787 of yacc.c */ -#line 1017 "awkgram.y" +#line 1029 "awkgram.y" { static bool warned = false; char *arr = (yyvsp[(3) - (4)])->lextok; @@ -3046,31 +3058,31 @@ regular_print: case 65: /* Line 1787 of yacc.c */ -#line 1043 "awkgram.y" +#line 1055 "awkgram.y" { (yyval) = optimize_assignment((yyvsp[(1) - (1)])); } break; case 66: /* Line 1787 of yacc.c */ -#line 1048 "awkgram.y" +#line 1060 "awkgram.y" { (yyval) = NULL; } break; case 67: /* Line 1787 of yacc.c */ -#line 1050 "awkgram.y" +#line 1062 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 68: /* Line 1787 of yacc.c */ -#line 1055 "awkgram.y" +#line 1067 "awkgram.y" { (yyval) = NULL; } break; case 69: /* Line 1787 of yacc.c */ -#line 1057 "awkgram.y" +#line 1069 "awkgram.y" { if ((yyvsp[(1) - (2)]) == NULL) (yyval) = list_create((yyvsp[(2) - (2)])); @@ -3081,13 +3093,13 @@ regular_print: case 70: /* Line 1787 of yacc.c */ -#line 1064 "awkgram.y" +#line 1076 "awkgram.y" { (yyval) = NULL; } break; case 71: /* Line 1787 of yacc.c */ -#line 1069 "awkgram.y" +#line 1081 "awkgram.y" { INSTRUCTION *casestmt = (yyvsp[(5) - (5)]); if ((yyvsp[(5) - (5)]) == NULL) @@ -3103,7 +3115,7 @@ regular_print: case 72: /* Line 1787 of yacc.c */ -#line 1081 "awkgram.y" +#line 1093 "awkgram.y" { INSTRUCTION *casestmt = (yyvsp[(4) - (4)]); if ((yyvsp[(4) - (4)]) == NULL) @@ -3118,13 +3130,13 @@ regular_print: case 73: /* Line 1787 of yacc.c */ -#line 1095 "awkgram.y" +#line 1107 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 74: /* Line 1787 of yacc.c */ -#line 1097 "awkgram.y" +#line 1109 "awkgram.y" { NODE *n = (yyvsp[(2) - (2)])->memory; (void) force_number(n); @@ -3136,7 +3148,7 @@ regular_print: case 75: /* Line 1787 of yacc.c */ -#line 1105 "awkgram.y" +#line 1117 "awkgram.y" { bcfree((yyvsp[(1) - (2)])); (yyval) = (yyvsp[(2) - (2)]); @@ -3145,13 +3157,13 @@ regular_print: case 76: /* Line 1787 of yacc.c */ -#line 1110 "awkgram.y" +#line 1122 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 77: /* Line 1787 of yacc.c */ -#line 1112 "awkgram.y" +#line 1124 "awkgram.y" { (yyvsp[(1) - (1)])->opcode = Op_push_re; (yyval) = (yyvsp[(1) - (1)]); @@ -3160,19 +3172,19 @@ regular_print: case 78: /* Line 1787 of yacc.c */ -#line 1120 "awkgram.y" +#line 1132 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 79: /* Line 1787 of yacc.c */ -#line 1122 "awkgram.y" +#line 1134 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 81: /* Line 1787 of yacc.c */ -#line 1132 "awkgram.y" +#line 1144 "awkgram.y" { (yyval) = (yyvsp[(2) - (3)]); } @@ -3180,7 +3192,7 @@ regular_print: case 82: /* Line 1787 of yacc.c */ -#line 1139 "awkgram.y" +#line 1151 "awkgram.y" { in_print = false; in_parens = 0; @@ -3190,13 +3202,13 @@ regular_print: case 83: /* Line 1787 of yacc.c */ -#line 1144 "awkgram.y" +#line 1156 "awkgram.y" { in_print = false; in_parens = 0; } break; case 84: /* Line 1787 of yacc.c */ -#line 1145 "awkgram.y" +#line 1157 "awkgram.y" { if ((yyvsp[(1) - (3)])->redir_type == redirect_twoway && (yyvsp[(3) - (3)])->lasti->opcode == Op_K_getline_redir @@ -3208,7 +3220,7 @@ regular_print: case 85: /* Line 1787 of yacc.c */ -#line 1156 "awkgram.y" +#line 1168 "awkgram.y" { (yyval) = mk_condition((yyvsp[(3) - (6)]), (yyvsp[(1) - (6)]), (yyvsp[(6) - (6)]), NULL, NULL); } @@ -3216,7 +3228,7 @@ regular_print: case 86: /* Line 1787 of yacc.c */ -#line 1161 "awkgram.y" +#line 1173 "awkgram.y" { (yyval) = mk_condition((yyvsp[(3) - (9)]), (yyvsp[(1) - (9)]), (yyvsp[(6) - (9)]), (yyvsp[(7) - (9)]), (yyvsp[(9) - (9)])); } @@ -3224,13 +3236,13 @@ regular_print: case 91: /* Line 1787 of yacc.c */ -#line 1178 "awkgram.y" +#line 1190 "awkgram.y" { (yyval) = NULL; } break; case 92: /* Line 1787 of yacc.c */ -#line 1180 "awkgram.y" +#line 1192 "awkgram.y" { bcfree((yyvsp[(1) - (2)])); (yyval) = (yyvsp[(2) - (2)]); @@ -3239,19 +3251,19 @@ regular_print: case 93: /* Line 1787 of yacc.c */ -#line 1188 "awkgram.y" +#line 1200 "awkgram.y" { (yyval) = NULL; } break; case 94: /* Line 1787 of yacc.c */ -#line 1190 "awkgram.y" +#line 1202 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]) ; } break; case 95: /* Line 1787 of yacc.c */ -#line 1195 "awkgram.y" +#line 1207 "awkgram.y" { (yyvsp[(1) - (1)])->param_count = 0; (yyval) = list_create((yyvsp[(1) - (1)])); @@ -3260,7 +3272,7 @@ regular_print: case 96: /* Line 1787 of yacc.c */ -#line 1200 "awkgram.y" +#line 1212 "awkgram.y" { (yyvsp[(3) - (3)])->param_count = (yyvsp[(1) - (3)])->lasti->param_count + 1; (yyval) = list_append((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); @@ -3270,55 +3282,55 @@ regular_print: case 97: /* Line 1787 of yacc.c */ -#line 1206 "awkgram.y" +#line 1218 "awkgram.y" { (yyval) = NULL; } break; case 98: /* Line 1787 of yacc.c */ -#line 1208 "awkgram.y" +#line 1220 "awkgram.y" { (yyval) = (yyvsp[(1) - (2)]); } break; case 99: /* Line 1787 of yacc.c */ -#line 1210 "awkgram.y" +#line 1222 "awkgram.y" { (yyval) = (yyvsp[(1) - (3)]); } break; case 100: /* Line 1787 of yacc.c */ -#line 1216 "awkgram.y" +#line 1228 "awkgram.y" { (yyval) = NULL; } break; case 101: /* Line 1787 of yacc.c */ -#line 1218 "awkgram.y" +#line 1230 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 102: /* Line 1787 of yacc.c */ -#line 1223 "awkgram.y" +#line 1235 "awkgram.y" { (yyval) = NULL; } break; case 103: /* Line 1787 of yacc.c */ -#line 1225 "awkgram.y" +#line 1237 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 104: /* Line 1787 of yacc.c */ -#line 1230 "awkgram.y" +#line 1242 "awkgram.y" { (yyval) = mk_expression_list(NULL, (yyvsp[(1) - (1)])); } break; case 105: /* Line 1787 of yacc.c */ -#line 1232 "awkgram.y" +#line 1244 "awkgram.y" { (yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); yyerrok; @@ -3327,13 +3339,13 @@ regular_print: case 106: /* Line 1787 of yacc.c */ -#line 1237 "awkgram.y" +#line 1249 "awkgram.y" { (yyval) = NULL; } break; case 107: /* Line 1787 of yacc.c */ -#line 1239 "awkgram.y" +#line 1251 "awkgram.y" { /* * Returning the expression list instead of NULL lets @@ -3345,7 +3357,7 @@ regular_print: case 108: /* Line 1787 of yacc.c */ -#line 1247 "awkgram.y" +#line 1259 "awkgram.y" { /* Ditto */ (yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); @@ -3354,7 +3366,7 @@ regular_print: case 109: /* Line 1787 of yacc.c */ -#line 1252 "awkgram.y" +#line 1264 "awkgram.y" { /* Ditto */ (yyval) = (yyvsp[(1) - (3)]); @@ -3363,7 +3375,7 @@ regular_print: case 110: /* Line 1787 of yacc.c */ -#line 1261 "awkgram.y" +#line 1273 "awkgram.y" { if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode == Op_match_rec) lintwarn_ln((yyvsp[(2) - (3)])->source_line, @@ -3374,19 +3386,19 @@ regular_print: case 111: /* Line 1787 of yacc.c */ -#line 1268 "awkgram.y" +#line 1280 "awkgram.y" { (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 112: /* Line 1787 of yacc.c */ -#line 1270 "awkgram.y" +#line 1282 "awkgram.y" { (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 113: /* Line 1787 of yacc.c */ -#line 1272 "awkgram.y" +#line 1284 "awkgram.y" { if ((yyvsp[(1) - (3)])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[(2) - (3)])->source_line, @@ -3406,7 +3418,7 @@ regular_print: case 114: /* Line 1787 of yacc.c */ -#line 1288 "awkgram.y" +#line 1300 "awkgram.y" { if (do_lint_old) warning_ln((yyvsp[(2) - (3)])->source_line, @@ -3420,7 +3432,7 @@ regular_print: case 115: /* Line 1787 of yacc.c */ -#line 1298 "awkgram.y" +#line 1310 "awkgram.y" { if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode == Op_match_rec) lintwarn_ln((yyvsp[(2) - (3)])->source_line, @@ -3431,31 +3443,31 @@ regular_print: case 116: /* Line 1787 of yacc.c */ -#line 1305 "awkgram.y" +#line 1317 "awkgram.y" { (yyval) = mk_condition((yyvsp[(1) - (5)]), (yyvsp[(2) - (5)]), (yyvsp[(3) - (5)]), (yyvsp[(4) - (5)]), (yyvsp[(5) - (5)])); } break; case 117: /* Line 1787 of yacc.c */ -#line 1307 "awkgram.y" +#line 1319 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 118: /* Line 1787 of yacc.c */ -#line 1312 "awkgram.y" +#line 1324 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 119: /* Line 1787 of yacc.c */ -#line 1314 "awkgram.y" +#line 1326 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 120: /* Line 1787 of yacc.c */ -#line 1316 "awkgram.y" +#line 1328 "awkgram.y" { (yyvsp[(2) - (2)])->opcode = Op_assign_quotient; (yyval) = (yyvsp[(2) - (2)]); @@ -3464,43 +3476,43 @@ regular_print: case 121: /* Line 1787 of yacc.c */ -#line 1324 "awkgram.y" +#line 1336 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 122: /* Line 1787 of yacc.c */ -#line 1326 "awkgram.y" +#line 1338 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 123: /* Line 1787 of yacc.c */ -#line 1331 "awkgram.y" +#line 1343 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 124: /* Line 1787 of yacc.c */ -#line 1333 "awkgram.y" +#line 1345 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 125: /* Line 1787 of yacc.c */ -#line 1338 "awkgram.y" +#line 1350 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 126: /* Line 1787 of yacc.c */ -#line 1340 "awkgram.y" +#line 1352 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 127: /* Line 1787 of yacc.c */ -#line 1342 "awkgram.y" +#line 1354 "awkgram.y" { int count = 2; bool is_simple_var = false; @@ -3551,43 +3563,43 @@ regular_print: case 129: /* Line 1787 of yacc.c */ -#line 1394 "awkgram.y" +#line 1406 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 130: /* Line 1787 of yacc.c */ -#line 1396 "awkgram.y" +#line 1408 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 131: /* Line 1787 of yacc.c */ -#line 1398 "awkgram.y" +#line 1410 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 132: /* Line 1787 of yacc.c */ -#line 1400 "awkgram.y" +#line 1412 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 133: /* Line 1787 of yacc.c */ -#line 1402 "awkgram.y" +#line 1414 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 134: /* Line 1787 of yacc.c */ -#line 1404 "awkgram.y" +#line 1416 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 135: /* Line 1787 of yacc.c */ -#line 1406 "awkgram.y" +#line 1418 "awkgram.y" { /* * In BEGINFILE/ENDFILE, allow `getline var < file' @@ -3614,7 +3626,7 @@ regular_print: case 136: /* Line 1787 of yacc.c */ -#line 1429 "awkgram.y" +#line 1441 "awkgram.y" { (yyvsp[(2) - (2)])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) - (2)])); @@ -3623,7 +3635,7 @@ regular_print: case 137: /* Line 1787 of yacc.c */ -#line 1434 "awkgram.y" +#line 1446 "awkgram.y" { (yyvsp[(2) - (2)])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) - (2)])); @@ -3632,7 +3644,7 @@ regular_print: case 138: /* Line 1787 of yacc.c */ -#line 1439 "awkgram.y" +#line 1451 "awkgram.y" { if (do_lint_old) { warning_ln((yyvsp[(4) - (5)])->source_line, @@ -3656,7 +3668,7 @@ regular_print: case 139: /* Line 1787 of yacc.c */ -#line 1464 "awkgram.y" +#line 1476 "awkgram.y" { (yyval) = mk_getline((yyvsp[(3) - (4)]), (yyvsp[(4) - (4)]), (yyvsp[(1) - (4)]), (yyvsp[(2) - (4)])->redir_type); bcfree((yyvsp[(2) - (4)])); @@ -3665,43 +3677,43 @@ regular_print: case 140: /* Line 1787 of yacc.c */ -#line 1470 "awkgram.y" +#line 1482 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 141: /* Line 1787 of yacc.c */ -#line 1472 "awkgram.y" +#line 1484 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 142: /* Line 1787 of yacc.c */ -#line 1474 "awkgram.y" +#line 1486 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 143: /* Line 1787 of yacc.c */ -#line 1476 "awkgram.y" +#line 1488 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 144: /* Line 1787 of yacc.c */ -#line 1478 "awkgram.y" +#line 1490 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 145: /* Line 1787 of yacc.c */ -#line 1480 "awkgram.y" +#line 1492 "awkgram.y" { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 146: /* Line 1787 of yacc.c */ -#line 1485 "awkgram.y" +#line 1497 "awkgram.y" { (yyval) = list_create((yyvsp[(1) - (1)])); } @@ -3709,7 +3721,7 @@ regular_print: case 147: /* Line 1787 of yacc.c */ -#line 1489 "awkgram.y" +#line 1501 "awkgram.y" { if ((yyvsp[(2) - (2)])->opcode == Op_match_rec) { (yyvsp[(2) - (2)])->opcode = Op_nomatch; @@ -3745,13 +3757,13 @@ regular_print: case 148: /* Line 1787 of yacc.c */ -#line 1521 "awkgram.y" +#line 1533 "awkgram.y" { (yyval) = (yyvsp[(2) - (3)]); } break; case 149: /* Line 1787 of yacc.c */ -#line 1523 "awkgram.y" +#line 1535 "awkgram.y" { (yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)])); if ((yyval) == NULL) @@ -3761,7 +3773,7 @@ regular_print: case 150: /* Line 1787 of yacc.c */ -#line 1529 "awkgram.y" +#line 1541 "awkgram.y" { (yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)])); if ((yyval) == NULL) @@ -3771,7 +3783,7 @@ regular_print: case 151: /* Line 1787 of yacc.c */ -#line 1535 "awkgram.y" +#line 1547 "awkgram.y" { static bool warned = false; @@ -3788,7 +3800,7 @@ regular_print: case 154: /* Line 1787 of yacc.c */ -#line 1550 "awkgram.y" +#line 1562 "awkgram.y" { (yyvsp[(1) - (2)])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) - (2)])); @@ -3797,7 +3809,7 @@ regular_print: case 155: /* Line 1787 of yacc.c */ -#line 1555 "awkgram.y" +#line 1567 "awkgram.y" { (yyvsp[(1) - (2)])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) - (2)])); @@ -3806,7 +3818,7 @@ regular_print: case 156: /* Line 1787 of yacc.c */ -#line 1560 "awkgram.y" +#line 1572 "awkgram.y" { (yyval) = list_create((yyvsp[(1) - (1)])); } @@ -3814,7 +3826,7 @@ regular_print: case 157: /* Line 1787 of yacc.c */ -#line 1564 "awkgram.y" +#line 1576 "awkgram.y" { (yyval) = list_create((yyvsp[(1) - (1)])); } @@ -3822,7 +3834,7 @@ regular_print: case 158: /* Line 1787 of yacc.c */ -#line 1568 "awkgram.y" +#line 1580 "awkgram.y" { if ((yyvsp[(2) - (2)])->lasti->opcode == Op_push_i && ((yyvsp[(2) - (2)])->lasti->memory->flags & (STRCUR|STRING)) == 0 @@ -3841,7 +3853,7 @@ regular_print: case 159: /* Line 1787 of yacc.c */ -#line 1583 "awkgram.y" +#line 1595 "awkgram.y" { /* * was: $$ = $2 @@ -3855,7 +3867,7 @@ regular_print: case 160: /* Line 1787 of yacc.c */ -#line 1596 "awkgram.y" +#line 1608 "awkgram.y" { func_use((yyvsp[(1) - (1)])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[(1) - (1)]); @@ -3864,7 +3876,7 @@ regular_print: case 161: /* Line 1787 of yacc.c */ -#line 1601 "awkgram.y" +#line 1613 "awkgram.y" { /* indirect function call */ INSTRUCTION *f, *t; @@ -3901,7 +3913,7 @@ regular_print: case 162: /* Line 1787 of yacc.c */ -#line 1637 "awkgram.y" +#line 1649 "awkgram.y" { param_sanity((yyvsp[(3) - (4)])); (yyvsp[(1) - (4)])->opcode = Op_func_call; @@ -3919,37 +3931,37 @@ regular_print: case 163: /* Line 1787 of yacc.c */ -#line 1654 "awkgram.y" +#line 1666 "awkgram.y" { (yyval) = NULL; } break; case 164: /* Line 1787 of yacc.c */ -#line 1656 "awkgram.y" +#line 1668 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 165: /* Line 1787 of yacc.c */ -#line 1661 "awkgram.y" +#line 1673 "awkgram.y" { (yyval) = NULL; } break; case 166: /* Line 1787 of yacc.c */ -#line 1663 "awkgram.y" +#line 1675 "awkgram.y" { (yyval) = (yyvsp[(1) - (2)]); } break; case 167: /* Line 1787 of yacc.c */ -#line 1668 "awkgram.y" +#line 1680 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 168: /* Line 1787 of yacc.c */ -#line 1670 "awkgram.y" +#line 1682 "awkgram.y" { (yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); } @@ -3957,7 +3969,7 @@ regular_print: case 169: /* Line 1787 of yacc.c */ -#line 1677 "awkgram.y" +#line 1689 "awkgram.y" { INSTRUCTION *ip = (yyvsp[(1) - (1)])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3975,7 +3987,7 @@ regular_print: case 170: /* Line 1787 of yacc.c */ -#line 1694 "awkgram.y" +#line 1706 "awkgram.y" { INSTRUCTION *t = (yyvsp[(2) - (3)]); if ((yyvsp[(2) - (3)]) == NULL) { @@ -3993,13 +4005,13 @@ regular_print: case 171: /* Line 1787 of yacc.c */ -#line 1711 "awkgram.y" +#line 1723 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 172: /* Line 1787 of yacc.c */ -#line 1713 "awkgram.y" +#line 1725 "awkgram.y" { (yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); } @@ -4007,13 +4019,13 @@ regular_print: case 173: /* Line 1787 of yacc.c */ -#line 1720 "awkgram.y" +#line 1732 "awkgram.y" { (yyval) = (yyvsp[(1) - (2)]); } break; case 174: /* Line 1787 of yacc.c */ -#line 1725 "awkgram.y" +#line 1737 "awkgram.y" { char *var_name = (yyvsp[(1) - (1)])->lextok; @@ -4025,7 +4037,7 @@ regular_print: case 175: /* Line 1787 of yacc.c */ -#line 1733 "awkgram.y" +#line 1745 "awkgram.y" { char *arr = (yyvsp[(1) - (2)])->lextok; (yyvsp[(1) - (2)])->memory = variable((yyvsp[(1) - (2)])->source_line, arr, Node_var_new); @@ -4036,7 +4048,7 @@ regular_print: case 176: /* Line 1787 of yacc.c */ -#line 1743 "awkgram.y" +#line 1755 "awkgram.y" { INSTRUCTION *ip = (yyvsp[(1) - (1)])->nexti; if (ip->opcode == Op_push @@ -4052,7 +4064,7 @@ regular_print: case 177: /* Line 1787 of yacc.c */ -#line 1755 "awkgram.y" +#line 1767 "awkgram.y" { (yyval) = list_append((yyvsp[(2) - (3)]), (yyvsp[(1) - (3)])); if ((yyvsp[(3) - (3)]) != NULL) @@ -4062,7 +4074,7 @@ regular_print: case 178: /* Line 1787 of yacc.c */ -#line 1764 "awkgram.y" +#line 1776 "awkgram.y" { (yyvsp[(1) - (1)])->opcode = Op_postincrement; } @@ -4070,7 +4082,7 @@ regular_print: case 179: /* Line 1787 of yacc.c */ -#line 1768 "awkgram.y" +#line 1780 "awkgram.y" { (yyvsp[(1) - (1)])->opcode = Op_postdecrement; } @@ -4078,43 +4090,43 @@ regular_print: case 180: /* Line 1787 of yacc.c */ -#line 1771 "awkgram.y" +#line 1783 "awkgram.y" { (yyval) = NULL; } break; case 182: /* Line 1787 of yacc.c */ -#line 1779 "awkgram.y" +#line 1791 "awkgram.y" { yyerrok; } break; case 183: /* Line 1787 of yacc.c */ -#line 1783 "awkgram.y" +#line 1795 "awkgram.y" { yyerrok; } break; case 186: /* Line 1787 of yacc.c */ -#line 1792 "awkgram.y" +#line 1804 "awkgram.y" { yyerrok; } break; case 187: /* Line 1787 of yacc.c */ -#line 1796 "awkgram.y" +#line 1808 "awkgram.y" { (yyval) = (yyvsp[(1) - (1)]); yyerrok; } break; case 188: /* Line 1787 of yacc.c */ -#line 1800 "awkgram.y" +#line 1812 "awkgram.y" { yyerrok; } break; /* Line 1787 of yacc.c */ -#line 4118 "awkgram.c" +#line 4130 "awkgram.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4346,7 +4358,7 @@ yyreturn: /* Line 2050 of yacc.c */ -#line 1802 "awkgram.y" +#line 1814 "awkgram.y" struct token { @@ -5428,8 +5440,28 @@ allow_newline(void) break; } if (c == '#') { - while ((c = nextc()) != '\n' && c != END_FILE) - continue; +// if (do_pretty_print) { + tok = tokstart; + tokadd('#'); + while ((c = nextc()) != '\n' && c != END_FILE) + tokadd(c); + if (c == '\n') + tokadd(c); + + if (comment != NULL) { + size_t new = comment->memory->stlen + (tok - tokstart) + 2; + erealloc(comment->memory->stptr, char *, new, "allow_newline"); + memcpy(comment->memory->stptr + comment->memory->stlen, tokstart, (tok - tokstart)); + comment->memory->stlen += (tok - tokstart); + comment->memory->stptr[comment->memory->stlen] = '\0'; + } else { + comment = bcalloc(Op_comment, 1, sourceline); + comment->memory = make_str_node(tokstart, tok - tokstart, 0); + } +// } else { +// while ((c = nextc()) != '\n' && c != END_FILE) +// continue; +// } if (c == END_FILE) { pushback(); break; @@ -5633,10 +5665,36 @@ retry: return lasttok = NEWLINE; case '#': /* it's a comment */ - while ((c = nextc()) != '\n') { +// if (do_pretty_print) { + tok = tokstart; + tokadd('#'); + while ((c = nextc()) != '\n') { + if (c == END_FILE) + break; + tokadd(c); + } + if (c == '\n') + tokadd(c); + + if (comment != NULL) { + size_t new = comment->memory->stlen + (tok - tokstart) + 2; + erealloc(comment->memory->stptr, char *, new, "yylex"); + memcpy(comment->memory->stptr + comment->memory->stlen, tokstart, (tok - tokstart)); + comment->memory->stlen += (tok - tokstart); + comment->memory->stptr[comment->memory->stlen] = '\0'; + } else { + comment = bcalloc(Op_comment, 1, sourceline); + comment->memory = make_str_node(tokstart, tok - tokstart, 0); + } + if (c == END_FILE) return lasttok = NEWLINE_EOF; - } +// } else { +// while ((c = nextc()) != '\n') { +// if (c == END_FILE) +// return lasttok = NEWLINE_EOF; +// } +// } sourceline++; return lasttok = NEWLINE; -- cgit v1.2.3 From 1457aab67141409f57d25c06f86e227d92808da3 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 2 Aug 2013 17:42:03 -0400 Subject: Further attempt on comments. Not so good. --- awkgram.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index d087b140..1ca90845 100644 --- a/awkgram.c +++ b/awkgram.c @@ -7601,9 +7601,13 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action) action), tp); } - } +// if (comment != NULL) { +// ip = list_prepend(ip, comment); +// comment = NULL; +// } + list_append(rule_list, rp + 1); if (rule_block[rule] == NULL) -- cgit v1.2.3 From e149eb882355f427d43928324145c971a0562c5e Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 15 Aug 2013 02:48:40 +0300 Subject: Additional work. --- awkgram.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index 1ca90845..bee20730 100644 --- a/awkgram.c +++ b/awkgram.c @@ -5456,6 +5456,8 @@ allow_newline(void) comment->memory->stptr[comment->memory->stlen] = '\0'; } else { comment = bcalloc(Op_comment, 1, sourceline); + comment->source_file = source; + comment->memory = make_str_node(tokstart, tok - tokstart, 0); } // } else { @@ -5684,6 +5686,7 @@ retry: comment->memory->stptr[comment->memory->stlen] = '\0'; } else { comment = bcalloc(Op_comment, 1, sourceline); + comment->source_file = source; comment->memory = make_str_node(tokstart, tok - tokstart, 0); } -- cgit v1.2.3 From cafa8fcd5a5d593f4638b199fbf5f94a006a4aac Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 12 Jul 2014 23:23:56 -0700 Subject: And add awkgram.c... --- awkgram.c | 719 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 357 insertions(+), 362 deletions(-) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index 9335963f..d049c611 100644 --- a/awkgram.c +++ b/awkgram.c @@ -655,25 +655,25 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 202, 202, 204, 213, 214, 220, 232, 237, 248, - 254, 259, 267, 275, 277, 282, 290, 292, 298, 299, - 301, 327, 338, 349, 355, 364, 374, 376, 378, 384, - 389, 390, 394, 413, 412, 446, 448, 453, 454, 477, - 482, 483, 487, 489, 491, 498, 588, 630, 672, 785, - 792, 799, 809, 818, 827, 836, 847, 863, 862, 886, - 898, 898, 996, 996, 1029, 1059, 1065, 1066, 1072, 1073, - 1080, 1085, 1097, 1111, 1113, 1121, 1126, 1128, 1136, 1138, - 1147, 1148, 1156, 1161, 1161, 1172, 1176, 1184, 1185, 1188, - 1190, 1195, 1196, 1205, 1206, 1211, 1216, 1222, 1224, 1226, - 1233, 1234, 1240, 1241, 1246, 1248, 1253, 1255, 1263, 1268, - 1277, 1284, 1286, 1288, 1304, 1314, 1321, 1323, 1328, 1330, - 1332, 1340, 1342, 1347, 1349, 1354, 1356, 1358, 1408, 1410, - 1412, 1414, 1416, 1418, 1420, 1422, 1436, 1441, 1446, 1471, - 1477, 1479, 1481, 1483, 1485, 1487, 1492, 1496, 1528, 1530, - 1536, 1542, 1555, 1556, 1557, 1562, 1567, 1571, 1575, 1590, - 1603, 1608, 1644, 1662, 1663, 1669, 1670, 1675, 1677, 1684, - 1701, 1718, 1720, 1727, 1732, 1740, 1750, 1762, 1771, 1775, - 1779, 1783, 1787, 1791, 1794, 1796, 1800, 1804, 1808 + 0, 202, 202, 204, 209, 210, 216, 228, 232, 243, + 249, 254, 262, 270, 272, 277, 285, 287, 293, 294, + 296, 322, 333, 344, 350, 359, 369, 371, 373, 379, + 384, 385, 389, 408, 407, 441, 443, 448, 449, 472, + 477, 478, 482, 484, 486, 493, 583, 625, 667, 780, + 787, 794, 804, 813, 822, 831, 842, 858, 857, 881, + 893, 893, 991, 991, 1024, 1054, 1060, 1061, 1067, 1068, + 1075, 1080, 1092, 1106, 1108, 1116, 1121, 1123, 1131, 1133, + 1142, 1143, 1151, 1156, 1156, 1167, 1171, 1179, 1180, 1183, + 1185, 1190, 1191, 1200, 1201, 1206, 1211, 1217, 1219, 1221, + 1228, 1229, 1235, 1236, 1241, 1243, 1248, 1250, 1258, 1263, + 1272, 1279, 1281, 1283, 1299, 1309, 1316, 1318, 1323, 1325, + 1327, 1335, 1337, 1342, 1344, 1349, 1351, 1353, 1403, 1405, + 1407, 1409, 1411, 1413, 1415, 1417, 1431, 1436, 1441, 1466, + 1472, 1474, 1476, 1478, 1480, 1482, 1487, 1491, 1523, 1525, + 1531, 1537, 1550, 1551, 1552, 1557, 1562, 1566, 1570, 1585, + 1598, 1603, 1639, 1657, 1658, 1664, 1665, 1670, 1672, 1679, + 1696, 1713, 1715, 1722, 1727, 1735, 1745, 1757, 1766, 1770, + 1774, 1778, 1782, 1786, 1789, 1791, 1795, 1799, 1803 }; #endif @@ -1848,28 +1848,24 @@ yyreduce: case 3: #line 205 "awkgram.y" /* yacc.c:1646 */ { - if (comment != NULL) { - (yyvsp[0]) = list_prepend((yyvsp[0]), comment); - comment = NULL; - } rule = 0; yyerrok; } -#line 1859 "awkgram.c" /* yacc.c:1646 */ +#line 1855 "awkgram.c" /* yacc.c:1646 */ break; case 5: -#line 215 "awkgram.y" /* yacc.c:1646 */ +#line 211 "awkgram.y" /* yacc.c:1646 */ { next_sourcefile(); if (sourcefile == srcfiles) process_deferred(); } -#line 1869 "awkgram.c" /* yacc.c:1646 */ +#line 1865 "awkgram.c" /* yacc.c:1646 */ break; case 6: -#line 221 "awkgram.y" /* yacc.c:1646 */ +#line 217 "awkgram.y" /* yacc.c:1646 */ { rule = 0; /* @@ -1878,20 +1874,19 @@ yyreduce: */ /* yyerrok; */ } -#line 1882 "awkgram.c" /* yacc.c:1646 */ +#line 1878 "awkgram.c" /* yacc.c:1646 */ break; case 7: -#line 233 "awkgram.y" /* yacc.c:1646 */ +#line 229 "awkgram.y" /* yacc.c:1646 */ { -// (void) append_rule($1, $2); - (yyval) = append_rule((yyvsp[-1]), (yyvsp[0])); + (void) append_rule((yyvsp[-1]), (yyvsp[0])); } -#line 1891 "awkgram.c" /* yacc.c:1646 */ +#line 1886 "awkgram.c" /* yacc.c:1646 */ break; case 8: -#line 238 "awkgram.y" /* yacc.c:1646 */ +#line 233 "awkgram.y" /* yacc.c:1646 */ { if (rule != Rule) { msg(_("%s blocks must have an action part"), ruletab[rule]); @@ -1902,39 +1897,39 @@ yyreduce: } else /* pattern rule with non-empty pattern */ (void) append_rule((yyvsp[-1]), NULL); } -#line 1906 "awkgram.c" /* yacc.c:1646 */ +#line 1901 "awkgram.c" /* yacc.c:1646 */ break; case 9: -#line 249 "awkgram.y" /* yacc.c:1646 */ +#line 244 "awkgram.y" /* yacc.c:1646 */ { in_function = NULL; (void) mk_function((yyvsp[-1]), (yyvsp[0])); yyerrok; } -#line 1916 "awkgram.c" /* yacc.c:1646 */ +#line 1911 "awkgram.c" /* yacc.c:1646 */ break; case 10: -#line 255 "awkgram.y" /* yacc.c:1646 */ +#line 250 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } -#line 1925 "awkgram.c" /* yacc.c:1646 */ +#line 1920 "awkgram.c" /* yacc.c:1646 */ break; case 11: -#line 260 "awkgram.y" /* yacc.c:1646 */ +#line 255 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } -#line 1934 "awkgram.c" /* yacc.c:1646 */ +#line 1929 "awkgram.c" /* yacc.c:1646 */ break; case 12: -#line 268 "awkgram.y" /* yacc.c:1646 */ +#line 263 "awkgram.y" /* yacc.c:1646 */ { if (include_source((yyvsp[0])) < 0) YYABORT; @@ -1942,23 +1937,23 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1946 "awkgram.c" /* yacc.c:1646 */ +#line 1941 "awkgram.c" /* yacc.c:1646 */ break; case 13: -#line 276 "awkgram.y" /* yacc.c:1646 */ +#line 271 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1952 "awkgram.c" /* yacc.c:1646 */ +#line 1947 "awkgram.c" /* yacc.c:1646 */ break; case 14: -#line 278 "awkgram.y" /* yacc.c:1646 */ +#line 273 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1958 "awkgram.c" /* yacc.c:1646 */ +#line 1953 "awkgram.c" /* yacc.c:1646 */ break; case 15: -#line 283 "awkgram.y" /* yacc.c:1646 */ +#line 278 "awkgram.y" /* yacc.c:1646 */ { if (load_library((yyvsp[0])) < 0) YYABORT; @@ -1966,35 +1961,35 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1970 "awkgram.c" /* yacc.c:1646 */ +#line 1965 "awkgram.c" /* yacc.c:1646 */ break; case 16: -#line 291 "awkgram.y" /* yacc.c:1646 */ +#line 286 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1976 "awkgram.c" /* yacc.c:1646 */ +#line 1971 "awkgram.c" /* yacc.c:1646 */ break; case 17: -#line 293 "awkgram.y" /* yacc.c:1646 */ +#line 288 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1982 "awkgram.c" /* yacc.c:1646 */ +#line 1977 "awkgram.c" /* yacc.c:1646 */ break; case 18: -#line 298 "awkgram.y" /* yacc.c:1646 */ +#line 293 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; rule = Rule; } -#line 1988 "awkgram.c" /* yacc.c:1646 */ +#line 1983 "awkgram.c" /* yacc.c:1646 */ break; case 19: -#line 300 "awkgram.y" /* yacc.c:1646 */ +#line 295 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); rule = Rule; } -#line 1994 "awkgram.c" /* yacc.c:1646 */ +#line 1989 "awkgram.c" /* yacc.c:1646 */ break; case 20: -#line 302 "awkgram.y" /* yacc.c:1646 */ +#line 297 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *tp; @@ -2020,11 +2015,11 @@ yyreduce: (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); rule = Rule; } -#line 2024 "awkgram.c" /* yacc.c:1646 */ +#line 2019 "awkgram.c" /* yacc.c:1646 */ break; case 21: -#line 328 "awkgram.y" /* yacc.c:1646 */ +#line 323 "awkgram.y" /* yacc.c:1646 */ { static int begin_seen = 0; if (do_lint_old && ++begin_seen == 2) @@ -2035,11 +2030,11 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2039 "awkgram.c" /* yacc.c:1646 */ +#line 2034 "awkgram.c" /* yacc.c:1646 */ break; case 22: -#line 339 "awkgram.y" /* yacc.c:1646 */ +#line 334 "awkgram.y" /* yacc.c:1646 */ { static int end_seen = 0; if (do_lint_old && ++end_seen == 2) @@ -2050,70 +2045,70 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2054 "awkgram.c" /* yacc.c:1646 */ +#line 2049 "awkgram.c" /* yacc.c:1646 */ break; case 23: -#line 350 "awkgram.y" /* yacc.c:1646 */ +#line 345 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->in_rule = rule = BEGINFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2064 "awkgram.c" /* yacc.c:1646 */ +#line 2059 "awkgram.c" /* yacc.c:1646 */ break; case 24: -#line 356 "awkgram.y" /* yacc.c:1646 */ +#line 351 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->in_rule = rule = ENDFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2074 "awkgram.c" /* yacc.c:1646 */ +#line 2069 "awkgram.c" /* yacc.c:1646 */ break; case 25: -#line 365 "awkgram.y" /* yacc.c:1646 */ +#line 360 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-3]) == NULL) (yyval) = list_create(instruction(Op_no_op)); else (yyval) = (yyvsp[-3]); } -#line 2085 "awkgram.c" /* yacc.c:1646 */ +#line 2080 "awkgram.c" /* yacc.c:1646 */ break; case 26: -#line 375 "awkgram.y" /* yacc.c:1646 */ +#line 370 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2091 "awkgram.c" /* yacc.c:1646 */ +#line 2086 "awkgram.c" /* yacc.c:1646 */ break; case 27: -#line 377 "awkgram.y" /* yacc.c:1646 */ +#line 372 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2097 "awkgram.c" /* yacc.c:1646 */ +#line 2092 "awkgram.c" /* yacc.c:1646 */ break; case 28: -#line 379 "awkgram.y" /* yacc.c:1646 */ +#line 374 "awkgram.y" /* yacc.c:1646 */ { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); YYABORT; } -#line 2107 "awkgram.c" /* yacc.c:1646 */ +#line 2102 "awkgram.c" /* yacc.c:1646 */ break; case 29: -#line 385 "awkgram.y" /* yacc.c:1646 */ +#line 380 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2113 "awkgram.c" /* yacc.c:1646 */ +#line 2108 "awkgram.c" /* yacc.c:1646 */ break; case 32: -#line 395 "awkgram.y" /* yacc.c:1646 */ +#line 390 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-5])->source_file = source; if (install_function((yyvsp[-4])->lextok, (yyvsp[-5]), (yyvsp[-2])) < 0) @@ -2124,17 +2119,17 @@ yyreduce: /* $4 already free'd in install_function */ (yyval) = (yyvsp[-5]); } -#line 2128 "awkgram.c" /* yacc.c:1646 */ +#line 2123 "awkgram.c" /* yacc.c:1646 */ break; case 33: -#line 413 "awkgram.y" /* yacc.c:1646 */ +#line 408 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } -#line 2134 "awkgram.c" /* yacc.c:1646 */ +#line 2129 "awkgram.c" /* yacc.c:1646 */ break; case 34: -#line 415 "awkgram.y" /* yacc.c:1646 */ +#line 410 "awkgram.y" /* yacc.c:1646 */ { NODE *n, *exp; char *re; @@ -2163,23 +2158,23 @@ yyreduce: (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2167 "awkgram.c" /* yacc.c:1646 */ +#line 2162 "awkgram.c" /* yacc.c:1646 */ break; case 35: -#line 447 "awkgram.y" /* yacc.c:1646 */ +#line 442 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[0])); } -#line 2173 "awkgram.c" /* yacc.c:1646 */ +#line 2168 "awkgram.c" /* yacc.c:1646 */ break; case 37: -#line 453 "awkgram.y" /* yacc.c:1646 */ +#line 448 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2179 "awkgram.c" /* yacc.c:1646 */ +#line 2174 "awkgram.c" /* yacc.c:1646 */ break; case 38: -#line 455 "awkgram.y" /* yacc.c:1646 */ +#line 450 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0]) == NULL) { if (comment == NULL) @@ -2202,40 +2197,40 @@ yyreduce: comment = NULL; yyerrok; } -#line 2206 "awkgram.c" /* yacc.c:1646 */ +#line 2201 "awkgram.c" /* yacc.c:1646 */ break; case 39: -#line 478 "awkgram.y" /* yacc.c:1646 */ +#line 473 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2212 "awkgram.c" /* yacc.c:1646 */ +#line 2207 "awkgram.c" /* yacc.c:1646 */ break; case 42: -#line 488 "awkgram.y" /* yacc.c:1646 */ +#line 483 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2218 "awkgram.c" /* yacc.c:1646 */ +#line 2213 "awkgram.c" /* yacc.c:1646 */ break; case 43: -#line 490 "awkgram.y" /* yacc.c:1646 */ +#line 485 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2224 "awkgram.c" /* yacc.c:1646 */ +#line 2219 "awkgram.c" /* yacc.c:1646 */ break; case 44: -#line 492 "awkgram.y" /* yacc.c:1646 */ +#line 487 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2235 "awkgram.c" /* yacc.c:1646 */ +#line 2230 "awkgram.c" /* yacc.c:1646 */ break; case 45: -#line 499 "awkgram.y" /* yacc.c:1646 */ +#line 494 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2325,11 +2320,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2329 "awkgram.c" /* yacc.c:1646 */ +#line 2324 "awkgram.c" /* yacc.c:1646 */ break; case 46: -#line 589 "awkgram.y" /* yacc.c:1646 */ +#line 584 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2371,11 +2366,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2375 "awkgram.c" /* yacc.c:1646 */ +#line 2370 "awkgram.c" /* yacc.c:1646 */ break; case 47: -#line 631 "awkgram.y" /* yacc.c:1646 */ +#line 626 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2417,11 +2412,11 @@ yyreduce: } /* else $1 and $4 are NULLs */ } -#line 2421 "awkgram.c" /* yacc.c:1646 */ +#line 2416 "awkgram.c" /* yacc.c:1646 */ break; case 48: -#line 673 "awkgram.y" /* yacc.c:1646 */ +#line 668 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; char *var_name = (yyvsp[-5])->lextok; @@ -2534,44 +2529,44 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2538 "awkgram.c" /* yacc.c:1646 */ +#line 2533 "awkgram.c" /* yacc.c:1646 */ break; case 49: -#line 786 "awkgram.y" /* yacc.c:1646 */ +#line 781 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2549 "awkgram.c" /* yacc.c:1646 */ +#line 2544 "awkgram.c" /* yacc.c:1646 */ break; case 50: -#line 793 "awkgram.y" /* yacc.c:1646 */ +#line 788 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2560 "awkgram.c" /* yacc.c:1646 */ +#line 2555 "awkgram.c" /* yacc.c:1646 */ break; case 51: -#line 800 "awkgram.y" /* yacc.c:1646 */ +#line 795 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2571 "awkgram.c" /* yacc.c:1646 */ +#line 2566 "awkgram.c" /* yacc.c:1646 */ break; case 52: -#line 810 "awkgram.y" /* yacc.c:1646 */ +#line 805 "awkgram.y" /* yacc.c:1646 */ { if (! break_allowed) error_ln((yyvsp[-1])->source_line, @@ -2580,11 +2575,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2584 "awkgram.c" /* yacc.c:1646 */ +#line 2579 "awkgram.c" /* yacc.c:1646 */ break; case 53: -#line 819 "awkgram.y" /* yacc.c:1646 */ +#line 814 "awkgram.y" /* yacc.c:1646 */ { if (! continue_allowed) error_ln((yyvsp[-1])->source_line, @@ -2593,11 +2588,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2597 "awkgram.c" /* yacc.c:1646 */ +#line 2592 "awkgram.c" /* yacc.c:1646 */ break; case 54: -#line 828 "awkgram.y" /* yacc.c:1646 */ +#line 823 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2606,11 +2601,11 @@ regular_loop: (yyvsp[-1])->target_jmp = ip_rec; (yyval) = list_create((yyvsp[-1])); } -#line 2610 "awkgram.c" /* yacc.c:1646 */ +#line 2605 "awkgram.c" /* yacc.c:1646 */ break; case 55: -#line 837 "awkgram.y" /* yacc.c:1646 */ +#line 832 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2621,11 +2616,11 @@ regular_loop: (yyvsp[-1])->target_endfile = ip_endfile; (yyval) = list_create((yyvsp[-1])); } -#line 2625 "awkgram.c" /* yacc.c:1646 */ +#line 2620 "awkgram.c" /* yacc.c:1646 */ break; case 56: -#line 848 "awkgram.y" /* yacc.c:1646 */ +#line 843 "awkgram.y" /* yacc.c:1646 */ { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2640,20 +2635,20 @@ regular_loop: } else (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); } -#line 2644 "awkgram.c" /* yacc.c:1646 */ +#line 2639 "awkgram.c" /* yacc.c:1646 */ break; case 57: -#line 863 "awkgram.y" /* yacc.c:1646 */ +#line 858 "awkgram.y" /* yacc.c:1646 */ { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2653 "awkgram.c" /* yacc.c:1646 */ +#line 2648 "awkgram.c" /* yacc.c:1646 */ break; case 58: -#line 866 "awkgram.y" /* yacc.c:1646 */ +#line 861 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) { (yyval) = list_create((yyvsp[-3])); @@ -2674,17 +2669,17 @@ regular_loop: (yyval) = list_append((yyvsp[-1]), (yyvsp[-3])); } } -#line 2678 "awkgram.c" /* yacc.c:1646 */ +#line 2673 "awkgram.c" /* yacc.c:1646 */ break; case 60: -#line 898 "awkgram.y" /* yacc.c:1646 */ +#line 893 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } -#line 2684 "awkgram.c" /* yacc.c:1646 */ +#line 2679 "awkgram.c" /* yacc.c:1646 */ break; case 61: -#line 899 "awkgram.y" /* yacc.c:1646 */ +#line 894 "awkgram.y" /* yacc.c:1646 */ { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2781,17 +2776,17 @@ regular_print: } } } -#line 2785 "awkgram.c" /* yacc.c:1646 */ +#line 2780 "awkgram.c" /* yacc.c:1646 */ break; case 62: -#line 996 "awkgram.y" /* yacc.c:1646 */ +#line 991 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } -#line 2791 "awkgram.c" /* yacc.c:1646 */ +#line 2786 "awkgram.c" /* yacc.c:1646 */ break; case 63: -#line 997 "awkgram.y" /* yacc.c:1646 */ +#line 992 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-2])->lextok; @@ -2824,11 +2819,11 @@ regular_print: (yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3])); } } -#line 2828 "awkgram.c" /* yacc.c:1646 */ +#line 2823 "awkgram.c" /* yacc.c:1646 */ break; case 64: -#line 1034 "awkgram.y" /* yacc.c:1646 */ +#line 1029 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; char *arr = (yyvsp[-1])->lextok; @@ -2854,52 +2849,52 @@ regular_print: fatal(_("`delete' is not allowed with FUNCTAB")); } } -#line 2858 "awkgram.c" /* yacc.c:1646 */ +#line 2853 "awkgram.c" /* yacc.c:1646 */ break; case 65: -#line 1060 "awkgram.y" /* yacc.c:1646 */ +#line 1055 "awkgram.y" /* yacc.c:1646 */ { (yyval) = optimize_assignment((yyvsp[0])); } -#line 2864 "awkgram.c" /* yacc.c:1646 */ +#line 2859 "awkgram.c" /* yacc.c:1646 */ break; case 66: -#line 1065 "awkgram.y" /* yacc.c:1646 */ +#line 1060 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2870 "awkgram.c" /* yacc.c:1646 */ +#line 2865 "awkgram.c" /* yacc.c:1646 */ break; case 67: -#line 1067 "awkgram.y" /* yacc.c:1646 */ +#line 1062 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2876 "awkgram.c" /* yacc.c:1646 */ +#line 2871 "awkgram.c" /* yacc.c:1646 */ break; case 68: -#line 1072 "awkgram.y" /* yacc.c:1646 */ +#line 1067 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2882 "awkgram.c" /* yacc.c:1646 */ +#line 2877 "awkgram.c" /* yacc.c:1646 */ break; case 69: -#line 1074 "awkgram.y" /* yacc.c:1646 */ +#line 1069 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) (yyval) = list_create((yyvsp[0])); else (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } -#line 2893 "awkgram.c" /* yacc.c:1646 */ +#line 2888 "awkgram.c" /* yacc.c:1646 */ break; case 70: -#line 1081 "awkgram.y" /* yacc.c:1646 */ +#line 1076 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2899 "awkgram.c" /* yacc.c:1646 */ +#line 2894 "awkgram.c" /* yacc.c:1646 */ break; case 71: -#line 1086 "awkgram.y" /* yacc.c:1646 */ +#line 1081 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2911,11 +2906,11 @@ regular_print: bcfree((yyvsp[-2])); (yyval) = (yyvsp[-4]); } -#line 2915 "awkgram.c" /* yacc.c:1646 */ +#line 2910 "awkgram.c" /* yacc.c:1646 */ break; case 72: -#line 1098 "awkgram.y" /* yacc.c:1646 */ +#line 1093 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2926,17 +2921,17 @@ regular_print: (yyvsp[-3])->case_stmt = casestmt; (yyval) = (yyvsp[-3]); } -#line 2930 "awkgram.c" /* yacc.c:1646 */ +#line 2925 "awkgram.c" /* yacc.c:1646 */ break; case 73: -#line 1112 "awkgram.y" /* yacc.c:1646 */ +#line 1107 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2936 "awkgram.c" /* yacc.c:1646 */ +#line 2931 "awkgram.c" /* yacc.c:1646 */ break; case 74: -#line 1114 "awkgram.y" /* yacc.c:1646 */ +#line 1109 "awkgram.y" /* yacc.c:1646 */ { NODE *n = (yyvsp[0])->memory; (void) force_number(n); @@ -2944,71 +2939,71 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2948 "awkgram.c" /* yacc.c:1646 */ +#line 2943 "awkgram.c" /* yacc.c:1646 */ break; case 75: -#line 1122 "awkgram.y" /* yacc.c:1646 */ +#line 1117 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2957 "awkgram.c" /* yacc.c:1646 */ +#line 2952 "awkgram.c" /* yacc.c:1646 */ break; case 76: -#line 1127 "awkgram.y" /* yacc.c:1646 */ +#line 1122 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2963 "awkgram.c" /* yacc.c:1646 */ +#line 2958 "awkgram.c" /* yacc.c:1646 */ break; case 77: -#line 1129 "awkgram.y" /* yacc.c:1646 */ +#line 1124 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_push_re; (yyval) = (yyvsp[0]); } -#line 2972 "awkgram.c" /* yacc.c:1646 */ +#line 2967 "awkgram.c" /* yacc.c:1646 */ break; case 78: -#line 1137 "awkgram.y" /* yacc.c:1646 */ +#line 1132 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2978 "awkgram.c" /* yacc.c:1646 */ +#line 2973 "awkgram.c" /* yacc.c:1646 */ break; case 79: -#line 1139 "awkgram.y" /* yacc.c:1646 */ +#line 1134 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2984 "awkgram.c" /* yacc.c:1646 */ +#line 2979 "awkgram.c" /* yacc.c:1646 */ break; case 81: -#line 1149 "awkgram.y" /* yacc.c:1646 */ +#line 1144 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2992 "awkgram.c" /* yacc.c:1646 */ +#line 2987 "awkgram.c" /* yacc.c:1646 */ break; case 82: -#line 1156 "awkgram.y" /* yacc.c:1646 */ +#line 1151 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; (yyval) = NULL; } -#line 3002 "awkgram.c" /* yacc.c:1646 */ +#line 2997 "awkgram.c" /* yacc.c:1646 */ break; case 83: -#line 1161 "awkgram.y" /* yacc.c:1646 */ +#line 1156 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } -#line 3008 "awkgram.c" /* yacc.c:1646 */ +#line 3003 "awkgram.c" /* yacc.c:1646 */ break; case 84: -#line 1162 "awkgram.y" /* yacc.c:1646 */ +#line 1157 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->redir_type == redirect_twoway && (yyvsp[0])->lasti->opcode == Op_K_getline_redir @@ -3016,136 +3011,136 @@ regular_print: yyerror(_("multistage two-way pipelines don't work")); (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } -#line 3020 "awkgram.c" /* yacc.c:1646 */ +#line 3015 "awkgram.c" /* yacc.c:1646 */ break; case 85: -#line 1173 "awkgram.y" /* yacc.c:1646 */ +#line 1168 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } -#line 3028 "awkgram.c" /* yacc.c:1646 */ +#line 3023 "awkgram.c" /* yacc.c:1646 */ break; case 86: -#line 1178 "awkgram.y" /* yacc.c:1646 */ +#line 1173 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } -#line 3036 "awkgram.c" /* yacc.c:1646 */ +#line 3031 "awkgram.c" /* yacc.c:1646 */ break; case 91: -#line 1195 "awkgram.y" /* yacc.c:1646 */ +#line 1190 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3042 "awkgram.c" /* yacc.c:1646 */ +#line 3037 "awkgram.c" /* yacc.c:1646 */ break; case 92: -#line 1197 "awkgram.y" /* yacc.c:1646 */ +#line 1192 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3051 "awkgram.c" /* yacc.c:1646 */ +#line 3046 "awkgram.c" /* yacc.c:1646 */ break; case 93: -#line 1205 "awkgram.y" /* yacc.c:1646 */ +#line 1200 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3057 "awkgram.c" /* yacc.c:1646 */ +#line 3052 "awkgram.c" /* yacc.c:1646 */ break; case 94: -#line 1207 "awkgram.y" /* yacc.c:1646 */ +#line 1202 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]) ; } -#line 3063 "awkgram.c" /* yacc.c:1646 */ +#line 3058 "awkgram.c" /* yacc.c:1646 */ break; case 95: -#line 1212 "awkgram.y" /* yacc.c:1646 */ +#line 1207 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = 0; (yyval) = list_create((yyvsp[0])); } -#line 3072 "awkgram.c" /* yacc.c:1646 */ +#line 3067 "awkgram.c" /* yacc.c:1646 */ break; case 96: -#line 1217 "awkgram.y" /* yacc.c:1646 */ +#line 1212 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; (yyval) = list_append((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3082 "awkgram.c" /* yacc.c:1646 */ +#line 3077 "awkgram.c" /* yacc.c:1646 */ break; case 97: -#line 1223 "awkgram.y" /* yacc.c:1646 */ +#line 1218 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3088 "awkgram.c" /* yacc.c:1646 */ +#line 3083 "awkgram.c" /* yacc.c:1646 */ break; case 98: -#line 1225 "awkgram.y" /* yacc.c:1646 */ +#line 1220 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3094 "awkgram.c" /* yacc.c:1646 */ +#line 3089 "awkgram.c" /* yacc.c:1646 */ break; case 99: -#line 1227 "awkgram.y" /* yacc.c:1646 */ +#line 1222 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } -#line 3100 "awkgram.c" /* yacc.c:1646 */ +#line 3095 "awkgram.c" /* yacc.c:1646 */ break; case 100: -#line 1233 "awkgram.y" /* yacc.c:1646 */ +#line 1228 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3106 "awkgram.c" /* yacc.c:1646 */ +#line 3101 "awkgram.c" /* yacc.c:1646 */ break; case 101: -#line 1235 "awkgram.y" /* yacc.c:1646 */ +#line 1230 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3112 "awkgram.c" /* yacc.c:1646 */ +#line 3107 "awkgram.c" /* yacc.c:1646 */ break; case 102: -#line 1240 "awkgram.y" /* yacc.c:1646 */ +#line 1235 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3118 "awkgram.c" /* yacc.c:1646 */ +#line 3113 "awkgram.c" /* yacc.c:1646 */ break; case 103: -#line 1242 "awkgram.y" /* yacc.c:1646 */ +#line 1237 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3124 "awkgram.c" /* yacc.c:1646 */ +#line 3119 "awkgram.c" /* yacc.c:1646 */ break; case 104: -#line 1247 "awkgram.y" /* yacc.c:1646 */ +#line 1242 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3130 "awkgram.c" /* yacc.c:1646 */ +#line 3125 "awkgram.c" /* yacc.c:1646 */ break; case 105: -#line 1249 "awkgram.y" /* yacc.c:1646 */ +#line 1244 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3139 "awkgram.c" /* yacc.c:1646 */ +#line 3134 "awkgram.c" /* yacc.c:1646 */ break; case 106: -#line 1254 "awkgram.y" /* yacc.c:1646 */ +#line 1249 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3145 "awkgram.c" /* yacc.c:1646 */ +#line 3140 "awkgram.c" /* yacc.c:1646 */ break; case 107: -#line 1256 "awkgram.y" /* yacc.c:1646 */ +#line 1251 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3153,52 +3148,52 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3157 "awkgram.c" /* yacc.c:1646 */ +#line 3152 "awkgram.c" /* yacc.c:1646 */ break; case 108: -#line 1264 "awkgram.y" /* yacc.c:1646 */ +#line 1259 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3166 "awkgram.c" /* yacc.c:1646 */ +#line 3161 "awkgram.c" /* yacc.c:1646 */ break; case 109: -#line 1269 "awkgram.y" /* yacc.c:1646 */ +#line 1264 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3175 "awkgram.c" /* yacc.c:1646 */ +#line 3170 "awkgram.c" /* yacc.c:1646 */ break; case 110: -#line 1278 "awkgram.y" /* yacc.c:1646 */ +#line 1273 "awkgram.y" /* yacc.c:1646 */ { if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec) lintwarn_ln((yyvsp[-1])->source_line, _("regular expression on right of assignment")); (yyval) = mk_assignment((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3186 "awkgram.c" /* yacc.c:1646 */ +#line 3181 "awkgram.c" /* yacc.c:1646 */ break; case 111: -#line 1285 "awkgram.y" /* yacc.c:1646 */ +#line 1280 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3192 "awkgram.c" /* yacc.c:1646 */ +#line 3187 "awkgram.c" /* yacc.c:1646 */ break; case 112: -#line 1287 "awkgram.y" /* yacc.c:1646 */ +#line 1282 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3198 "awkgram.c" /* yacc.c:1646 */ +#line 3193 "awkgram.c" /* yacc.c:1646 */ break; case 113: -#line 1289 "awkgram.y" /* yacc.c:1646 */ +#line 1284 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[-1])->source_line, @@ -3214,11 +3209,11 @@ regular_print: (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } -#line 3218 "awkgram.c" /* yacc.c:1646 */ +#line 3213 "awkgram.c" /* yacc.c:1646 */ break; case 114: -#line 1305 "awkgram.y" /* yacc.c:1646 */ +#line 1300 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) warning_ln((yyvsp[-1])->source_line, @@ -3228,91 +3223,91 @@ regular_print: (yyvsp[-1])->expr_count = 1; (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3232 "awkgram.c" /* yacc.c:1646 */ +#line 3227 "awkgram.c" /* yacc.c:1646 */ break; case 115: -#line 1315 "awkgram.y" /* yacc.c:1646 */ +#line 1310 "awkgram.y" /* yacc.c:1646 */ { if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec) lintwarn_ln((yyvsp[-1])->source_line, _("regular expression on right of comparison")); (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3243 "awkgram.c" /* yacc.c:1646 */ +#line 3238 "awkgram.c" /* yacc.c:1646 */ break; case 116: -#line 1322 "awkgram.y" /* yacc.c:1646 */ +#line 1317 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3249 "awkgram.c" /* yacc.c:1646 */ +#line 3244 "awkgram.c" /* yacc.c:1646 */ break; case 117: -#line 1324 "awkgram.y" /* yacc.c:1646 */ +#line 1319 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3255 "awkgram.c" /* yacc.c:1646 */ +#line 3250 "awkgram.c" /* yacc.c:1646 */ break; case 118: -#line 1329 "awkgram.y" /* yacc.c:1646 */ +#line 1324 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3261 "awkgram.c" /* yacc.c:1646 */ +#line 3256 "awkgram.c" /* yacc.c:1646 */ break; case 119: -#line 1331 "awkgram.y" /* yacc.c:1646 */ +#line 1326 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3267 "awkgram.c" /* yacc.c:1646 */ +#line 3262 "awkgram.c" /* yacc.c:1646 */ break; case 120: -#line 1333 "awkgram.y" /* yacc.c:1646 */ +#line 1328 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_assign_quotient; (yyval) = (yyvsp[0]); } -#line 3276 "awkgram.c" /* yacc.c:1646 */ +#line 3271 "awkgram.c" /* yacc.c:1646 */ break; case 121: -#line 1341 "awkgram.y" /* yacc.c:1646 */ +#line 1336 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3282 "awkgram.c" /* yacc.c:1646 */ +#line 3277 "awkgram.c" /* yacc.c:1646 */ break; case 122: -#line 1343 "awkgram.y" /* yacc.c:1646 */ +#line 1338 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3288 "awkgram.c" /* yacc.c:1646 */ +#line 3283 "awkgram.c" /* yacc.c:1646 */ break; case 123: -#line 1348 "awkgram.y" /* yacc.c:1646 */ +#line 1343 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3294 "awkgram.c" /* yacc.c:1646 */ +#line 3289 "awkgram.c" /* yacc.c:1646 */ break; case 124: -#line 1350 "awkgram.y" /* yacc.c:1646 */ +#line 1345 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3300 "awkgram.c" /* yacc.c:1646 */ +#line 3295 "awkgram.c" /* yacc.c:1646 */ break; case 125: -#line 1355 "awkgram.y" /* yacc.c:1646 */ +#line 1350 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3306 "awkgram.c" /* yacc.c:1646 */ +#line 3301 "awkgram.c" /* yacc.c:1646 */ break; case 126: -#line 1357 "awkgram.y" /* yacc.c:1646 */ +#line 1352 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3312 "awkgram.c" /* yacc.c:1646 */ +#line 3307 "awkgram.c" /* yacc.c:1646 */ break; case 127: -#line 1359 "awkgram.y" /* yacc.c:1646 */ +#line 1354 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; @@ -3359,47 +3354,47 @@ regular_print: max_args = count; } } -#line 3363 "awkgram.c" /* yacc.c:1646 */ +#line 3358 "awkgram.c" /* yacc.c:1646 */ break; case 129: -#line 1411 "awkgram.y" /* yacc.c:1646 */ +#line 1406 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3369 "awkgram.c" /* yacc.c:1646 */ +#line 3364 "awkgram.c" /* yacc.c:1646 */ break; case 130: -#line 1413 "awkgram.y" /* yacc.c:1646 */ +#line 1408 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3375 "awkgram.c" /* yacc.c:1646 */ +#line 3370 "awkgram.c" /* yacc.c:1646 */ break; case 131: -#line 1415 "awkgram.y" /* yacc.c:1646 */ +#line 1410 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3381 "awkgram.c" /* yacc.c:1646 */ +#line 3376 "awkgram.c" /* yacc.c:1646 */ break; case 132: -#line 1417 "awkgram.y" /* yacc.c:1646 */ +#line 1412 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3387 "awkgram.c" /* yacc.c:1646 */ +#line 3382 "awkgram.c" /* yacc.c:1646 */ break; case 133: -#line 1419 "awkgram.y" /* yacc.c:1646 */ +#line 1414 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3393 "awkgram.c" /* yacc.c:1646 */ +#line 3388 "awkgram.c" /* yacc.c:1646 */ break; case 134: -#line 1421 "awkgram.y" /* yacc.c:1646 */ +#line 1416 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3399 "awkgram.c" /* yacc.c:1646 */ +#line 3394 "awkgram.c" /* yacc.c:1646 */ break; case 135: -#line 1423 "awkgram.y" /* yacc.c:1646 */ +#line 1418 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3413,29 +3408,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } -#line 3417 "awkgram.c" /* yacc.c:1646 */ +#line 3412 "awkgram.c" /* yacc.c:1646 */ break; case 136: -#line 1437 "awkgram.y" /* yacc.c:1646 */ +#line 1432 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3426 "awkgram.c" /* yacc.c:1646 */ +#line 3421 "awkgram.c" /* yacc.c:1646 */ break; case 137: -#line 1442 "awkgram.y" /* yacc.c:1646 */ +#line 1437 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3435 "awkgram.c" /* yacc.c:1646 */ +#line 3430 "awkgram.c" /* yacc.c:1646 */ break; case 138: -#line 1447 "awkgram.y" /* yacc.c:1646 */ +#line 1442 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { warning_ln((yyvsp[-1])->source_line, @@ -3455,64 +3450,64 @@ regular_print: (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } -#line 3459 "awkgram.c" /* yacc.c:1646 */ +#line 3454 "awkgram.c" /* yacc.c:1646 */ break; case 139: -#line 1472 "awkgram.y" /* yacc.c:1646 */ +#line 1467 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); bcfree((yyvsp[-2])); } -#line 3468 "awkgram.c" /* yacc.c:1646 */ +#line 3463 "awkgram.c" /* yacc.c:1646 */ break; case 140: -#line 1478 "awkgram.y" /* yacc.c:1646 */ +#line 1473 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3474 "awkgram.c" /* yacc.c:1646 */ +#line 3469 "awkgram.c" /* yacc.c:1646 */ break; case 141: -#line 1480 "awkgram.y" /* yacc.c:1646 */ +#line 1475 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3480 "awkgram.c" /* yacc.c:1646 */ +#line 3475 "awkgram.c" /* yacc.c:1646 */ break; case 142: -#line 1482 "awkgram.y" /* yacc.c:1646 */ +#line 1477 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3486 "awkgram.c" /* yacc.c:1646 */ +#line 3481 "awkgram.c" /* yacc.c:1646 */ break; case 143: -#line 1484 "awkgram.y" /* yacc.c:1646 */ +#line 1479 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3492 "awkgram.c" /* yacc.c:1646 */ +#line 3487 "awkgram.c" /* yacc.c:1646 */ break; case 144: -#line 1486 "awkgram.y" /* yacc.c:1646 */ +#line 1481 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3498 "awkgram.c" /* yacc.c:1646 */ +#line 3493 "awkgram.c" /* yacc.c:1646 */ break; case 145: -#line 1488 "awkgram.y" /* yacc.c:1646 */ +#line 1483 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3504 "awkgram.c" /* yacc.c:1646 */ +#line 3499 "awkgram.c" /* yacc.c:1646 */ break; case 146: -#line 1493 "awkgram.y" /* yacc.c:1646 */ +#line 1488 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3512 "awkgram.c" /* yacc.c:1646 */ +#line 3507 "awkgram.c" /* yacc.c:1646 */ break; case 147: -#line 1497 "awkgram.y" /* yacc.c:1646 */ +#line 1492 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->opcode == Op_match_rec) { (yyvsp[0])->opcode = Op_nomatch; @@ -3544,37 +3539,37 @@ regular_print: } } } -#line 3548 "awkgram.c" /* yacc.c:1646 */ +#line 3543 "awkgram.c" /* yacc.c:1646 */ break; case 148: -#line 1529 "awkgram.y" /* yacc.c:1646 */ +#line 1524 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3554 "awkgram.c" /* yacc.c:1646 */ +#line 3549 "awkgram.c" /* yacc.c:1646 */ break; case 149: -#line 1531 "awkgram.y" /* yacc.c:1646 */ +#line 1526 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3564 "awkgram.c" /* yacc.c:1646 */ +#line 3559 "awkgram.c" /* yacc.c:1646 */ break; case 150: -#line 1537 "awkgram.y" /* yacc.c:1646 */ +#line 1532 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3574 "awkgram.c" /* yacc.c:1646 */ +#line 3569 "awkgram.c" /* yacc.c:1646 */ break; case 151: -#line 1543 "awkgram.y" /* yacc.c:1646 */ +#line 1538 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; @@ -3587,45 +3582,45 @@ regular_print: if ((yyval) == NULL) YYABORT; } -#line 3591 "awkgram.c" /* yacc.c:1646 */ +#line 3586 "awkgram.c" /* yacc.c:1646 */ break; case 154: -#line 1558 "awkgram.y" /* yacc.c:1646 */ +#line 1553 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3600 "awkgram.c" /* yacc.c:1646 */ +#line 3595 "awkgram.c" /* yacc.c:1646 */ break; case 155: -#line 1563 "awkgram.y" /* yacc.c:1646 */ +#line 1558 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3609 "awkgram.c" /* yacc.c:1646 */ +#line 3604 "awkgram.c" /* yacc.c:1646 */ break; case 156: -#line 1568 "awkgram.y" /* yacc.c:1646 */ +#line 1563 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3617 "awkgram.c" /* yacc.c:1646 */ +#line 3612 "awkgram.c" /* yacc.c:1646 */ break; case 157: -#line 1572 "awkgram.y" /* yacc.c:1646 */ +#line 1567 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3625 "awkgram.c" /* yacc.c:1646 */ +#line 3620 "awkgram.c" /* yacc.c:1646 */ break; case 158: -#line 1576 "awkgram.y" /* yacc.c:1646 */ +#line 1571 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0 @@ -3640,11 +3635,11 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3644 "awkgram.c" /* yacc.c:1646 */ +#line 3639 "awkgram.c" /* yacc.c:1646 */ break; case 159: -#line 1591 "awkgram.y" /* yacc.c:1646 */ +#line 1586 "awkgram.y" /* yacc.c:1646 */ { /* * was: $$ = $2 @@ -3654,20 +3649,20 @@ regular_print: (yyvsp[-1])->memory = make_number(0.0); (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } -#line 3658 "awkgram.c" /* yacc.c:1646 */ +#line 3653 "awkgram.c" /* yacc.c:1646 */ break; case 160: -#line 1604 "awkgram.y" /* yacc.c:1646 */ +#line 1599 "awkgram.y" /* yacc.c:1646 */ { func_use((yyvsp[0])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[0]); } -#line 3667 "awkgram.c" /* yacc.c:1646 */ +#line 3662 "awkgram.c" /* yacc.c:1646 */ break; case 161: -#line 1609 "awkgram.y" /* yacc.c:1646 */ +#line 1604 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3700,11 +3695,11 @@ regular_print: (yyval) = list_prepend((yyvsp[0]), t); } -#line 3704 "awkgram.c" /* yacc.c:1646 */ +#line 3699 "awkgram.c" /* yacc.c:1646 */ break; case 162: -#line 1645 "awkgram.y" /* yacc.c:1646 */ +#line 1640 "awkgram.y" /* yacc.c:1646 */ { param_sanity((yyvsp[-1])); (yyvsp[-3])->opcode = Op_func_call; @@ -3718,49 +3713,49 @@ regular_print: (yyval) = list_append(t, (yyvsp[-3])); } } -#line 3722 "awkgram.c" /* yacc.c:1646 */ +#line 3717 "awkgram.c" /* yacc.c:1646 */ break; case 163: -#line 1662 "awkgram.y" /* yacc.c:1646 */ +#line 1657 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3728 "awkgram.c" /* yacc.c:1646 */ +#line 3723 "awkgram.c" /* yacc.c:1646 */ break; case 164: -#line 1664 "awkgram.y" /* yacc.c:1646 */ +#line 1659 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3734 "awkgram.c" /* yacc.c:1646 */ +#line 3729 "awkgram.c" /* yacc.c:1646 */ break; case 165: -#line 1669 "awkgram.y" /* yacc.c:1646 */ +#line 1664 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3740 "awkgram.c" /* yacc.c:1646 */ +#line 3735 "awkgram.c" /* yacc.c:1646 */ break; case 166: -#line 1671 "awkgram.y" /* yacc.c:1646 */ +#line 1666 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3746 "awkgram.c" /* yacc.c:1646 */ +#line 3741 "awkgram.c" /* yacc.c:1646 */ break; case 167: -#line 1676 "awkgram.y" /* yacc.c:1646 */ +#line 1671 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3752 "awkgram.c" /* yacc.c:1646 */ +#line 3747 "awkgram.c" /* yacc.c:1646 */ break; case 168: -#line 1678 "awkgram.y" /* yacc.c:1646 */ +#line 1673 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3760 "awkgram.c" /* yacc.c:1646 */ +#line 3755 "awkgram.c" /* yacc.c:1646 */ break; case 169: -#line 1685 "awkgram.y" /* yacc.c:1646 */ +#line 1680 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3774,11 +3769,11 @@ regular_print: sub_counter++; /* count # of dimensions */ (yyval) = (yyvsp[0]); } -#line 3778 "awkgram.c" /* yacc.c:1646 */ +#line 3773 "awkgram.c" /* yacc.c:1646 */ break; case 170: -#line 1702 "awkgram.y" /* yacc.c:1646 */ +#line 1697 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *t = (yyvsp[-1]); if ((yyvsp[-1]) == NULL) { @@ -3792,31 +3787,31 @@ regular_print: (yyvsp[0])->sub_count = count_expressions(&t, false); (yyval) = list_append(t, (yyvsp[0])); } -#line 3796 "awkgram.c" /* yacc.c:1646 */ +#line 3791 "awkgram.c" /* yacc.c:1646 */ break; case 171: -#line 1719 "awkgram.y" /* yacc.c:1646 */ +#line 1714 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3802 "awkgram.c" /* yacc.c:1646 */ +#line 3797 "awkgram.c" /* yacc.c:1646 */ break; case 172: -#line 1721 "awkgram.y" /* yacc.c:1646 */ +#line 1716 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3810 "awkgram.c" /* yacc.c:1646 */ +#line 3805 "awkgram.c" /* yacc.c:1646 */ break; case 173: -#line 1728 "awkgram.y" /* yacc.c:1646 */ +#line 1723 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3816 "awkgram.c" /* yacc.c:1646 */ +#line 3811 "awkgram.c" /* yacc.c:1646 */ break; case 174: -#line 1733 "awkgram.y" /* yacc.c:1646 */ +#line 1728 "awkgram.y" /* yacc.c:1646 */ { char *var_name = (yyvsp[0])->lextok; @@ -3824,22 +3819,22 @@ regular_print: (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); (yyval) = list_create((yyvsp[0])); } -#line 3828 "awkgram.c" /* yacc.c:1646 */ +#line 3823 "awkgram.c" /* yacc.c:1646 */ break; case 175: -#line 1741 "awkgram.y" /* yacc.c:1646 */ +#line 1736 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-1])->lextok; (yyvsp[-1])->memory = variable((yyvsp[-1])->source_line, arr, Node_var_new); (yyvsp[-1])->opcode = Op_push_array; (yyval) = list_prepend((yyvsp[0]), (yyvsp[-1])); } -#line 3839 "awkgram.c" /* yacc.c:1646 */ +#line 3834 "awkgram.c" /* yacc.c:1646 */ break; case 176: -#line 1751 "awkgram.y" /* yacc.c:1646 */ +#line 1746 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push @@ -3851,73 +3846,73 @@ regular_print: } else (yyval) = (yyvsp[0]); } -#line 3855 "awkgram.c" /* yacc.c:1646 */ +#line 3850 "awkgram.c" /* yacc.c:1646 */ break; case 177: -#line 1763 "awkgram.y" /* yacc.c:1646 */ +#line 1758 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); if ((yyvsp[0]) != NULL) mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3865 "awkgram.c" /* yacc.c:1646 */ +#line 3860 "awkgram.c" /* yacc.c:1646 */ break; case 178: -#line 1772 "awkgram.y" /* yacc.c:1646 */ +#line 1767 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; } -#line 3873 "awkgram.c" /* yacc.c:1646 */ +#line 3868 "awkgram.c" /* yacc.c:1646 */ break; case 179: -#line 1776 "awkgram.y" /* yacc.c:1646 */ +#line 1771 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; } -#line 3881 "awkgram.c" /* yacc.c:1646 */ +#line 3876 "awkgram.c" /* yacc.c:1646 */ break; case 180: -#line 1779 "awkgram.y" /* yacc.c:1646 */ +#line 1774 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3887 "awkgram.c" /* yacc.c:1646 */ +#line 3882 "awkgram.c" /* yacc.c:1646 */ break; case 182: -#line 1787 "awkgram.y" /* yacc.c:1646 */ +#line 1782 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3893 "awkgram.c" /* yacc.c:1646 */ +#line 3888 "awkgram.c" /* yacc.c:1646 */ break; case 183: -#line 1791 "awkgram.y" /* yacc.c:1646 */ +#line 1786 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3899 "awkgram.c" /* yacc.c:1646 */ +#line 3894 "awkgram.c" /* yacc.c:1646 */ break; case 186: -#line 1800 "awkgram.y" /* yacc.c:1646 */ +#line 1795 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3905 "awkgram.c" /* yacc.c:1646 */ +#line 3900 "awkgram.c" /* yacc.c:1646 */ break; case 187: -#line 1804 "awkgram.y" /* yacc.c:1646 */ +#line 1799 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); yyerrok; } -#line 3911 "awkgram.c" /* yacc.c:1646 */ +#line 3906 "awkgram.c" /* yacc.c:1646 */ break; case 188: -#line 1808 "awkgram.y" /* yacc.c:1646 */ +#line 1803 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3917 "awkgram.c" /* yacc.c:1646 */ +#line 3912 "awkgram.c" /* yacc.c:1646 */ break; -#line 3921 "awkgram.c" /* yacc.c:1646 */ +#line 3916 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4145,7 +4140,7 @@ yyreturn: #endif return yyresult; } -#line 1810 "awkgram.y" /* yacc.c:1906 */ +#line 1805 "awkgram.y" /* yacc.c:1906 */ struct token { -- cgit v1.2.3 From 1cc790ecafc378da1dbbda8480a2a41f13c1821e Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Sun, 7 Sep 2014 18:11:43 +0930 Subject: adding awkgram.c --- awkgram.c | 2856 ++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 1580 insertions(+), 1276 deletions(-) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index ae6afcdb..9704e1c7 100644 --- a/awkgram.c +++ b/awkgram.c @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 2.7. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.2" +#define YYBISON_VERSION "2.7" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -62,7 +62,8 @@ /* Copy the first part of user declarations. */ -#line 26 "awkgram.y" /* yacc.c:339 */ +/* Line 371 of yacc.c */ +#line 26 "awkgram.y" #ifdef GAWKDEBUG #define YYDEBUG 12 @@ -127,6 +128,7 @@ static void check_funcs(void); static ssize_t read_one_line(int fd, void *buffer, size_t count); static int one_line_close(int fd); +void split_comment(void); static bool want_source = false; static bool want_regexp = false; /* lexical scanning kludge */ @@ -187,6 +189,10 @@ static INSTRUCTION *ip_endfile; static INSTRUCTION *ip_beginfile; static INSTRUCTION *comment = NULL; +static INSTRUCTION *comment0 = NULL; +static INSTRUCTION *commentf = NULL; + +static int func_first = 1; static inline INSTRUCTION *list_create(INSTRUCTION *x); static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x); @@ -199,13 +205,14 @@ extern double fmod(double x, double y); #define is_identchar(c) (isalnum(c) || (c) == '_') -#line 203 "awkgram.c" /* yacc.c:339 */ +/* Line 371 of yacc.c */ +#line 210 "awkgram.c" -# ifndef YY_NULLPTR +# ifndef YY_NULL # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr +# define YY_NULL nullptr # else -# define YY_NULLPTR 0 +# define YY_NULL 0 # endif # endif @@ -218,7 +225,7 @@ extern double fmod(double x, double y); #endif -/* Debug traces. */ +/* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -226,63 +233,64 @@ extern double fmod(double x, double y); extern int yydebug; #endif -/* Token type. */ +/* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - enum yytokentype - { - FUNC_CALL = 258, - NAME = 259, - REGEXP = 260, - FILENAME = 261, - YNUMBER = 262, - YSTRING = 263, - RELOP = 264, - IO_OUT = 265, - IO_IN = 266, - ASSIGNOP = 267, - ASSIGN = 268, - MATCHOP = 269, - CONCAT_OP = 270, - SUBSCRIPT = 271, - LEX_BEGIN = 272, - LEX_END = 273, - LEX_IF = 274, - LEX_ELSE = 275, - LEX_RETURN = 276, - LEX_DELETE = 277, - LEX_SWITCH = 278, - LEX_CASE = 279, - LEX_DEFAULT = 280, - LEX_WHILE = 281, - LEX_DO = 282, - LEX_FOR = 283, - LEX_BREAK = 284, - LEX_CONTINUE = 285, - LEX_PRINT = 286, - LEX_PRINTF = 287, - LEX_NEXT = 288, - LEX_EXIT = 289, - LEX_FUNCTION = 290, - LEX_BEGINFILE = 291, - LEX_ENDFILE = 292, - LEX_GETLINE = 293, - LEX_NEXTFILE = 294, - LEX_IN = 295, - LEX_AND = 296, - LEX_OR = 297, - INCREMENT = 298, - DECREMENT = 299, - LEX_BUILTIN = 300, - LEX_LENGTH = 301, - LEX_EOF = 302, - LEX_INCLUDE = 303, - LEX_EVAL = 304, - LEX_LOAD = 305, - NEWLINE = 306, - SLASH_BEFORE_EQUAL = 307, - UNARY = 308 - }; + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + FUNC_CALL = 258, + NAME = 259, + REGEXP = 260, + FILENAME = 261, + YNUMBER = 262, + YSTRING = 263, + RELOP = 264, + IO_OUT = 265, + IO_IN = 266, + ASSIGNOP = 267, + ASSIGN = 268, + MATCHOP = 269, + CONCAT_OP = 270, + SUBSCRIPT = 271, + LEX_BEGIN = 272, + LEX_END = 273, + LEX_IF = 274, + LEX_ELSE = 275, + LEX_RETURN = 276, + LEX_DELETE = 277, + LEX_SWITCH = 278, + LEX_CASE = 279, + LEX_DEFAULT = 280, + LEX_WHILE = 281, + LEX_DO = 282, + LEX_FOR = 283, + LEX_BREAK = 284, + LEX_CONTINUE = 285, + LEX_PRINT = 286, + LEX_PRINTF = 287, + LEX_NEXT = 288, + LEX_EXIT = 289, + LEX_FUNCTION = 290, + LEX_BEGINFILE = 291, + LEX_ENDFILE = 292, + LEX_GETLINE = 293, + LEX_NEXTFILE = 294, + LEX_IN = 295, + LEX_AND = 296, + LEX_OR = 297, + INCREMENT = 298, + DECREMENT = 299, + LEX_BUILTIN = 300, + LEX_LENGTH = 301, + LEX_EOF = 302, + LEX_INCLUDE = 303, + LEX_EVAL = 304, + LEX_LOAD = 305, + NEWLINE = 306, + SLASH_BEFORE_EQUAL = 307, + UNARY = 308 + }; #endif /* Tokens. */ #define FUNC_CALL 258 @@ -337,23 +345,37 @@ extern int yydebug; #define SLASH_BEFORE_EQUAL 307 #define UNARY 308 -/* Value type. */ + + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif - extern YYSTYPE yylval; +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ /* Copy the second part of user declarations. */ -#line 357 "awkgram.c" /* yacc.c:358 */ +/* Line 390 of yacc.c */ +#line 379 "awkgram.c" #ifdef short # undef short @@ -367,8 +389,11 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#else +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; +#else +typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -388,7 +413,8 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -410,33 +436,6 @@ typedef short int yytype_int16; # endif #endif -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) -# endif -#endif - /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -444,26 +443,24 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(N) (N) #else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; #endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ +{ + return yyi; +} #endif - #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -481,7 +478,8 @@ typedef short int yytype_int16; # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -493,8 +491,8 @@ typedef short int yytype_int16; # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -510,7 +508,7 @@ typedef short int yytype_int16; # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -518,13 +516,15 @@ typedef short int yytype_int16; # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -534,7 +534,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -559,16 +559,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) #endif @@ -587,7 +587,7 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (0) + while (YYID (0)) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -603,19 +603,17 @@ union yyalloc #define YYNNTS 65 /* YYNRULES -- Number of rules. */ #define YYNRULES 188 -/* YYNSTATES -- Number of states. */ +/* YYNRULES -- Number of states. */ #define YYNSTATES 335 -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 308 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -652,28 +650,117 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 4, 7, 10, 13, 16, 19, 22, + 25, 30, 35, 37, 40, 42, 44, 47, 49, 50, + 52, 57, 59, 61, 63, 65, 71, 73, 75, 77, + 80, 82, 84, 91, 92, 96, 98, 100, 101, 104, + 107, 109, 112, 115, 119, 121, 131, 138, 147, 156, + 169, 181, 183, 186, 189, 192, 195, 199, 200, 205, + 208, 209, 214, 215, 220, 225, 227, 228, 230, 231, + 234, 237, 243, 248, 250, 253, 256, 258, 260, 262, + 264, 266, 270, 271, 272, 276, 283, 293, 295, 298, + 299, 301, 302, 305, 306, 308, 310, 314, 316, 319, + 323, 324, 326, 327, 329, 331, 335, 337, 340, 344, + 348, 352, 356, 360, 364, 368, 372, 378, 380, 382, + 384, 387, 389, 391, 393, 395, 397, 399, 402, 404, + 408, 412, 416, 420, 424, 428, 432, 435, 438, 444, + 449, 453, 457, 461, 465, 469, 473, 475, 478, 482, + 487, 492, 494, 496, 498, 501, 504, 506, 508, 511, + 514, 516, 519, 524, 525, 527, 528, 531, 533, 536, + 538, 542, 544, 547, 550, 552, 555, 557, 561, 563, + 565, 566, 569, 572, 574, 575, 577, 579, 581 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 76, 0, -1, -1, 76, 77, -1, 76, 105, -1, + 76, 47, -1, 76, 1, -1, 80, 81, -1, 80, + 89, -1, 84, 81, -1, 69, 48, 78, 89, -1, + 69, 50, 79, 89, -1, 6, -1, 6, 1, -1, + 1, -1, 6, -1, 6, 1, -1, 1, -1, -1, + 113, -1, 113, 55, 106, 113, -1, 17, -1, 18, + -1, 36, -1, 37, -1, 133, 88, 134, 136, 106, + -1, 4, -1, 3, -1, 83, -1, 69, 49, -1, + 45, -1, 46, -1, 35, 82, 67, 108, 135, 106, + -1, -1, 87, 86, 5, -1, 61, -1, 52, -1, + -1, 88, 90, -1, 88, 1, -1, 105, -1, 137, + 106, -1, 137, 106, -1, 133, 88, 134, -1, 104, + -1, 23, 67, 113, 135, 106, 133, 97, 106, 134, + -1, 26, 67, 113, 135, 106, 90, -1, 27, 106, + 90, 26, 67, 113, 135, 106, -1, 28, 67, 4, + 40, 130, 135, 106, 90, -1, 28, 67, 96, 137, + 106, 113, 137, 106, 96, 135, 106, 90, -1, 28, + 67, 96, 137, 106, 137, 106, 96, 135, 106, 90, + -1, 91, -1, 29, 89, -1, 30, 89, -1, 33, + 89, -1, 39, 89, -1, 34, 110, 89, -1, -1, + 21, 92, 110, 89, -1, 93, 89, -1, -1, 100, + 94, 101, 102, -1, -1, 22, 4, 95, 124, -1, + 22, 67, 4, 68, -1, 113, -1, -1, 93, -1, + -1, 97, 98, -1, 97, 1, -1, 24, 99, 138, + 106, 88, -1, 25, 138, 106, 88, -1, 7, -1, + 59, 7, -1, 58, 7, -1, 8, -1, 85, -1, + 31, -1, 32, -1, 111, -1, 67, 112, 135, -1, + -1, -1, 10, 103, 117, -1, 19, 67, 113, 135, + 106, 90, -1, 19, 67, 113, 135, 106, 90, 20, + 106, 90, -1, 51, -1, 105, 51, -1, -1, 105, + -1, -1, 56, 118, -1, -1, 109, -1, 4, -1, + 109, 139, 4, -1, 1, -1, 109, 1, -1, 109, + 139, 1, -1, -1, 113, -1, -1, 112, -1, 113, + -1, 112, 139, 113, -1, 1, -1, 112, 1, -1, + 112, 1, 113, -1, 112, 139, 1, -1, 131, 114, + 113, -1, 113, 41, 113, -1, 113, 42, 113, -1, + 113, 14, 113, -1, 113, 40, 130, -1, 113, 116, + 113, -1, 113, 53, 113, 54, 113, -1, 117, -1, + 13, -1, 12, -1, 52, 13, -1, 9, -1, 56, + -1, 115, -1, 57, -1, 118, -1, 119, -1, 117, + 118, -1, 120, -1, 118, 65, 118, -1, 118, 60, + 118, -1, 118, 61, 118, -1, 118, 62, 118, -1, + 118, 58, 118, -1, 118, 59, 118, -1, 38, 123, + 107, -1, 131, 43, -1, 131, 44, -1, 67, 112, + 135, 40, 130, -1, 117, 11, 38, 123, -1, 119, + 65, 118, -1, 119, 60, 118, -1, 119, 61, 118, + -1, 119, 62, 118, -1, 119, 58, 118, -1, 119, + 59, 118, -1, 85, -1, 63, 118, -1, 67, 113, + 135, -1, 45, 67, 111, 135, -1, 46, 67, 111, + 135, -1, 46, -1, 121, -1, 131, -1, 43, 131, + -1, 44, 131, -1, 7, -1, 8, -1, 59, 118, + -1, 58, 118, -1, 122, -1, 69, 122, -1, 3, + 67, 111, 135, -1, -1, 131, -1, -1, 125, 16, + -1, 126, -1, 125, 126, -1, 127, -1, 70, 112, + 71, -1, 127, -1, 128, 127, -1, 128, 16, -1, + 4, -1, 4, 129, -1, 130, -1, 66, 120, 132, + -1, 43, -1, 44, -1, -1, 72, 106, -1, 73, + 106, -1, 68, -1, -1, 137, -1, 74, -1, 54, + -1, 55, 106, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 202, 202, 204, 209, 210, 216, 228, 232, 243, - 249, 254, 262, 270, 272, 277, 285, 287, 293, 294, - 296, 322, 333, 344, 350, 359, 369, 371, 373, 379, - 384, 385, 389, 408, 407, 441, 443, 448, 449, 472, - 477, 478, 482, 484, 486, 493, 583, 625, 667, 780, - 787, 794, 804, 813, 822, 831, 842, 858, 857, 881, - 893, 893, 991, 991, 1024, 1054, 1060, 1061, 1067, 1068, - 1075, 1080, 1092, 1106, 1108, 1116, 1121, 1123, 1131, 1133, - 1142, 1143, 1151, 1156, 1156, 1167, 1171, 1179, 1180, 1183, - 1185, 1190, 1191, 1200, 1201, 1206, 1211, 1217, 1219, 1221, - 1228, 1229, 1235, 1236, 1241, 1243, 1248, 1250, 1258, 1263, - 1272, 1279, 1281, 1283, 1299, 1309, 1316, 1318, 1323, 1325, - 1327, 1335, 1337, 1342, 1344, 1349, 1351, 1353, 1403, 1405, - 1407, 1409, 1411, 1413, 1415, 1417, 1431, 1436, 1441, 1466, - 1472, 1474, 1476, 1478, 1480, 1482, 1487, 1491, 1523, 1525, - 1531, 1537, 1550, 1551, 1552, 1557, 1562, 1566, 1570, 1585, - 1598, 1603, 1639, 1657, 1658, 1664, 1665, 1670, 1672, 1679, - 1696, 1713, 1715, 1722, 1727, 1735, 1745, 1757, 1766, 1770, - 1774, 1778, 1782, 1786, 1789, 1791, 1795, 1799, 1803 + 0, 207, 207, 209, 214, 215, 221, 233, 237, 248, + 254, 259, 267, 275, 277, 282, 290, 292, 298, 305, + 314, 340, 353, 365, 372, 382, 394, 396, 398, 404, + 409, 410, 414, 443, 442, 476, 478, 483, 489, 517, + 522, 523, 527, 529, 531, 538, 628, 670, 712, 825, + 832, 839, 849, 858, 867, 876, 887, 903, 902, 926, + 938, 938, 1036, 1036, 1069, 1099, 1105, 1106, 1112, 1113, + 1120, 1125, 1137, 1151, 1153, 1161, 1166, 1168, 1176, 1178, + 1187, 1188, 1196, 1201, 1201, 1212, 1216, 1224, 1225, 1228, + 1230, 1235, 1236, 1245, 1246, 1251, 1256, 1262, 1264, 1266, + 1273, 1274, 1280, 1281, 1286, 1288, 1293, 1295, 1303, 1308, + 1317, 1324, 1326, 1328, 1344, 1354, 1361, 1363, 1368, 1370, + 1372, 1380, 1382, 1387, 1389, 1394, 1396, 1398, 1448, 1450, + 1452, 1454, 1456, 1458, 1460, 1462, 1476, 1481, 1486, 1511, + 1517, 1519, 1521, 1523, 1525, 1527, 1532, 1536, 1568, 1570, + 1576, 1582, 1595, 1596, 1597, 1602, 1607, 1611, 1615, 1630, + 1643, 1648, 1684, 1702, 1703, 1709, 1710, 1715, 1717, 1724, + 1741, 1758, 1760, 1767, 1772, 1780, 1790, 1802, 1811, 1815, + 1819, 1823, 1827, 1831, 1834, 1836, 1840, 1844, 1848 }; #endif @@ -706,13 +793,13 @@ static const char *const yytname[] = "func_call", "direct_func_call", "opt_variable", "delete_subscript_list", "delete_subscript", "delete_exp_list", "bracketed_exp_list", "subscript", "subscript_list", "simple_variable", "variable", "opt_incdec", "l_brace", - "r_brace", "r_paren", "opt_semi", "semi", "colon", "comma", YY_NULLPTR + "r_brace", "r_paren", "opt_semi", "semi", "colon", "comma", YY_NULL }; #endif # ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -726,59 +813,57 @@ static const yytype_uint16 yytoknum[] = }; # endif -#define YYPACT_NINF -273 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-273))) - -#define YYTABLE_NINF -104 - -#define yytable_value_is_error(Yytable_value) \ - (!!((Yytable_value) == (-104))) +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 75, 76, 76, 76, 76, 76, 77, 77, 77, + 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, + 80, 80, 80, 80, 80, 81, 82, 82, 82, 82, + 83, 83, 84, 86, 85, 87, 87, 88, 88, 88, + 89, 89, 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 91, 91, 91, 91, 91, 92, 91, 91, + 94, 93, 95, 93, 93, 93, 96, 96, 97, 97, + 97, 98, 98, 99, 99, 99, 99, 99, 100, 100, + 101, 101, 102, 103, 102, 104, 104, 105, 105, 106, + 106, 107, 107, 108, 108, 109, 109, 109, 109, 109, + 110, 110, 111, 111, 112, 112, 112, 112, 112, 112, + 113, 113, 113, 113, 113, 113, 113, 113, 114, 114, + 114, 115, 115, 116, 116, 117, 117, 117, 118, 118, + 118, 118, 118, 118, 118, 118, 118, 118, 118, 119, + 119, 119, 119, 119, 119, 119, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 121, 121, 122, 123, 123, 124, 124, 125, 125, 126, + 127, 128, 128, 129, 130, 130, 131, 131, 132, 132, + 132, 133, 134, 135, 136, 136, 137, 138, 139 +}; - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = { - -273, 376, -273, -273, -27, -21, -273, -273, -273, -273, - 157, -273, -273, 11, 11, 11, -5, -3, -273, -273, - -273, 1019, 1019, -273, 1019, 1065, 821, 116, -273, -20, - 1, -273, -273, 35, 758, 992, 252, 296, -273, -273, - -273, -273, 233, 789, 821, -273, 2, -273, -273, -273, - -273, -273, 63, 54, -273, 69, -273, -273, -273, 789, - 789, 127, 87, 115, 87, 87, 1019, 131, -273, -273, - 55, 295, 40, 47, -273, 83, -273, -273, -273, 35, - -273, 83, -273, 151, -273, -273, 1019, 132, 1019, 1019, - 1019, 83, -273, -273, -273, 1019, 124, 252, 1019, 1019, - 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, - -273, -273, -273, -273, 152, 1019, 100, 16, 1034, 37, - -273, -273, -273, 43, 1019, -273, 100, 100, 295, -273, - -273, -273, 1019, 83, -273, 137, 867, -273, -273, 75, - -19, -273, 77, -19, 35, -273, 596, -273, -273, 123, - -273, 141, 175, 1098, 1019, 161, 11, -26, -26, 87, - 87, 87, 87, -26, -26, 87, 87, 87, 87, -273, - 1034, -273, -273, -273, -273, 100, 65, 252, -273, -273, - 1034, -273, 132, -273, 1034, -273, -273, -273, -273, -273, - 104, -273, 26, 118, 119, 83, 121, -19, -19, -273, - -273, -19, 1019, -19, 83, -273, -273, -19, -273, -273, - 1034, -273, 117, 83, 1019, 1034, -273, 83, -273, 112, - -273, 1019, 1019, -273, 188, 1019, 1019, 710, 900, -273, - -273, -273, -19, 1034, -273, -273, -273, 642, 596, 83, - -273, -273, 1034, -273, -273, -273, 295, -19, -21, 126, - 295, 295, 169, -13, -273, 117, -273, 821, 186, -273, - -273, -273, 83, -273, -273, 13, -273, -273, -273, 83, - 83, 139, 132, 83, 55, -273, -273, 710, -273, -273, - 1, 710, 1019, 100, 743, 137, 1019, 192, -273, -273, - 295, 83, 286, 83, 992, 83, 44, 83, 710, 83, - 946, 710, -273, 247, 154, -273, 156, -273, -273, 946, - 100, -273, -273, -273, 226, 228, -273, 154, -273, 83, - -273, 100, 83, -273, -273, 83, -273, 83, 710, -273, - 448, 710, -273, 522, -273 + 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, + 4, 4, 1, 2, 1, 1, 2, 1, 0, 1, + 4, 1, 1, 1, 1, 5, 1, 1, 1, 2, + 1, 1, 6, 0, 3, 1, 1, 0, 2, 2, + 1, 2, 2, 3, 1, 9, 6, 8, 8, 12, + 11, 1, 2, 2, 2, 2, 3, 0, 4, 2, + 0, 4, 0, 4, 4, 1, 0, 1, 0, 2, + 2, 5, 4, 1, 2, 2, 1, 1, 1, 1, + 1, 3, 0, 0, 3, 6, 9, 1, 2, 0, + 1, 0, 2, 0, 1, 1, 3, 1, 2, 3, + 0, 1, 0, 1, 1, 3, 1, 2, 3, 3, + 3, 3, 3, 3, 3, 3, 5, 1, 1, 1, + 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, + 3, 3, 3, 3, 3, 3, 2, 2, 5, 4, + 3, 3, 3, 3, 3, 3, 1, 2, 3, 4, + 4, 1, 1, 1, 2, 2, 1, 1, 2, 2, + 1, 2, 4, 0, 1, 0, 2, 1, 2, 1, + 3, 1, 2, 2, 1, 2, 1, 3, 1, 1, + 0, 2, 2, 1, 0, 1, 1, 1, 2 }; - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ static const yytype_uint8 yydefact[] = { 2, 0, 1, 6, 0, 174, 156, 157, 21, 22, @@ -817,19 +902,7 @@ static const yytype_uint8 yydefact[] = 0, 0, 50, 0, 49 }; - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -273, -273, -273, -273, -273, -273, 208, -273, -273, -273, - -64, -273, -273, -202, 71, -58, -273, -273, -218, -273, - -273, -272, -273, -273, -273, -273, -273, -273, -273, -273, - 50, 76, -273, -273, -273, 19, -54, -23, -1, -273, - -273, -273, -44, 39, -273, 224, -273, -11, 94, -273, - -273, -7, -38, -273, -273, -73, -2, -273, -28, -231, - -46, -273, -25, -57, 85 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ +/* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 1, 28, 140, 143, 29, 77, 53, 54, 30, @@ -841,9 +914,63 @@ static const yytype_int16 yydefgoto[] = 137, 239, 213, 319, 136 }; - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -273 +static const yytype_int16 yypact[] = +{ + -273, 376, -273, -273, -27, -21, -273, -273, -273, -273, + 157, -273, -273, 11, 11, 11, -5, -3, -273, -273, + -273, 1019, 1019, -273, 1019, 1065, 821, 116, -273, -20, + 1, -273, -273, 35, 758, 992, 252, 296, -273, -273, + -273, -273, 233, 789, 821, -273, 2, -273, -273, -273, + -273, -273, 63, 54, -273, 69, -273, -273, -273, 789, + 789, 127, 87, 115, 87, 87, 1019, 131, -273, -273, + 55, 295, 40, 47, -273, 83, -273, -273, -273, 35, + -273, 83, -273, 151, -273, -273, 1019, 132, 1019, 1019, + 1019, 83, -273, -273, -273, 1019, 124, 252, 1019, 1019, + 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, + -273, -273, -273, -273, 152, 1019, 100, 16, 1034, 37, + -273, -273, -273, 43, 1019, -273, 100, 100, 295, -273, + -273, -273, 1019, 83, -273, 137, 867, -273, -273, 75, + -19, -273, 77, -19, 35, -273, 596, -273, -273, 123, + -273, 141, 175, 1098, 1019, 161, 11, -26, -26, 87, + 87, 87, 87, -26, -26, 87, 87, 87, 87, -273, + 1034, -273, -273, -273, -273, 100, 65, 252, -273, -273, + 1034, -273, 132, -273, 1034, -273, -273, -273, -273, -273, + 104, -273, 26, 118, 119, 83, 121, -19, -19, -273, + -273, -19, 1019, -19, 83, -273, -273, -19, -273, -273, + 1034, -273, 117, 83, 1019, 1034, -273, 83, -273, 112, + -273, 1019, 1019, -273, 188, 1019, 1019, 710, 900, -273, + -273, -273, -19, 1034, -273, -273, -273, 642, 596, 83, + -273, -273, 1034, -273, -273, -273, 295, -19, -21, 126, + 295, 295, 169, -13, -273, 117, -273, 821, 186, -273, + -273, -273, 83, -273, -273, 13, -273, -273, -273, 83, + 83, 139, 132, 83, 55, -273, -273, 710, -273, -273, + 1, 710, 1019, 100, 743, 137, 1019, 192, -273, -273, + 295, 83, 286, 83, 992, 83, 44, 83, 710, 83, + 946, 710, -273, 247, 154, -273, 156, -273, -273, 946, + 100, -273, -273, -273, 226, 228, -273, 154, -273, 83, + -273, 100, 83, -273, -273, 83, -273, 83, 710, -273, + 448, 710, -273, 522, -273 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -273, -273, -273, -273, -273, -273, 208, -273, -273, -273, + -64, -273, -273, -202, 71, -58, -273, -273, -218, -273, + -273, -272, -273, -273, -273, -273, -273, -273, -273, -273, + 50, 76, -273, -273, -273, 19, -54, -23, -1, -273, + -273, -273, -44, 39, -273, 224, -273, -11, 94, -273, + -273, -7, -38, -273, -273, -73, -2, -273, -28, -231, + -46, -273, -25, -57, 85 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -104 static const yytype_int16 yytable[] = { 34, 80, 80, 70, 81, 126, 127, 260, 121, 238, @@ -964,6 +1091,12 @@ static const yytype_int16 yytable[] = 0, 90, 214, 0, 92, 93 }; +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-273))) + +#define yytable_value_is_error(Yytable_value) \ + (!!((Yytable_value) == (-104))) + static const yytype_int16 yycheck[] = { 1, 29, 30, 26, 29, 59, 60, 238, 46, 211, @@ -1084,8 +1217,8 @@ static const yytype_int16 yycheck[] = -1, 53, 54, -1, 56, 57 }; - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 76, 0, 1, 3, 4, 7, 8, 17, 18, @@ -1124,64 +1257,30 @@ static const yytype_uint8 yystos[] = 88, 106, 90, 88, 90 }; - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 75, 76, 76, 76, 76, 76, 77, 77, 77, - 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, - 80, 80, 80, 80, 80, 81, 82, 82, 82, 82, - 83, 83, 84, 86, 85, 87, 87, 88, 88, 88, - 89, 89, 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 91, 91, 91, 91, 91, 92, 91, 91, - 94, 93, 95, 93, 93, 93, 96, 96, 97, 97, - 97, 98, 98, 99, 99, 99, 99, 99, 100, 100, - 101, 101, 102, 103, 102, 104, 104, 105, 105, 106, - 106, 107, 107, 108, 108, 109, 109, 109, 109, 109, - 110, 110, 111, 111, 112, 112, 112, 112, 112, 112, - 113, 113, 113, 113, 113, 113, 113, 113, 114, 114, - 114, 115, 115, 116, 116, 117, 117, 117, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 119, - 119, 119, 119, 119, 119, 119, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 121, 121, 122, 123, 123, 124, 124, 125, 125, 126, - 127, 128, 128, 129, 130, 130, 131, 131, 132, 132, - 132, 133, 134, 135, 136, 136, 137, 138, 139 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, - 4, 4, 1, 2, 1, 1, 2, 1, 0, 1, - 4, 1, 1, 1, 1, 5, 1, 1, 1, 2, - 1, 1, 6, 0, 3, 1, 1, 0, 2, 2, - 1, 2, 2, 3, 1, 9, 6, 8, 8, 12, - 11, 1, 2, 2, 2, 2, 3, 0, 4, 2, - 0, 4, 0, 4, 4, 1, 0, 1, 0, 2, - 2, 5, 4, 1, 2, 2, 1, 1, 1, 1, - 1, 3, 0, 0, 3, 6, 9, 1, 2, 0, - 1, 0, 2, 0, 1, 1, 3, 1, 2, 3, - 0, 1, 0, 1, 1, 3, 1, 2, 3, 3, - 3, 3, 3, 3, 3, 3, 5, 1, 1, 1, - 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, - 3, 3, 3, 3, 3, 3, 2, 2, 5, 4, - 3, 3, 3, 3, 3, 3, 1, 2, 3, 4, - 4, 1, 1, 1, 2, 2, 1, 1, 2, 2, - 1, 2, 4, 0, 1, 0, 2, 1, 2, 1, - 3, 1, 2, 2, 1, 2, 1, 3, 1, 1, - 0, 2, 2, 1, 0, 1, 1, 1, 2 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. However, + YYFAIL appears to be in use. Nevertheless, it is formally deprecated + in Bison 2.4.2's NEWS entry, where a plan to phase it out is + discussed. */ + +#define YYFAIL goto yyerrlab +#if defined YYFAIL + /* This is here to suppress warnings from the GCC cpp's + -Wunused-macros. Normally we don't worry about that warning, but + some users do, and we want to make it easy for users to remove + YYFAIL uses, which will produce warnings from Bison 2.5. */ +#endif #define YYRECOVERING() (!!yyerrstatus) @@ -1198,15 +1297,27 @@ do \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) + YYERROR; \ + } \ +while (YYID (0)) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -1216,36 +1327,40 @@ while (0) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ - +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif { FILE *yyo = yyoutput; YYUSE (yyo); @@ -1254,8 +1369,14 @@ yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvalue # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); # endif - YYUSE (yytype); + switch (yytype) + { + default: + break; + } } @@ -1263,11 +1384,22 @@ yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvalue | Print this symbol on YYOUTPUT. | `--------------------------------*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif { - YYFPRINTF (yyoutput, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); @@ -1278,8 +1410,16 @@ yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | TOP (included). | `------------------------------------------------------------------*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +#else +static void +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; +#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1290,42 +1430,49 @@ yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif { - unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; + unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule); \ -} while (0) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1339,7 +1486,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1362,8 +1509,15 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1379,8 +1533,16 @@ yystrlen (const char *yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1410,27 +1572,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1453,11 +1615,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; + const char *yyformat = YY_NULL; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1465,6 +1627,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + + for details. YYERROR is fine as it does not invoke this + function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1514,7 +1680,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; @@ -1581,17 +1747,31 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif { YYUSE (yyvaluep); + if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END + switch (yytype) + { + + default: + break; + } } @@ -1600,8 +1780,18 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) /* The lookahead symbol. */ int yychar; + +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; +YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); + /* Number of syntax errors so far. */ int yynerrs; @@ -1610,16 +1800,35 @@ int yynerrs; | yyparse. | `----------*/ +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) int yyparse (void) +#else +int +yyparse () + +#endif +#endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. + `yyss': related to states. + `yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -1687,23 +1896,23 @@ yyparse (void) #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1711,22 +1920,22 @@ yyparse (void) # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1735,10 +1944,10 @@ yyparse (void) yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1767,7 +1976,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (); + yychar = YYLEX; } if (yychar <= YYEOF) @@ -1832,7 +2041,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. + `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1846,26 +2055,27 @@ yyreduce: switch (yyn) { case 3: -#line 205 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 210 "awkgram.y" { rule = 0; yyerrok; } -#line 1855 "awkgram.c" /* yacc.c:1646 */ break; case 5: -#line 211 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 216 "awkgram.y" { next_sourcefile(); if (sourcefile == srcfiles) process_deferred(); } -#line 1865 "awkgram.c" /* yacc.c:1646 */ break; case 6: -#line 217 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 222 "awkgram.y" { rule = 0; /* @@ -1874,277 +2084,306 @@ yyreduce: */ /* yyerrok; */ } -#line 1878 "awkgram.c" /* yacc.c:1646 */ break; case 7: -#line 229 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 234 "awkgram.y" { - (void) append_rule((yyvsp[-1]), (yyvsp[0])); + (void) append_rule((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); } -#line 1886 "awkgram.c" /* yacc.c:1646 */ break; case 8: -#line 233 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 238 "awkgram.y" { if (rule != Rule) { msg(_("%s blocks must have an action part"), ruletab[rule]); errcount++; - } else if ((yyvsp[-1]) == NULL) { + } else if ((yyvsp[(1) - (2)]) == NULL) { msg(_("each rule must have a pattern or an action part")); errcount++; } else /* pattern rule with non-empty pattern */ - (void) append_rule((yyvsp[-1]), NULL); + (void) append_rule((yyvsp[(1) - (2)]), NULL); } -#line 1901 "awkgram.c" /* yacc.c:1646 */ break; case 9: -#line 244 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 249 "awkgram.y" { in_function = NULL; - (void) mk_function((yyvsp[-1]), (yyvsp[0])); + (void) mk_function((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); yyerrok; } -#line 1911 "awkgram.c" /* yacc.c:1646 */ break; case 10: -#line 250 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 255 "awkgram.y" { want_source = false; yyerrok; } -#line 1920 "awkgram.c" /* yacc.c:1646 */ break; case 11: -#line 255 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 260 "awkgram.y" { want_source = false; yyerrok; } -#line 1929 "awkgram.c" /* yacc.c:1646 */ break; case 12: -#line 263 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 268 "awkgram.y" { - if (include_source((yyvsp[0])) < 0) + if (include_source((yyvsp[(1) - (1)])) < 0) YYABORT; - efree((yyvsp[0])->lextok); - bcfree((yyvsp[0])); + efree((yyvsp[(1) - (1)])->lextok); + bcfree((yyvsp[(1) - (1)])); (yyval) = NULL; } -#line 1941 "awkgram.c" /* yacc.c:1646 */ break; case 13: -#line 271 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 276 "awkgram.y" { (yyval) = NULL; } -#line 1947 "awkgram.c" /* yacc.c:1646 */ break; case 14: -#line 273 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 278 "awkgram.y" { (yyval) = NULL; } -#line 1953 "awkgram.c" /* yacc.c:1646 */ break; case 15: -#line 278 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 283 "awkgram.y" { - if (load_library((yyvsp[0])) < 0) + if (load_library((yyvsp[(1) - (1)])) < 0) YYABORT; - efree((yyvsp[0])->lextok); - bcfree((yyvsp[0])); + efree((yyvsp[(1) - (1)])->lextok); + bcfree((yyvsp[(1) - (1)])); (yyval) = NULL; } -#line 1965 "awkgram.c" /* yacc.c:1646 */ break; case 16: -#line 286 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 291 "awkgram.y" { (yyval) = NULL; } -#line 1971 "awkgram.c" /* yacc.c:1646 */ break; case 17: -#line 288 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 293 "awkgram.y" { (yyval) = NULL; } -#line 1977 "awkgram.c" /* yacc.c:1646 */ break; case 18: -#line 293 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = NULL; rule = Rule; } -#line 1983 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 298 "awkgram.y" + { rule = Rule; + if (comment != NULL){ + (yyval) = list_create(comment); + comment = NULL; + } else + (yyval) = NULL; + } break; case 19: -#line 295 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); rule = Rule; } -#line 1989 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 306 "awkgram.y" + { rule = Rule; + if (comment != NULL){ + (yyval) = list_prepend((yyvsp[(1) - (1)]), comment); + comment = NULL; + } else + (yyval) = (yyvsp[(1) - (1)]); + } break; case 20: -#line 297 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 315 "awkgram.y" { INSTRUCTION *tp; - add_lint((yyvsp[-3]), LINT_assign_in_cond); - add_lint((yyvsp[0]), LINT_assign_in_cond); + add_lint((yyvsp[(1) - (4)]), LINT_assign_in_cond); + add_lint((yyvsp[(4) - (4)]), LINT_assign_in_cond); tp = instruction(Op_no_op); - list_prepend((yyvsp[-3]), bcalloc(Op_line_range, !!do_pretty_print + 1, 0)); - (yyvsp[-3])->nexti->triggered = false; - (yyvsp[-3])->nexti->target_jmp = (yyvsp[0])->nexti; + list_prepend((yyvsp[(1) - (4)]), bcalloc(Op_line_range, !!do_pretty_print + 1, 0)); + (yyvsp[(1) - (4)])->nexti->triggered = false; + (yyvsp[(1) - (4)])->nexti->target_jmp = (yyvsp[(4) - (4)])->nexti; - list_append((yyvsp[-3]), instruction(Op_cond_pair)); - (yyvsp[-3])->lasti->line_range = (yyvsp[-3])->nexti; - (yyvsp[-3])->lasti->target_jmp = tp; + list_append((yyvsp[(1) - (4)]), instruction(Op_cond_pair)); + (yyvsp[(1) - (4)])->lasti->line_range = (yyvsp[(1) - (4)])->nexti; + (yyvsp[(1) - (4)])->lasti->target_jmp = tp; - list_append((yyvsp[0]), instruction(Op_cond_pair)); - (yyvsp[0])->lasti->line_range = (yyvsp[-3])->nexti; - (yyvsp[0])->lasti->target_jmp = tp; + list_append((yyvsp[(4) - (4)]), instruction(Op_cond_pair)); + (yyvsp[(4) - (4)])->lasti->line_range = (yyvsp[(1) - (4)])->nexti; + (yyvsp[(4) - (4)])->lasti->target_jmp = tp; if (do_pretty_print) { - ((yyvsp[-3])->nexti + 1)->condpair_left = (yyvsp[-3])->lasti; - ((yyvsp[-3])->nexti + 1)->condpair_right = (yyvsp[0])->lasti; + ((yyvsp[(1) - (4)])->nexti + 1)->condpair_left = (yyvsp[(1) - (4)])->lasti; + ((yyvsp[(1) - (4)])->nexti + 1)->condpair_right = (yyvsp[(4) - (4)])->lasti; } - (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); + (yyval) = list_append(list_merge((yyvsp[(1) - (4)]), (yyvsp[(4) - (4)])), tp); rule = Rule; } -#line 2019 "awkgram.c" /* yacc.c:1646 */ break; case 21: -#line 323 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 341 "awkgram.y" { static int begin_seen = 0; + func_first = 0; + INSTRUCTION *ip; if (do_lint_old && ++begin_seen == 2) - warning_ln((yyvsp[0])->source_line, + warning_ln((yyvsp[(1) - (1)])->source_line, _("old awk does not support multiple `BEGIN' or `END' rules")); - (yyvsp[0])->in_rule = rule = BEGIN; - (yyvsp[0])->source_file = source; - (yyval) = (yyvsp[0]); + (yyvsp[(1) - (1)])->in_rule = rule = BEGIN; + (yyvsp[(1) - (1)])->source_file = source; + (yyval) = (yyvsp[(1) - (1)]); } -#line 2034 "awkgram.c" /* yacc.c:1646 */ break; case 22: -#line 334 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 354 "awkgram.y" { static int end_seen = 0; + func_first = 0; if (do_lint_old && ++end_seen == 2) - warning_ln((yyvsp[0])->source_line, + warning_ln((yyvsp[(1) - (1)])->source_line, _("old awk does not support multiple `BEGIN' or `END' rules")); - (yyvsp[0])->in_rule = rule = END; - (yyvsp[0])->source_file = source; - (yyval) = (yyvsp[0]); + (yyvsp[(1) - (1)])->in_rule = rule = END; + (yyvsp[(1) - (1)])->source_file = source; + (yyval) = (yyvsp[(1) - (1)]); } -#line 2049 "awkgram.c" /* yacc.c:1646 */ break; case 23: -#line 345 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 366 "awkgram.y" { - (yyvsp[0])->in_rule = rule = BEGINFILE; - (yyvsp[0])->source_file = source; - (yyval) = (yyvsp[0]); + func_first = 0; + (yyvsp[(1) - (1)])->in_rule = rule = BEGINFILE; + (yyvsp[(1) - (1)])->source_file = source; + (yyval) = (yyvsp[(1) - (1)]); } -#line 2059 "awkgram.c" /* yacc.c:1646 */ break; case 24: -#line 351 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 373 "awkgram.y" { - (yyvsp[0])->in_rule = rule = ENDFILE; - (yyvsp[0])->source_file = source; - (yyval) = (yyvsp[0]); + func_first = 0; + (yyvsp[(1) - (1)])->in_rule = rule = ENDFILE; + (yyvsp[(1) - (1)])->source_file = source; + (yyval) = (yyvsp[(1) - (1)]); } -#line 2069 "awkgram.c" /* yacc.c:1646 */ break; case 25: -#line 360 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 383 "awkgram.y" { - if ((yyvsp[-3]) == NULL) - (yyval) = list_create(instruction(Op_no_op)); + INSTRUCTION *ip; + if ((yyvsp[(2) - (5)]) == NULL) + ip = list_create(instruction(Op_no_op)); else - (yyval) = (yyvsp[-3]); + ip = (yyvsp[(2) - (5)]); + (yyval) = ip; } -#line 2080 "awkgram.c" /* yacc.c:1646 */ break; case 26: -#line 370 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 2086 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 395 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 27: -#line 372 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 2092 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 397 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 28: -#line 374 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 399 "awkgram.y" { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); YYABORT; } -#line 2102 "awkgram.c" /* yacc.c:1646 */ break; case 29: -#line 380 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 2108 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 405 "awkgram.y" + { (yyval) = (yyvsp[(2) - (2)]); } break; case 32: -#line 390 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 415 "awkgram.y" { - (yyvsp[-5])->source_file = source; - if (install_function((yyvsp[-4])->lextok, (yyvsp[-5]), (yyvsp[-2])) < 0) +/* treat any comments between BOF and the first function definition (with no intervening BEGIN etc block) as program comments + Special kludge: iff there are more than one such comments, treat the last as a function comment. */ + if (comment != NULL && func_first && strstr(comment->memory->stptr, "\n\n") != NULL) + split_comment(); + /* save any other pre-function comment as function comment */ + if (comment != NULL){ + commentf = comment; + comment = NULL; + } + func_first = 0; + (yyvsp[(1) - (6)])->source_file = source; + if (install_function((yyvsp[(2) - (6)])->lextok, (yyvsp[(1) - (6)]), (yyvsp[(4) - (6)])) < 0) YYABORT; - in_function = (yyvsp[-4])->lextok; - (yyvsp[-4])->lextok = NULL; - bcfree((yyvsp[-4])); + in_function = (yyvsp[(2) - (6)])->lextok; + (yyvsp[(2) - (6)])->lextok = NULL; + bcfree((yyvsp[(2) - (6)])); /* $4 already free'd in install_function */ - (yyval) = (yyvsp[-5]); + (yyval) = (yyvsp[(1) - (6)]); } -#line 2123 "awkgram.c" /* yacc.c:1646 */ break; case 33: -#line 408 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 443 "awkgram.y" { want_regexp = true; } -#line 2129 "awkgram.c" /* yacc.c:1646 */ break; case 34: -#line 410 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 445 "awkgram.y" { NODE *n, *exp; char *re; size_t len; - re = (yyvsp[0])->lextok; - (yyvsp[0])->lextok = NULL; + re = (yyvsp[(3) - (3)])->lextok; + (yyvsp[(3) - (3)])->lextok = NULL; len = strlen(re); if (do_lint) { if (len == 0) - lintwarn_ln((yyvsp[0])->source_line, + lintwarn_ln((yyvsp[(3) - (3)])->source_line, _("regexp constant `//' looks like a C++ comment, but is not")); else if (re[0] == '*' && re[len-1] == '*') /* possible C comment */ - lintwarn_ln((yyvsp[0])->source_line, + lintwarn_ln((yyvsp[(3) - (3)])->source_line, _("regexp constant `/%s/' looks like a C comment, but is not"), re); } @@ -2154,83 +2393,93 @@ yyreduce: unref(exp); YYABORT; } - (yyval) = (yyvsp[0]); + (yyval) = (yyvsp[(3) - (3)]); (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2162 "awkgram.c" /* yacc.c:1646 */ break; case 35: -#line 442 "awkgram.y" /* yacc.c:1646 */ - { bcfree((yyvsp[0])); } -#line 2168 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 477 "awkgram.y" + { bcfree((yyvsp[(1) - (1)])); } break; case 37: -#line 448 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = NULL; } -#line 2174 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 483 "awkgram.y" + { + if (comment != NULL){ + (yyval) = list_create(comment); + comment = NULL; + } else (yyval) = NULL; + } break; case 38: -#line 450 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 490 "awkgram.y" { - if ((yyvsp[0]) == NULL) { + if ((yyvsp[(2) - (2)]) == NULL) { if (comment == NULL) - (yyval) = (yyvsp[-1]); - else - (yyval) = list_prepend((yyvsp[-1]), comment); + (yyval) = (yyvsp[(1) - (2)]); + else { + (yyval) = list_append((yyvsp[(1) - (2)]), comment); + comment = NULL; + } } else { - add_lint((yyvsp[0]), LINT_no_effect); - if ((yyvsp[-1]) == NULL) { + add_lint((yyvsp[(2) - (2)]), LINT_no_effect); + if ((yyvsp[(1) - (2)]) == NULL) { if (comment == NULL) - (yyval) = (yyvsp[0]); - else - (yyval) = list_prepend((yyvsp[0]), comment); + (yyval) = (yyvsp[(2) - (2)]); + else { + (yyval) = list_append((yyvsp[(2) - (2)]), comment); + comment = NULL; + } } else { - if (comment != NULL) - list_append((yyvsp[-1]), comment); - (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); + if (comment != NULL){ + list_append((yyvsp[(2) - (2)]), comment); + comment = NULL; + } + (yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); } } - comment = NULL; yyerrok; } -#line 2201 "awkgram.c" /* yacc.c:1646 */ break; case 39: -#line 473 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 518 "awkgram.y" { (yyval) = NULL; } -#line 2207 "awkgram.c" /* yacc.c:1646 */ break; case 42: -#line 483 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 528 "awkgram.y" { (yyval) = NULL; } -#line 2213 "awkgram.c" /* yacc.c:1646 */ break; case 43: -#line 485 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[-1]); } -#line 2219 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 530 "awkgram.y" + { (yyval) = (yyvsp[(2) - (3)]); } break; case 44: -#line 487 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 532 "awkgram.y" { if (do_pretty_print) - (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); + (yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_exec_count)); else - (yyval) = (yyvsp[0]); + (yyval) = (yyvsp[(1) - (1)]); } -#line 2230 "awkgram.c" /* yacc.c:1646 */ break; case 45: -#line 494 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 539 "awkgram.y" { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2245,9 +2494,9 @@ yyreduce: dflt = instruction(Op_jmp); dflt->target_jmp = tbreak; /* if no case match and no explicit default */ - if ((yyvsp[-2]) != NULL) { - curr = (yyvsp[-2])->nexti; - bcfree((yyvsp[-2])); /* Op_list */ + if ((yyvsp[(7) - (9)]) != NULL) { + curr = (yyvsp[(7) - (9)])->nexti; + bcfree((yyvsp[(7) - (9)])); /* Op_list */ } /* else curr = NULL; */ @@ -2303,13 +2552,13 @@ yyreduce: if (case_values != NULL) efree(case_values); - ip = (yyvsp[-6]); + ip = (yyvsp[(3) - (9)]); if (do_pretty_print) { - (void) list_prepend(ip, (yyvsp[-8])); + (void) list_prepend(ip, (yyvsp[(1) - (9)])); (void) list_prepend(ip, instruction(Op_exec_count)); - (yyvsp[-8])->target_break = tbreak; - ((yyvsp[-8]) + 1)->switch_start = cexp->nexti; - ((yyvsp[-8]) + 1)->switch_end = cexp->lasti; + (yyvsp[(1) - (9)])->target_break = tbreak; + ((yyvsp[(1) - (9)]) + 1)->switch_start = cexp->nexti; + ((yyvsp[(1) - (9)]) + 1)->switch_end = cexp->lasti; }/* else $1 is NULL */ @@ -2320,11 +2569,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2324 "awkgram.c" /* yacc.c:1646 */ break; case 46: -#line 584 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 629 "awkgram.y" { /* * ----------------- @@ -2342,22 +2591,22 @@ yyreduce: INSTRUCTION *ip, *tbreak, *tcont; tbreak = instruction(Op_no_op); - add_lint((yyvsp[-3]), LINT_assign_in_cond); - tcont = (yyvsp[-3])->nexti; - ip = list_append((yyvsp[-3]), instruction(Op_jmp_false)); + add_lint((yyvsp[(3) - (6)]), LINT_assign_in_cond); + tcont = (yyvsp[(3) - (6)])->nexti; + ip = list_append((yyvsp[(3) - (6)]), instruction(Op_jmp_false)); ip->lasti->target_jmp = tbreak; if (do_pretty_print) { (void) list_append(ip, instruction(Op_exec_count)); - (yyvsp[-5])->target_break = tbreak; - (yyvsp[-5])->target_continue = tcont; - ((yyvsp[-5]) + 1)->while_body = ip->lasti; - (void) list_prepend(ip, (yyvsp[-5])); + (yyvsp[(1) - (6)])->target_break = tbreak; + (yyvsp[(1) - (6)])->target_continue = tcont; + ((yyvsp[(1) - (6)]) + 1)->while_body = ip->lasti; + (void) list_prepend(ip, (yyvsp[(1) - (6)])); }/* else $1 is NULL */ - if ((yyvsp[0]) != NULL) - (void) list_merge(ip, (yyvsp[0])); + if ((yyvsp[(6) - (6)]) != NULL) + (void) list_merge(ip, (yyvsp[(6) - (6)])); (void) list_append(ip, instruction(Op_jmp)); ip->lasti->target_jmp = tcont; (yyval) = list_append(ip, tbreak); @@ -2366,11 +2615,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2370 "awkgram.c" /* yacc.c:1646 */ break; case 47: -#line 626 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 671 "awkgram.y" { /* * ----------------- @@ -2387,12 +2636,12 @@ yyreduce: INSTRUCTION *ip, *tbreak, *tcont; tbreak = instruction(Op_no_op); - tcont = (yyvsp[-2])->nexti; - add_lint((yyvsp[-2]), LINT_assign_in_cond); - if ((yyvsp[-5]) != NULL) - ip = list_merge((yyvsp[-5]), (yyvsp[-2])); + tcont = (yyvsp[(6) - (8)])->nexti; + add_lint((yyvsp[(6) - (8)]), LINT_assign_in_cond); + if ((yyvsp[(3) - (8)]) != NULL) + ip = list_merge((yyvsp[(3) - (8)]), (yyvsp[(6) - (8)])); else - ip = list_prepend((yyvsp[-2]), instruction(Op_no_op)); + ip = list_prepend((yyvsp[(6) - (8)]), instruction(Op_no_op)); if (do_pretty_print) (void) list_prepend(ip, instruction(Op_exec_count)); (void) list_append(ip, instruction(Op_jmp_true)); @@ -2404,29 +2653,29 @@ yyreduce: fix_break_continue(ip, tbreak, tcont); if (do_pretty_print) { - (yyvsp[-7])->target_break = tbreak; - (yyvsp[-7])->target_continue = tcont; - ((yyvsp[-7]) + 1)->doloop_cond = tcont; - (yyval) = list_prepend(ip, (yyvsp[-7])); - bcfree((yyvsp[-4])); + (yyvsp[(1) - (8)])->target_break = tbreak; + (yyvsp[(1) - (8)])->target_continue = tcont; + ((yyvsp[(1) - (8)]) + 1)->doloop_cond = tcont; + (yyval) = list_prepend(ip, (yyvsp[(1) - (8)])); + bcfree((yyvsp[(4) - (8)])); } /* else $1 and $4 are NULLs */ } -#line 2416 "awkgram.c" /* yacc.c:1646 */ break; case 48: -#line 668 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 713 "awkgram.y" { INSTRUCTION *ip; - char *var_name = (yyvsp[-5])->lextok; - - if ((yyvsp[0]) != NULL - && (yyvsp[0])->lasti->opcode == Op_K_delete - && (yyvsp[0])->lasti->expr_count == 1 - && (yyvsp[0])->nexti->opcode == Op_push - && ((yyvsp[0])->nexti->memory->type != Node_var || !((yyvsp[0])->nexti->memory->var_update)) - && strcmp((yyvsp[0])->nexti->memory->vname, var_name) == 0 + char *var_name = (yyvsp[(3) - (8)])->lextok; + + if ((yyvsp[(8) - (8)]) != NULL + && (yyvsp[(8) - (8)])->lasti->opcode == Op_K_delete + && (yyvsp[(8) - (8)])->lasti->expr_count == 1 + && (yyvsp[(8) - (8)])->nexti->opcode == Op_push + && ((yyvsp[(8) - (8)])->nexti->memory->type != Node_var || !((yyvsp[(8) - (8)])->nexti->memory->var_update)) + && strcmp((yyvsp[(8) - (8)])->nexti->memory->vname, var_name) == 0 ) { /* Efficiency hack. Recognize the special case of @@ -2443,25 +2692,25 @@ yyreduce: */ NODE *arr = NULL; - ip = (yyvsp[0])->nexti->nexti; - if ((yyvsp[-3])->nexti->opcode == Op_push && (yyvsp[-3])->lasti == (yyvsp[-3])->nexti) - arr = (yyvsp[-3])->nexti->memory; + ip = (yyvsp[(8) - (8)])->nexti->nexti; + if ((yyvsp[(5) - (8)])->nexti->opcode == Op_push && (yyvsp[(5) - (8)])->lasti == (yyvsp[(5) - (8)])->nexti) + arr = (yyvsp[(5) - (8)])->nexti->memory; if (arr != NULL && ip->opcode == Op_no_op && ip->nexti->opcode == Op_push_array && strcmp(ip->nexti->memory->vname, arr->vname) == 0 - && ip->nexti->nexti == (yyvsp[0])->lasti + && ip->nexti->nexti == (yyvsp[(8) - (8)])->lasti ) { - (void) make_assignable((yyvsp[0])->nexti); - (yyvsp[0])->lasti->opcode = Op_K_delete_loop; - (yyvsp[0])->lasti->expr_count = 0; - if ((yyvsp[-7]) != NULL) - bcfree((yyvsp[-7])); + (void) make_assignable((yyvsp[(8) - (8)])->nexti); + (yyvsp[(8) - (8)])->lasti->opcode = Op_K_delete_loop; + (yyvsp[(8) - (8)])->lasti->expr_count = 0; + if ((yyvsp[(1) - (8)]) != NULL) + bcfree((yyvsp[(1) - (8)])); efree(var_name); - bcfree((yyvsp[-5])); - bcfree((yyvsp[-4])); - bcfree((yyvsp[-3])); - (yyval) = (yyvsp[0]); + bcfree((yyvsp[(3) - (8)])); + bcfree((yyvsp[(4) - (8)])); + bcfree((yyvsp[(5) - (8)])); + (yyval) = (yyvsp[(8) - (8)]); } else goto regular_loop; } else { @@ -2478,50 +2727,50 @@ yyreduce: * ib:[Op_arrayfor_final ] */ regular_loop: - ip = (yyvsp[-3]); + ip = (yyvsp[(5) - (8)]); ip->nexti->opcode = Op_push_array; tbreak = instruction(Op_arrayfor_final); - (yyvsp[-4])->opcode = Op_arrayfor_incr; - (yyvsp[-4])->array_var = variable((yyvsp[-5])->source_line, var_name, Node_var); - (yyvsp[-4])->target_jmp = tbreak; - tcont = (yyvsp[-4]); - (yyvsp[-5])->opcode = Op_arrayfor_init; - (yyvsp[-5])->target_jmp = tbreak; - (void) list_append(ip, (yyvsp[-5])); + (yyvsp[(4) - (8)])->opcode = Op_arrayfor_incr; + (yyvsp[(4) - (8)])->array_var = variable((yyvsp[(3) - (8)])->source_line, var_name, Node_var); + (yyvsp[(4) - (8)])->target_jmp = tbreak; + tcont = (yyvsp[(4) - (8)]); + (yyvsp[(3) - (8)])->opcode = Op_arrayfor_init; + (yyvsp[(3) - (8)])->target_jmp = tbreak; + (void) list_append(ip, (yyvsp[(3) - (8)])); if (do_pretty_print) { - (yyvsp[-7])->opcode = Op_K_arrayfor; - (yyvsp[-7])->target_continue = tcont; - (yyvsp[-7])->target_break = tbreak; - (void) list_append(ip, (yyvsp[-7])); + (yyvsp[(1) - (8)])->opcode = Op_K_arrayfor; + (yyvsp[(1) - (8)])->target_continue = tcont; + (yyvsp[(1) - (8)])->target_break = tbreak; + (void) list_append(ip, (yyvsp[(1) - (8)])); } /* else $1 is NULL */ /* add update_FOO instruction if necessary */ - if ((yyvsp[-4])->array_var->type == Node_var && (yyvsp[-4])->array_var->var_update) { + if ((yyvsp[(4) - (8)])->array_var->type == Node_var && (yyvsp[(4) - (8)])->array_var->var_update) { (void) list_append(ip, instruction(Op_var_update)); - ip->lasti->update_var = (yyvsp[-4])->array_var->var_update; + ip->lasti->update_var = (yyvsp[(4) - (8)])->array_var->var_update; } - (void) list_append(ip, (yyvsp[-4])); + (void) list_append(ip, (yyvsp[(4) - (8)])); /* add set_FOO instruction if necessary */ - if ((yyvsp[-4])->array_var->type == Node_var && (yyvsp[-4])->array_var->var_assign) { + if ((yyvsp[(4) - (8)])->array_var->type == Node_var && (yyvsp[(4) - (8)])->array_var->var_assign) { (void) list_append(ip, instruction(Op_var_assign)); - ip->lasti->assign_var = (yyvsp[-4])->array_var->var_assign; + ip->lasti->assign_var = (yyvsp[(4) - (8)])->array_var->var_assign; } if (do_pretty_print) { (void) list_append(ip, instruction(Op_exec_count)); - ((yyvsp[-7]) + 1)->forloop_cond = (yyvsp[-4]); - ((yyvsp[-7]) + 1)->forloop_body = ip->lasti; + ((yyvsp[(1) - (8)]) + 1)->forloop_cond = (yyvsp[(4) - (8)]); + ((yyvsp[(1) - (8)]) + 1)->forloop_body = ip->lasti; } - if ((yyvsp[0]) != NULL) - (void) list_merge(ip, (yyvsp[0])); + if ((yyvsp[(8) - (8)]) != NULL) + (void) list_merge(ip, (yyvsp[(8) - (8)])); (void) list_append(ip, instruction(Op_jmp)); - ip->lasti->target_jmp = (yyvsp[-4]); + ip->lasti->target_jmp = (yyvsp[(4) - (8)]); (yyval) = list_append(ip, tbreak); fix_break_continue(ip, tbreak, tcont); } @@ -2529,157 +2778,157 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2533 "awkgram.c" /* yacc.c:1646 */ break; case 49: -#line 781 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 826 "awkgram.y" { - (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); + (yyval) = mk_for_loop((yyvsp[(1) - (12)]), (yyvsp[(3) - (12)]), (yyvsp[(6) - (12)]), (yyvsp[(9) - (12)]), (yyvsp[(12) - (12)])); break_allowed--; continue_allowed--; } -#line 2544 "awkgram.c" /* yacc.c:1646 */ break; case 50: -#line 788 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 833 "awkgram.y" { - (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); + (yyval) = mk_for_loop((yyvsp[(1) - (11)]), (yyvsp[(3) - (11)]), (INSTRUCTION *) NULL, (yyvsp[(8) - (11)]), (yyvsp[(11) - (11)])); break_allowed--; continue_allowed--; } -#line 2555 "awkgram.c" /* yacc.c:1646 */ break; case 51: -#line 795 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 840 "awkgram.y" { if (do_pretty_print) - (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); + (yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_exec_count)); else - (yyval) = (yyvsp[0]); + (yyval) = (yyvsp[(1) - (1)]); } -#line 2566 "awkgram.c" /* yacc.c:1646 */ break; case 52: -#line 805 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 850 "awkgram.y" { if (! break_allowed) - error_ln((yyvsp[-1])->source_line, + error_ln((yyvsp[(1) - (2)])->source_line, _("`break' is not allowed outside a loop or switch")); - (yyvsp[-1])->target_jmp = NULL; - (yyval) = list_create((yyvsp[-1])); + (yyvsp[(1) - (2)])->target_jmp = NULL; + (yyval) = list_create((yyvsp[(1) - (2)])); } -#line 2579 "awkgram.c" /* yacc.c:1646 */ break; case 53: -#line 814 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 859 "awkgram.y" { if (! continue_allowed) - error_ln((yyvsp[-1])->source_line, + error_ln((yyvsp[(1) - (2)])->source_line, _("`continue' is not allowed outside a loop")); - (yyvsp[-1])->target_jmp = NULL; - (yyval) = list_create((yyvsp[-1])); + (yyvsp[(1) - (2)])->target_jmp = NULL; + (yyval) = list_create((yyvsp[(1) - (2)])); } -#line 2592 "awkgram.c" /* yacc.c:1646 */ break; case 54: -#line 823 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 868 "awkgram.y" { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) - error_ln((yyvsp[-1])->source_line, + error_ln((yyvsp[(1) - (2)])->source_line, _("`next' used in %s action"), ruletab[rule]); - (yyvsp[-1])->target_jmp = ip_rec; - (yyval) = list_create((yyvsp[-1])); + (yyvsp[(1) - (2)])->target_jmp = ip_rec; + (yyval) = list_create((yyvsp[(1) - (2)])); } -#line 2605 "awkgram.c" /* yacc.c:1646 */ break; case 55: -#line 832 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 877 "awkgram.y" { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) - error_ln((yyvsp[-1])->source_line, + error_ln((yyvsp[(1) - (2)])->source_line, _("`nextfile' used in %s action"), ruletab[rule]); - (yyvsp[-1])->target_newfile = ip_newfile; - (yyvsp[-1])->target_endfile = ip_endfile; - (yyval) = list_create((yyvsp[-1])); + (yyvsp[(1) - (2)])->target_newfile = ip_newfile; + (yyvsp[(1) - (2)])->target_endfile = ip_endfile; + (yyval) = list_create((yyvsp[(1) - (2)])); } -#line 2620 "awkgram.c" /* yacc.c:1646 */ break; case 56: -#line 843 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 888 "awkgram.y" { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. */ - (yyvsp[-2])->target_end = ip_end; /* first instruction in end_block */ - (yyvsp[-2])->target_atexit = ip_atexit; /* cleanup and go home */ + (yyvsp[(1) - (3)])->target_end = ip_end; /* first instruction in end_block */ + (yyvsp[(1) - (3)])->target_atexit = ip_atexit; /* cleanup and go home */ - if ((yyvsp[-1]) == NULL) { - (yyval) = list_create((yyvsp[-2])); + if ((yyvsp[(2) - (3)]) == NULL) { + (yyval) = list_create((yyvsp[(1) - (3)])); (void) list_prepend((yyval), instruction(Op_push_i)); (yyval)->nexti->memory = dupnode(Nnull_string); } else - (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); + (yyval) = list_append((yyvsp[(2) - (3)]), (yyvsp[(1) - (3)])); } -#line 2639 "awkgram.c" /* yacc.c:1646 */ break; case 57: -#line 858 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 903 "awkgram.y" { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2648 "awkgram.c" /* yacc.c:1646 */ break; case 58: -#line 861 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 906 "awkgram.y" { - if ((yyvsp[-1]) == NULL) { - (yyval) = list_create((yyvsp[-3])); + if ((yyvsp[(3) - (4)]) == NULL) { + (yyval) = list_create((yyvsp[(1) - (4)])); (void) list_prepend((yyval), instruction(Op_push_i)); (yyval)->nexti->memory = dupnode(Nnull_string); } else { if (do_optimize - && (yyvsp[-1])->lasti->opcode == Op_func_call - && strcmp((yyvsp[-1])->lasti->func_name, in_function) == 0 + && (yyvsp[(3) - (4)])->lasti->opcode == Op_func_call + && strcmp((yyvsp[(3) - (4)])->lasti->func_name, in_function) == 0 ) { /* Do tail recursion optimization. Tail * call without a return value is recognized * in mk_function(). */ - ((yyvsp[-1])->lasti + 1)->tail_call = true; + ((yyvsp[(3) - (4)])->lasti + 1)->tail_call = true; } - (yyval) = list_append((yyvsp[-1]), (yyvsp[-3])); + (yyval) = list_append((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)])); } } -#line 2673 "awkgram.c" /* yacc.c:1646 */ break; case 60: -#line 893 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 938 "awkgram.y" { in_print = true; in_parens = 0; } -#line 2679 "awkgram.c" /* yacc.c:1646 */ break; case 61: -#line 894 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 939 "awkgram.y" { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2687,12 +2936,12 @@ regular_loop: * which is faster for these two cases. */ - if ((yyvsp[-3])->opcode == Op_K_print && - ((yyvsp[-1]) == NULL - || ((yyvsp[-1])->lasti->opcode == Op_field_spec - && (yyvsp[-1])->nexti->nexti->nexti == (yyvsp[-1])->lasti - && (yyvsp[-1])->nexti->nexti->opcode == Op_push_i - && (yyvsp[-1])->nexti->nexti->memory->type == Node_val) + if ((yyvsp[(1) - (4)])->opcode == Op_K_print && + ((yyvsp[(3) - (4)]) == NULL + || ((yyvsp[(3) - (4)])->lasti->opcode == Op_field_spec + && (yyvsp[(3) - (4)])->nexti->nexti->nexti == (yyvsp[(3) - (4)])->lasti + && (yyvsp[(3) - (4)])->nexti->nexti->opcode == Op_push_i + && (yyvsp[(3) - (4)])->nexti->nexti->memory->type == Node_val) ) ) { static bool warned = false; @@ -2705,37 +2954,37 @@ regular_loop: * [Op_K_print_rec | NULL | redir_type | expr_count] */ - if ((yyvsp[-1]) != NULL) { - NODE *n = (yyvsp[-1])->nexti->nexti->memory; + if ((yyvsp[(3) - (4)]) != NULL) { + NODE *n = (yyvsp[(3) - (4)])->nexti->nexti->memory; if (! iszero(n)) goto regular_print; - bcfree((yyvsp[-1])->lasti); /* Op_field_spec */ + bcfree((yyvsp[(3) - (4)])->lasti); /* Op_field_spec */ unref(n); /* Node_val */ - bcfree((yyvsp[-1])->nexti->nexti); /* Op_push_i */ - bcfree((yyvsp[-1])->nexti); /* Op_list */ - bcfree((yyvsp[-1])); /* Op_list */ + bcfree((yyvsp[(3) - (4)])->nexti->nexti); /* Op_push_i */ + bcfree((yyvsp[(3) - (4)])->nexti); /* Op_list */ + bcfree((yyvsp[(3) - (4)])); /* Op_list */ } else { if (do_lint && (rule == BEGIN || rule == END) && ! warned) { warned = true; - lintwarn_ln((yyvsp[-3])->source_line, + lintwarn_ln((yyvsp[(1) - (4)])->source_line, _("plain `print' in BEGIN or END rule should probably be `print \"\"'")); } } - (yyvsp[-3])->expr_count = 0; - (yyvsp[-3])->opcode = Op_K_print_rec; - if ((yyvsp[0]) == NULL) { /* no redircetion */ - (yyvsp[-3])->redir_type = redirect_none; - (yyval) = list_create((yyvsp[-3])); + (yyvsp[(1) - (4)])->expr_count = 0; + (yyvsp[(1) - (4)])->opcode = Op_K_print_rec; + if ((yyvsp[(4) - (4)]) == NULL) { /* no redircetion */ + (yyvsp[(1) - (4)])->redir_type = redirect_none; + (yyval) = list_create((yyvsp[(1) - (4)])); } else { INSTRUCTION *ip; - ip = (yyvsp[0])->nexti; - (yyvsp[-3])->redir_type = ip->redir_type; - (yyvsp[0])->nexti = ip->nexti; + ip = (yyvsp[(4) - (4)])->nexti; + (yyvsp[(1) - (4)])->redir_type = ip->redir_type; + (yyvsp[(4) - (4)])->nexti = ip->nexti; bcfree(ip); - (yyval) = list_append((yyvsp[0]), (yyvsp[-3])); + (yyval) = list_append((yyvsp[(4) - (4)]), (yyvsp[(1) - (4)])); } } else { /* ----------------- @@ -2748,59 +2997,59 @@ regular_loop: * */ regular_print: - if ((yyvsp[0]) == NULL) { /* no redirection */ - if ((yyvsp[-1]) == NULL) { /* printf without arg */ - (yyvsp[-3])->expr_count = 0; - (yyvsp[-3])->redir_type = redirect_none; - (yyval) = list_create((yyvsp[-3])); + if ((yyvsp[(4) - (4)]) == NULL) { /* no redirection */ + if ((yyvsp[(3) - (4)]) == NULL) { /* printf without arg */ + (yyvsp[(1) - (4)])->expr_count = 0; + (yyvsp[(1) - (4)])->redir_type = redirect_none; + (yyval) = list_create((yyvsp[(1) - (4)])); } else { - INSTRUCTION *t = (yyvsp[-1]); - (yyvsp[-3])->expr_count = count_expressions(&t, false); - (yyvsp[-3])->redir_type = redirect_none; - (yyval) = list_append(t, (yyvsp[-3])); + INSTRUCTION *t = (yyvsp[(3) - (4)]); + (yyvsp[(1) - (4)])->expr_count = count_expressions(&t, false); + (yyvsp[(1) - (4)])->redir_type = redirect_none; + (yyval) = list_append(t, (yyvsp[(1) - (4)])); } } else { INSTRUCTION *ip; - ip = (yyvsp[0])->nexti; - (yyvsp[-3])->redir_type = ip->redir_type; - (yyvsp[0])->nexti = ip->nexti; + ip = (yyvsp[(4) - (4)])->nexti; + (yyvsp[(1) - (4)])->redir_type = ip->redir_type; + (yyvsp[(4) - (4)])->nexti = ip->nexti; bcfree(ip); - if ((yyvsp[-1]) == NULL) { - (yyvsp[-3])->expr_count = 0; - (yyval) = list_append((yyvsp[0]), (yyvsp[-3])); + if ((yyvsp[(3) - (4)]) == NULL) { + (yyvsp[(1) - (4)])->expr_count = 0; + (yyval) = list_append((yyvsp[(4) - (4)]), (yyvsp[(1) - (4)])); } else { - INSTRUCTION *t = (yyvsp[-1]); - (yyvsp[-3])->expr_count = count_expressions(&t, false); - (yyval) = list_append(list_merge((yyvsp[0]), t), (yyvsp[-3])); + INSTRUCTION *t = (yyvsp[(3) - (4)]); + (yyvsp[(1) - (4)])->expr_count = count_expressions(&t, false); + (yyval) = list_append(list_merge((yyvsp[(4) - (4)]), t), (yyvsp[(1) - (4)])); } } } } -#line 2780 "awkgram.c" /* yacc.c:1646 */ break; case 62: -#line 991 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1036 "awkgram.y" { sub_counter = 0; } -#line 2786 "awkgram.c" /* yacc.c:1646 */ break; case 63: -#line 992 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1037 "awkgram.y" { - char *arr = (yyvsp[-2])->lextok; + char *arr = (yyvsp[(2) - (4)])->lextok; - (yyvsp[-2])->opcode = Op_push_array; - (yyvsp[-2])->memory = variable((yyvsp[-2])->source_line, arr, Node_var_new); + (yyvsp[(2) - (4)])->opcode = Op_push_array; + (yyvsp[(2) - (4)])->memory = variable((yyvsp[(2) - (4)])->source_line, arr, Node_var_new); if (! do_posix && ! do_traditional) { - if ((yyvsp[-2])->memory == symbol_table) + if ((yyvsp[(2) - (4)])->memory == symbol_table) fatal(_("`delete' is not allowed with SYMTAB")); - else if ((yyvsp[-2])->memory == func_table) + else if ((yyvsp[(2) - (4)])->memory == func_table) fatal(_("`delete' is not allowed with FUNCTAB")); } - if ((yyvsp[0]) == NULL) { + if ((yyvsp[(4) - (4)]) == NULL) { /* * As of September 2012, POSIX has added support * for `delete array'. See: @@ -2812,525 +3061,525 @@ regular_print: * Also, since BWK awk supports it, we don't have to * check do_traditional either. */ - (yyvsp[-3])->expr_count = 0; - (yyval) = list_append(list_create((yyvsp[-2])), (yyvsp[-3])); + (yyvsp[(1) - (4)])->expr_count = 0; + (yyval) = list_append(list_create((yyvsp[(2) - (4)])), (yyvsp[(1) - (4)])); } else { - (yyvsp[-3])->expr_count = sub_counter; - (yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3])); + (yyvsp[(1) - (4)])->expr_count = sub_counter; + (yyval) = list_append(list_append((yyvsp[(4) - (4)]), (yyvsp[(2) - (4)])), (yyvsp[(1) - (4)])); } } -#line 2823 "awkgram.c" /* yacc.c:1646 */ break; case 64: -#line 1029 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1074 "awkgram.y" { static bool warned = false; - char *arr = (yyvsp[-1])->lextok; + char *arr = (yyvsp[(3) - (4)])->lextok; if (do_lint && ! warned) { warned = true; - lintwarn_ln((yyvsp[-3])->source_line, + lintwarn_ln((yyvsp[(1) - (4)])->source_line, _("`delete(array)' is a non-portable tawk extension")); } if (do_traditional) { - error_ln((yyvsp[-3])->source_line, + error_ln((yyvsp[(1) - (4)])->source_line, _("`delete(array)' is a non-portable tawk extension")); } - (yyvsp[-1])->memory = variable((yyvsp[-1])->source_line, arr, Node_var_new); - (yyvsp[-1])->opcode = Op_push_array; - (yyvsp[-3])->expr_count = 0; - (yyval) = list_append(list_create((yyvsp[-1])), (yyvsp[-3])); + (yyvsp[(3) - (4)])->memory = variable((yyvsp[(3) - (4)])->source_line, arr, Node_var_new); + (yyvsp[(3) - (4)])->opcode = Op_push_array; + (yyvsp[(1) - (4)])->expr_count = 0; + (yyval) = list_append(list_create((yyvsp[(3) - (4)])), (yyvsp[(1) - (4)])); if (! do_posix && ! do_traditional) { - if ((yyvsp[-1])->memory == symbol_table) + if ((yyvsp[(3) - (4)])->memory == symbol_table) fatal(_("`delete' is not allowed with SYMTAB")); - else if ((yyvsp[-1])->memory == func_table) + else if ((yyvsp[(3) - (4)])->memory == func_table) fatal(_("`delete' is not allowed with FUNCTAB")); } } -#line 2853 "awkgram.c" /* yacc.c:1646 */ break; case 65: -#line 1055 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = optimize_assignment((yyvsp[0])); } -#line 2859 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1100 "awkgram.y" + { (yyval) = optimize_assignment((yyvsp[(1) - (1)])); } break; case 66: -#line 1060 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1105 "awkgram.y" { (yyval) = NULL; } -#line 2865 "awkgram.c" /* yacc.c:1646 */ break; case 67: -#line 1062 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 2871 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1107 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 68: -#line 1067 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1112 "awkgram.y" { (yyval) = NULL; } -#line 2877 "awkgram.c" /* yacc.c:1646 */ break; case 69: -#line 1069 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1114 "awkgram.y" { - if ((yyvsp[-1]) == NULL) - (yyval) = list_create((yyvsp[0])); + if ((yyvsp[(1) - (2)]) == NULL) + (yyval) = list_create((yyvsp[(2) - (2)])); else - (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); + (yyval) = list_prepend((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); } -#line 2888 "awkgram.c" /* yacc.c:1646 */ break; case 70: -#line 1076 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1121 "awkgram.y" { (yyval) = NULL; } -#line 2894 "awkgram.c" /* yacc.c:1646 */ break; case 71: -#line 1081 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1126 "awkgram.y" { - INSTRUCTION *casestmt = (yyvsp[0]); - if ((yyvsp[0]) == NULL) + INSTRUCTION *casestmt = (yyvsp[(5) - (5)]); + if ((yyvsp[(5) - (5)]) == NULL) casestmt = list_create(instruction(Op_no_op)); if (do_pretty_print) (void) list_prepend(casestmt, instruction(Op_exec_count)); - (yyvsp[-4])->case_exp = (yyvsp[-3]); - (yyvsp[-4])->case_stmt = casestmt; - bcfree((yyvsp[-2])); - (yyval) = (yyvsp[-4]); + (yyvsp[(1) - (5)])->case_exp = (yyvsp[(2) - (5)]); + (yyvsp[(1) - (5)])->case_stmt = casestmt; + bcfree((yyvsp[(3) - (5)])); + (yyval) = (yyvsp[(1) - (5)]); } -#line 2910 "awkgram.c" /* yacc.c:1646 */ break; case 72: -#line 1093 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1138 "awkgram.y" { - INSTRUCTION *casestmt = (yyvsp[0]); - if ((yyvsp[0]) == NULL) + INSTRUCTION *casestmt = (yyvsp[(4) - (4)]); + if ((yyvsp[(4) - (4)]) == NULL) casestmt = list_create(instruction(Op_no_op)); if (do_pretty_print) (void) list_prepend(casestmt, instruction(Op_exec_count)); - bcfree((yyvsp[-2])); - (yyvsp[-3])->case_stmt = casestmt; - (yyval) = (yyvsp[-3]); + bcfree((yyvsp[(2) - (4)])); + (yyvsp[(1) - (4)])->case_stmt = casestmt; + (yyval) = (yyvsp[(1) - (4)]); } -#line 2925 "awkgram.c" /* yacc.c:1646 */ break; case 73: -#line 1107 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 2931 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1152 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 74: -#line 1109 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1154 "awkgram.y" { - NODE *n = (yyvsp[0])->memory; + NODE *n = (yyvsp[(2) - (2)])->memory; (void) force_number(n); negate_num(n); - bcfree((yyvsp[-1])); - (yyval) = (yyvsp[0]); + bcfree((yyvsp[(1) - (2)])); + (yyval) = (yyvsp[(2) - (2)]); } -#line 2943 "awkgram.c" /* yacc.c:1646 */ break; case 75: -#line 1117 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1162 "awkgram.y" { - bcfree((yyvsp[-1])); - (yyval) = (yyvsp[0]); + bcfree((yyvsp[(1) - (2)])); + (yyval) = (yyvsp[(2) - (2)]); } -#line 2952 "awkgram.c" /* yacc.c:1646 */ break; case 76: -#line 1122 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 2958 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1167 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 77: -#line 1124 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1169 "awkgram.y" { - (yyvsp[0])->opcode = Op_push_re; - (yyval) = (yyvsp[0]); + (yyvsp[(1) - (1)])->opcode = Op_push_re; + (yyval) = (yyvsp[(1) - (1)]); } -#line 2967 "awkgram.c" /* yacc.c:1646 */ break; case 78: -#line 1132 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 2973 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1177 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 79: -#line 1134 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 2979 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1179 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 81: -#line 1144 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1189 "awkgram.y" { - (yyval) = (yyvsp[-1]); + (yyval) = (yyvsp[(2) - (3)]); } -#line 2987 "awkgram.c" /* yacc.c:1646 */ break; case 82: -#line 1151 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1196 "awkgram.y" { in_print = false; in_parens = 0; (yyval) = NULL; } -#line 2997 "awkgram.c" /* yacc.c:1646 */ break; case 83: -#line 1156 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1201 "awkgram.y" { in_print = false; in_parens = 0; } -#line 3003 "awkgram.c" /* yacc.c:1646 */ break; case 84: -#line 1157 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1202 "awkgram.y" { - if ((yyvsp[-2])->redir_type == redirect_twoway - && (yyvsp[0])->lasti->opcode == Op_K_getline_redir - && (yyvsp[0])->lasti->redir_type == redirect_twoway) + if ((yyvsp[(1) - (3)])->redir_type == redirect_twoway + && (yyvsp[(3) - (3)])->lasti->opcode == Op_K_getline_redir + && (yyvsp[(3) - (3)])->lasti->redir_type == redirect_twoway) yyerror(_("multistage two-way pipelines don't work")); - (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); + (yyval) = list_prepend((yyvsp[(3) - (3)]), (yyvsp[(1) - (3)])); } -#line 3015 "awkgram.c" /* yacc.c:1646 */ break; case 85: -#line 1168 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1213 "awkgram.y" { - (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); + (yyval) = mk_condition((yyvsp[(3) - (6)]), (yyvsp[(1) - (6)]), (yyvsp[(6) - (6)]), NULL, NULL); } -#line 3023 "awkgram.c" /* yacc.c:1646 */ break; case 86: -#line 1173 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1218 "awkgram.y" { - (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); + (yyval) = mk_condition((yyvsp[(3) - (9)]), (yyvsp[(1) - (9)]), (yyvsp[(6) - (9)]), (yyvsp[(7) - (9)]), (yyvsp[(9) - (9)])); } -#line 3031 "awkgram.c" /* yacc.c:1646 */ break; case 91: -#line 1190 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1235 "awkgram.y" { (yyval) = NULL; } -#line 3037 "awkgram.c" /* yacc.c:1646 */ break; case 92: -#line 1192 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1237 "awkgram.y" { - bcfree((yyvsp[-1])); - (yyval) = (yyvsp[0]); + bcfree((yyvsp[(1) - (2)])); + (yyval) = (yyvsp[(2) - (2)]); } -#line 3046 "awkgram.c" /* yacc.c:1646 */ break; case 93: -#line 1200 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1245 "awkgram.y" { (yyval) = NULL; } -#line 3052 "awkgram.c" /* yacc.c:1646 */ break; case 94: -#line 1202 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]) ; } -#line 3058 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1247 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]) ; } break; case 95: -#line 1207 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1252 "awkgram.y" { - (yyvsp[0])->param_count = 0; - (yyval) = list_create((yyvsp[0])); + (yyvsp[(1) - (1)])->param_count = 0; + (yyval) = list_create((yyvsp[(1) - (1)])); } -#line 3067 "awkgram.c" /* yacc.c:1646 */ break; case 96: -#line 1212 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1257 "awkgram.y" { - (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; - (yyval) = list_append((yyvsp[-2]), (yyvsp[0])); + (yyvsp[(3) - (3)])->param_count = (yyvsp[(1) - (3)])->lasti->param_count + 1; + (yyval) = list_append((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); yyerrok; } -#line 3077 "awkgram.c" /* yacc.c:1646 */ break; case 97: -#line 1218 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1263 "awkgram.y" { (yyval) = NULL; } -#line 3083 "awkgram.c" /* yacc.c:1646 */ break; case 98: -#line 1220 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[-1]); } -#line 3089 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1265 "awkgram.y" + { (yyval) = (yyvsp[(1) - (2)]); } break; case 99: -#line 1222 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[-2]); } -#line 3095 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1267 "awkgram.y" + { (yyval) = (yyvsp[(1) - (3)]); } break; case 100: -#line 1228 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1273 "awkgram.y" { (yyval) = NULL; } -#line 3101 "awkgram.c" /* yacc.c:1646 */ break; case 101: -#line 1230 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3107 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1275 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 102: -#line 1235 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1280 "awkgram.y" { (yyval) = NULL; } -#line 3113 "awkgram.c" /* yacc.c:1646 */ break; case 103: -#line 1237 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3119 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1282 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 104: -#line 1242 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3125 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1287 "awkgram.y" + { (yyval) = mk_expression_list(NULL, (yyvsp[(1) - (1)])); } break; case 105: -#line 1244 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1289 "awkgram.y" { - (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); + (yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); yyerrok; } -#line 3134 "awkgram.c" /* yacc.c:1646 */ break; case 106: -#line 1249 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1294 "awkgram.y" { (yyval) = NULL; } -#line 3140 "awkgram.c" /* yacc.c:1646 */ break; case 107: -#line 1251 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1296 "awkgram.y" { /* * Returning the expression list instead of NULL lets * snode get a list of arguments that it can count. */ - (yyval) = (yyvsp[-1]); + (yyval) = (yyvsp[(1) - (2)]); } -#line 3152 "awkgram.c" /* yacc.c:1646 */ break; case 108: -#line 1259 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1304 "awkgram.y" { /* Ditto */ - (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); + (yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); } -#line 3161 "awkgram.c" /* yacc.c:1646 */ break; case 109: -#line 1264 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1309 "awkgram.y" { /* Ditto */ - (yyval) = (yyvsp[-2]); + (yyval) = (yyvsp[(1) - (3)]); } -#line 3170 "awkgram.c" /* yacc.c:1646 */ break; case 110: -#line 1273 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1318 "awkgram.y" { - if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec) - lintwarn_ln((yyvsp[-1])->source_line, + if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode == Op_match_rec) + lintwarn_ln((yyvsp[(2) - (3)])->source_line, _("regular expression on right of assignment")); - (yyval) = mk_assignment((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); + (yyval) = mk_assignment((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } -#line 3181 "awkgram.c" /* yacc.c:1646 */ break; case 111: -#line 1280 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3187 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1325 "awkgram.y" + { (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 112: -#line 1282 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3193 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1327 "awkgram.y" + { (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 113: -#line 1284 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1329 "awkgram.y" { - if ((yyvsp[-2])->lasti->opcode == Op_match_rec) - warning_ln((yyvsp[-1])->source_line, + if ((yyvsp[(1) - (3)])->lasti->opcode == Op_match_rec) + warning_ln((yyvsp[(2) - (3)])->source_line, _("regular expression on left of `~' or `!~' operator")); - if ((yyvsp[0])->lasti == (yyvsp[0])->nexti && (yyvsp[0])->nexti->opcode == Op_match_rec) { - (yyvsp[-1])->memory = (yyvsp[0])->nexti->memory; - bcfree((yyvsp[0])->nexti); /* Op_match_rec */ - bcfree((yyvsp[0])); /* Op_list */ - (yyval) = list_append((yyvsp[-2]), (yyvsp[-1])); + if ((yyvsp[(3) - (3)])->lasti == (yyvsp[(3) - (3)])->nexti && (yyvsp[(3) - (3)])->nexti->opcode == Op_match_rec) { + (yyvsp[(2) - (3)])->memory = (yyvsp[(3) - (3)])->nexti->memory; + bcfree((yyvsp[(3) - (3)])->nexti); /* Op_match_rec */ + bcfree((yyvsp[(3) - (3)])); /* Op_list */ + (yyval) = list_append((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)])); } else { - (yyvsp[-1])->memory = make_regnode(Node_dynregex, NULL); - (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); + (yyvsp[(2) - (3)])->memory = make_regnode(Node_dynregex, NULL); + (yyval) = list_append(list_merge((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])), (yyvsp[(2) - (3)])); } } -#line 3213 "awkgram.c" /* yacc.c:1646 */ break; case 114: -#line 1300 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1345 "awkgram.y" { if (do_lint_old) - warning_ln((yyvsp[-1])->source_line, + warning_ln((yyvsp[(2) - (3)])->source_line, _("old awk does not support the keyword `in' except after `for'")); - (yyvsp[0])->nexti->opcode = Op_push_array; - (yyvsp[-1])->opcode = Op_in_array; - (yyvsp[-1])->expr_count = 1; - (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); + (yyvsp[(3) - (3)])->nexti->opcode = Op_push_array; + (yyvsp[(2) - (3)])->opcode = Op_in_array; + (yyvsp[(2) - (3)])->expr_count = 1; + (yyval) = list_append(list_merge((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])), (yyvsp[(2) - (3)])); } -#line 3227 "awkgram.c" /* yacc.c:1646 */ break; case 115: -#line 1310 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1355 "awkgram.y" { - if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec) - lintwarn_ln((yyvsp[-1])->source_line, + if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode == Op_match_rec) + lintwarn_ln((yyvsp[(2) - (3)])->source_line, _("regular expression on right of comparison")); - (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); + (yyval) = list_append(list_merge((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])), (yyvsp[(2) - (3)])); } -#line 3238 "awkgram.c" /* yacc.c:1646 */ break; case 116: -#line 1317 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3244 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1362 "awkgram.y" + { (yyval) = mk_condition((yyvsp[(1) - (5)]), (yyvsp[(2) - (5)]), (yyvsp[(3) - (5)]), (yyvsp[(4) - (5)]), (yyvsp[(5) - (5)])); } break; case 117: -#line 1319 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3250 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1364 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 118: -#line 1324 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3256 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1369 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 119: -#line 1326 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3262 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1371 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 120: -#line 1328 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1373 "awkgram.y" { - (yyvsp[0])->opcode = Op_assign_quotient; - (yyval) = (yyvsp[0]); + (yyvsp[(2) - (2)])->opcode = Op_assign_quotient; + (yyval) = (yyvsp[(2) - (2)]); } -#line 3271 "awkgram.c" /* yacc.c:1646 */ break; case 121: -#line 1336 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3277 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1381 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 122: -#line 1338 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3283 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1383 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 123: -#line 1343 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3289 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1388 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 124: -#line 1345 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3295 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1390 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 125: -#line 1350 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3301 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1395 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 126: -#line 1352 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3307 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1397 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 127: -#line 1354 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1399 "awkgram.y" { int count = 2; bool is_simple_var = false; - if ((yyvsp[-1])->lasti->opcode == Op_concat) { + if ((yyvsp[(1) - (2)])->lasti->opcode == Op_concat) { /* multiple (> 2) adjacent strings optimization */ - is_simple_var = ((yyvsp[-1])->lasti->concat_flag & CSVAR); - count = (yyvsp[-1])->lasti->expr_count + 1; - (yyvsp[-1])->lasti->opcode = Op_no_op; + is_simple_var = ((yyvsp[(1) - (2)])->lasti->concat_flag & CSVAR); + count = (yyvsp[(1) - (2)])->lasti->expr_count + 1; + (yyvsp[(1) - (2)])->lasti->opcode = Op_no_op; } else { - is_simple_var = ((yyvsp[-1])->nexti->opcode == Op_push - && (yyvsp[-1])->lasti == (yyvsp[-1])->nexti); /* first exp. is a simple + is_simple_var = ((yyvsp[(1) - (2)])->nexti->opcode == Op_push + && (yyvsp[(1) - (2)])->lasti == (yyvsp[(1) - (2)])->nexti); /* first exp. is a simple * variable?; kludge for use * in Op_assign_concat. */ } if (do_optimize - && (yyvsp[-1])->nexti == (yyvsp[-1])->lasti && (yyvsp[-1])->nexti->opcode == Op_push_i - && (yyvsp[0])->nexti == (yyvsp[0])->lasti && (yyvsp[0])->nexti->opcode == Op_push_i + && (yyvsp[(1) - (2)])->nexti == (yyvsp[(1) - (2)])->lasti && (yyvsp[(1) - (2)])->nexti->opcode == Op_push_i + && (yyvsp[(2) - (2)])->nexti == (yyvsp[(2) - (2)])->lasti && (yyvsp[(2) - (2)])->nexti->opcode == Op_push_i ) { - NODE *n1 = (yyvsp[-1])->nexti->memory; - NODE *n2 = (yyvsp[0])->nexti->memory; + NODE *n1 = (yyvsp[(1) - (2)])->nexti->memory; + NODE *n2 = (yyvsp[(2) - (2)])->nexti->memory; size_t nlen; n1 = force_string(n1); @@ -3343,184 +3592,184 @@ regular_print: n1->flags &= ~(NUMCUR|NUMBER|NUMINT); n1->flags |= (STRING|STRCUR); unref(n2); - bcfree((yyvsp[0])->nexti); - bcfree((yyvsp[0])); - (yyval) = (yyvsp[-1]); + bcfree((yyvsp[(2) - (2)])->nexti); + bcfree((yyvsp[(2) - (2)])); + (yyval) = (yyvsp[(1) - (2)]); } else { - (yyval) = list_append(list_merge((yyvsp[-1]), (yyvsp[0])), instruction(Op_concat)); + (yyval) = list_append(list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])), instruction(Op_concat)); (yyval)->lasti->concat_flag = (is_simple_var ? CSVAR : 0); (yyval)->lasti->expr_count = count; if (count > max_args) max_args = count; } } -#line 3358 "awkgram.c" /* yacc.c:1646 */ break; case 129: -#line 1406 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3364 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1451 "awkgram.y" + { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 130: -#line 1408 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3370 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1453 "awkgram.y" + { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 131: -#line 1410 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3376 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1455 "awkgram.y" + { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 132: -#line 1412 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3382 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1457 "awkgram.y" + { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 133: -#line 1414 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3388 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1459 "awkgram.y" + { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 134: -#line 1416 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3394 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1461 "awkgram.y" + { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 135: -#line 1418 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1463 "awkgram.y" { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' */ - if ((rule == BEGINFILE || rule == ENDFILE) && (yyvsp[0]) == NULL) - error_ln((yyvsp[-2])->source_line, + if ((rule == BEGINFILE || rule == ENDFILE) && (yyvsp[(3) - (3)]) == NULL) + error_ln((yyvsp[(1) - (3)])->source_line, _("non-redirected `getline' invalid inside `%s' rule"), ruletab[rule]); - if (do_lint && rule == END && (yyvsp[0]) == NULL) - lintwarn_ln((yyvsp[-2])->source_line, + if (do_lint && rule == END && (yyvsp[(3) - (3)]) == NULL) + lintwarn_ln((yyvsp[(1) - (3)])->source_line, _("non-redirected `getline' undefined inside END action")); - (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); + (yyval) = mk_getline((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), redirect_input); } -#line 3412 "awkgram.c" /* yacc.c:1646 */ break; case 136: -#line 1432 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1477 "awkgram.y" { - (yyvsp[0])->opcode = Op_postincrement; - (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); + (yyvsp[(2) - (2)])->opcode = Op_postincrement; + (yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) - (2)])); } -#line 3421 "awkgram.c" /* yacc.c:1646 */ break; case 137: -#line 1437 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1482 "awkgram.y" { - (yyvsp[0])->opcode = Op_postdecrement; - (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); + (yyvsp[(2) - (2)])->opcode = Op_postdecrement; + (yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) - (2)])); } -#line 3430 "awkgram.c" /* yacc.c:1646 */ break; case 138: -#line 1442 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1487 "awkgram.y" { if (do_lint_old) { - warning_ln((yyvsp[-1])->source_line, + warning_ln((yyvsp[(4) - (5)])->source_line, _("old awk does not support the keyword `in' except after `for'")); - warning_ln((yyvsp[-1])->source_line, + warning_ln((yyvsp[(4) - (5)])->source_line, _("old awk does not support multidimensional arrays")); } - (yyvsp[0])->nexti->opcode = Op_push_array; - (yyvsp[-1])->opcode = Op_in_array; - if ((yyvsp[-3]) == NULL) { /* error */ + (yyvsp[(5) - (5)])->nexti->opcode = Op_push_array; + (yyvsp[(4) - (5)])->opcode = Op_in_array; + if ((yyvsp[(2) - (5)]) == NULL) { /* error */ errcount++; - (yyvsp[-1])->expr_count = 0; - (yyval) = list_merge((yyvsp[0]), (yyvsp[-1])); + (yyvsp[(4) - (5)])->expr_count = 0; + (yyval) = list_merge((yyvsp[(5) - (5)]), (yyvsp[(4) - (5)])); } else { - INSTRUCTION *t = (yyvsp[-3]); - (yyvsp[-1])->expr_count = count_expressions(&t, false); - (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); + INSTRUCTION *t = (yyvsp[(2) - (5)]); + (yyvsp[(4) - (5)])->expr_count = count_expressions(&t, false); + (yyval) = list_append(list_merge(t, (yyvsp[(5) - (5)])), (yyvsp[(4) - (5)])); } } -#line 3454 "awkgram.c" /* yacc.c:1646 */ break; case 139: -#line 1467 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1512 "awkgram.y" { - (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); - bcfree((yyvsp[-2])); + (yyval) = mk_getline((yyvsp[(3) - (4)]), (yyvsp[(4) - (4)]), (yyvsp[(1) - (4)]), (yyvsp[(2) - (4)])->redir_type); + bcfree((yyvsp[(2) - (4)])); } -#line 3463 "awkgram.c" /* yacc.c:1646 */ break; case 140: -#line 1473 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3469 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1518 "awkgram.y" + { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 141: -#line 1475 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3475 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1520 "awkgram.y" + { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 142: -#line 1477 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3481 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1522 "awkgram.y" + { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 143: -#line 1479 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3487 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1524 "awkgram.y" + { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 144: -#line 1481 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3493 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1526 "awkgram.y" + { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 145: -#line 1483 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3499 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1528 "awkgram.y" + { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } break; case 146: -#line 1488 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1533 "awkgram.y" { - (yyval) = list_create((yyvsp[0])); + (yyval) = list_create((yyvsp[(1) - (1)])); } -#line 3507 "awkgram.c" /* yacc.c:1646 */ break; case 147: -#line 1492 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1537 "awkgram.y" { - if ((yyvsp[0])->opcode == Op_match_rec) { - (yyvsp[0])->opcode = Op_nomatch; - (yyvsp[-1])->opcode = Op_push_i; - (yyvsp[-1])->memory = make_number(0.0); - (yyval) = list_append(list_append(list_create((yyvsp[-1])), - instruction(Op_field_spec)), (yyvsp[0])); + if ((yyvsp[(2) - (2)])->opcode == Op_match_rec) { + (yyvsp[(2) - (2)])->opcode = Op_nomatch; + (yyvsp[(1) - (2)])->opcode = Op_push_i; + (yyvsp[(1) - (2)])->memory = make_number(0.0); + (yyval) = list_append(list_append(list_create((yyvsp[(1) - (2)])), + instruction(Op_field_spec)), (yyvsp[(2) - (2)])); } else { - if (do_optimize && (yyvsp[0])->nexti == (yyvsp[0])->lasti - && (yyvsp[0])->nexti->opcode == Op_push_i - && ((yyvsp[0])->nexti->memory->flags & (MPFN|MPZN)) == 0 + if (do_optimize && (yyvsp[(2) - (2)])->nexti == (yyvsp[(2) - (2)])->lasti + && (yyvsp[(2) - (2)])->nexti->opcode == Op_push_i + && ((yyvsp[(2) - (2)])->nexti->memory->flags & (MPFN|MPZN)) == 0 ) { - NODE *n = (yyvsp[0])->nexti->memory; + NODE *n = (yyvsp[(2) - (2)])->nexti->memory; if ((n->flags & (STRCUR|STRING)) != 0) { n->numbr = (AWKNUM) (n->stlen == 0); n->flags &= ~(STRCUR|STRING); @@ -3530,139 +3779,139 @@ regular_print: n->stlen = 0; } else n->numbr = (AWKNUM) (n->numbr == 0.0); - bcfree((yyvsp[-1])); - (yyval) = (yyvsp[0]); + bcfree((yyvsp[(1) - (2)])); + (yyval) = (yyvsp[(2) - (2)]); } else { - (yyvsp[-1])->opcode = Op_not; - add_lint((yyvsp[0]), LINT_assign_in_cond); - (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); + (yyvsp[(1) - (2)])->opcode = Op_not; + add_lint((yyvsp[(2) - (2)]), LINT_assign_in_cond); + (yyval) = list_append((yyvsp[(2) - (2)]), (yyvsp[(1) - (2)])); } } } -#line 3543 "awkgram.c" /* yacc.c:1646 */ break; case 148: -#line 1524 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[-1]); } -#line 3549 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1569 "awkgram.y" + { (yyval) = (yyvsp[(2) - (3)]); } break; case 149: -#line 1526 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1571 "awkgram.y" { - (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); + (yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)])); if ((yyval) == NULL) YYABORT; } -#line 3559 "awkgram.c" /* yacc.c:1646 */ break; case 150: -#line 1532 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1577 "awkgram.y" { - (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); + (yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)])); if ((yyval) == NULL) YYABORT; } -#line 3569 "awkgram.c" /* yacc.c:1646 */ break; case 151: -#line 1538 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1583 "awkgram.y" { static bool warned = false; if (do_lint && ! warned) { warned = true; - lintwarn_ln((yyvsp[0])->source_line, + lintwarn_ln((yyvsp[(1) - (1)])->source_line, _("call of `length' without parentheses is not portable")); } - (yyval) = snode(NULL, (yyvsp[0])); + (yyval) = snode(NULL, (yyvsp[(1) - (1)])); if ((yyval) == NULL) YYABORT; } -#line 3586 "awkgram.c" /* yacc.c:1646 */ break; case 154: -#line 1553 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1598 "awkgram.y" { - (yyvsp[-1])->opcode = Op_preincrement; - (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); + (yyvsp[(1) - (2)])->opcode = Op_preincrement; + (yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) - (2)])); } -#line 3595 "awkgram.c" /* yacc.c:1646 */ break; case 155: -#line 1558 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1603 "awkgram.y" { - (yyvsp[-1])->opcode = Op_predecrement; - (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); + (yyvsp[(1) - (2)])->opcode = Op_predecrement; + (yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) - (2)])); } -#line 3604 "awkgram.c" /* yacc.c:1646 */ break; case 156: -#line 1563 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1608 "awkgram.y" { - (yyval) = list_create((yyvsp[0])); + (yyval) = list_create((yyvsp[(1) - (1)])); } -#line 3612 "awkgram.c" /* yacc.c:1646 */ break; case 157: -#line 1567 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1612 "awkgram.y" { - (yyval) = list_create((yyvsp[0])); + (yyval) = list_create((yyvsp[(1) - (1)])); } -#line 3620 "awkgram.c" /* yacc.c:1646 */ break; case 158: -#line 1571 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1616 "awkgram.y" { - if ((yyvsp[0])->lasti->opcode == Op_push_i - && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0 + if ((yyvsp[(2) - (2)])->lasti->opcode == Op_push_i + && ((yyvsp[(2) - (2)])->lasti->memory->flags & (STRCUR|STRING)) == 0 ) { - NODE *n = (yyvsp[0])->lasti->memory; + NODE *n = (yyvsp[(2) - (2)])->lasti->memory; (void) force_number(n); negate_num(n); - (yyval) = (yyvsp[0]); - bcfree((yyvsp[-1])); + (yyval) = (yyvsp[(2) - (2)]); + bcfree((yyvsp[(1) - (2)])); } else { - (yyvsp[-1])->opcode = Op_unary_minus; - (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); + (yyvsp[(1) - (2)])->opcode = Op_unary_minus; + (yyval) = list_append((yyvsp[(2) - (2)]), (yyvsp[(1) - (2)])); } } -#line 3639 "awkgram.c" /* yacc.c:1646 */ break; case 159: -#line 1586 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1631 "awkgram.y" { /* * was: $$ = $2 * POSIX semantics: force a conversion to numeric type */ - (yyvsp[-1])->opcode = Op_plus_i; - (yyvsp[-1])->memory = make_number(0.0); - (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); + (yyvsp[(1) - (2)])->opcode = Op_plus_i; + (yyvsp[(1) - (2)])->memory = make_number(0.0); + (yyval) = list_append((yyvsp[(2) - (2)]), (yyvsp[(1) - (2)])); } -#line 3653 "awkgram.c" /* yacc.c:1646 */ break; case 160: -#line 1599 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1644 "awkgram.y" { - func_use((yyvsp[0])->lasti->func_name, FUNC_USE); - (yyval) = (yyvsp[0]); + func_use((yyvsp[(1) - (1)])->lasti->func_name, FUNC_USE); + (yyval) = (yyvsp[(1) - (1)]); } -#line 3662 "awkgram.c" /* yacc.c:1646 */ break; case 161: -#line 1604 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1649 "awkgram.y" { /* indirect function call */ INSTRUCTION *f, *t; @@ -3678,7 +3927,7 @@ regular_print: lintwarn("%s", msg); } - f = (yyvsp[0])->lasti; + f = (yyvsp[(2) - (2)])->lasti; f->opcode = Op_indirect_func_call; name = estrdup(f->func_name, strlen(f->func_name)); if (is_std_var(name)) @@ -3693,71 +3942,71 @@ regular_print: * @f(f="real_fun") */ - (yyval) = list_prepend((yyvsp[0]), t); + (yyval) = list_prepend((yyvsp[(2) - (2)]), t); } -#line 3699 "awkgram.c" /* yacc.c:1646 */ break; case 162: -#line 1640 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1685 "awkgram.y" { - param_sanity((yyvsp[-1])); - (yyvsp[-3])->opcode = Op_func_call; - (yyvsp[-3])->func_body = NULL; - if ((yyvsp[-1]) == NULL) { /* no argument or error */ - ((yyvsp[-3]) + 1)->expr_count = 0; - (yyval) = list_create((yyvsp[-3])); + param_sanity((yyvsp[(3) - (4)])); + (yyvsp[(1) - (4)])->opcode = Op_func_call; + (yyvsp[(1) - (4)])->func_body = NULL; + if ((yyvsp[(3) - (4)]) == NULL) { /* no argument or error */ + ((yyvsp[(1) - (4)]) + 1)->expr_count = 0; + (yyval) = list_create((yyvsp[(1) - (4)])); } else { - INSTRUCTION *t = (yyvsp[-1]); - ((yyvsp[-3]) + 1)->expr_count = count_expressions(&t, true); - (yyval) = list_append(t, (yyvsp[-3])); + INSTRUCTION *t = (yyvsp[(3) - (4)]); + ((yyvsp[(1) - (4)]) + 1)->expr_count = count_expressions(&t, true); + (yyval) = list_append(t, (yyvsp[(1) - (4)])); } } -#line 3717 "awkgram.c" /* yacc.c:1646 */ break; case 163: -#line 1657 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1702 "awkgram.y" { (yyval) = NULL; } -#line 3723 "awkgram.c" /* yacc.c:1646 */ break; case 164: -#line 1659 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3729 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1704 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 165: -#line 1664 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1709 "awkgram.y" { (yyval) = NULL; } -#line 3735 "awkgram.c" /* yacc.c:1646 */ break; case 166: -#line 1666 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[-1]); } -#line 3741 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1711 "awkgram.y" + { (yyval) = (yyvsp[(1) - (2)]); } break; case 167: -#line 1671 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3747 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1716 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 168: -#line 1673 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1718 "awkgram.y" { - (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); + (yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); } -#line 3755 "awkgram.c" /* yacc.c:1646 */ break; case 169: -#line 1680 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1725 "awkgram.y" { - INSTRUCTION *ip = (yyvsp[0])->lasti; + INSTRUCTION *ip = (yyvsp[(1) - (1)])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ if (count > 1) { /* change Op_subscript or Op_sub_array to Op_concat */ @@ -3767,152 +4016,152 @@ regular_print: } else ip->opcode = Op_no_op; sub_counter++; /* count # of dimensions */ - (yyval) = (yyvsp[0]); + (yyval) = (yyvsp[(1) - (1)]); } -#line 3773 "awkgram.c" /* yacc.c:1646 */ break; case 170: -#line 1697 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1742 "awkgram.y" { - INSTRUCTION *t = (yyvsp[-1]); - if ((yyvsp[-1]) == NULL) { - error_ln((yyvsp[0])->source_line, + INSTRUCTION *t = (yyvsp[(2) - (3)]); + if ((yyvsp[(2) - (3)]) == NULL) { + error_ln((yyvsp[(3) - (3)])->source_line, _("invalid subscript expression")); /* install Null string as subscript. */ t = list_create(instruction(Op_push_i)); t->nexti->memory = dupnode(Nnull_string); - (yyvsp[0])->sub_count = 1; + (yyvsp[(3) - (3)])->sub_count = 1; } else - (yyvsp[0])->sub_count = count_expressions(&t, false); - (yyval) = list_append(t, (yyvsp[0])); + (yyvsp[(3) - (3)])->sub_count = count_expressions(&t, false); + (yyval) = list_append(t, (yyvsp[(3) - (3)])); } -#line 3791 "awkgram.c" /* yacc.c:1646 */ break; case 171: -#line 1714 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3797 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1759 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); } break; case 172: -#line 1716 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1761 "awkgram.y" { - (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); + (yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); } -#line 3805 "awkgram.c" /* yacc.c:1646 */ break; case 173: -#line 1723 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[-1]); } -#line 3811 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1768 "awkgram.y" + { (yyval) = (yyvsp[(1) - (2)]); } break; case 174: -#line 1728 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1773 "awkgram.y" { - char *var_name = (yyvsp[0])->lextok; + char *var_name = (yyvsp[(1) - (1)])->lextok; - (yyvsp[0])->opcode = Op_push; - (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); - (yyval) = list_create((yyvsp[0])); + (yyvsp[(1) - (1)])->opcode = Op_push; + (yyvsp[(1) - (1)])->memory = variable((yyvsp[(1) - (1)])->source_line, var_name, Node_var_new); + (yyval) = list_create((yyvsp[(1) - (1)])); } -#line 3823 "awkgram.c" /* yacc.c:1646 */ break; case 175: -#line 1736 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1781 "awkgram.y" { - char *arr = (yyvsp[-1])->lextok; - (yyvsp[-1])->memory = variable((yyvsp[-1])->source_line, arr, Node_var_new); - (yyvsp[-1])->opcode = Op_push_array; - (yyval) = list_prepend((yyvsp[0]), (yyvsp[-1])); + char *arr = (yyvsp[(1) - (2)])->lextok; + (yyvsp[(1) - (2)])->memory = variable((yyvsp[(1) - (2)])->source_line, arr, Node_var_new); + (yyvsp[(1) - (2)])->opcode = Op_push_array; + (yyval) = list_prepend((yyvsp[(2) - (2)]), (yyvsp[(1) - (2)])); } -#line 3834 "awkgram.c" /* yacc.c:1646 */ break; case 176: -#line 1746 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1791 "awkgram.y" { - INSTRUCTION *ip = (yyvsp[0])->nexti; + INSTRUCTION *ip = (yyvsp[(1) - (1)])->nexti; if (ip->opcode == Op_push && ip->memory->type == Node_var && ip->memory->var_update ) { - (yyval) = list_prepend((yyvsp[0]), instruction(Op_var_update)); + (yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_var_update)); (yyval)->nexti->update_var = ip->memory->var_update; } else - (yyval) = (yyvsp[0]); + (yyval) = (yyvsp[(1) - (1)]); } -#line 3850 "awkgram.c" /* yacc.c:1646 */ break; case 177: -#line 1758 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1803 "awkgram.y" { - (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); - if ((yyvsp[0]) != NULL) - mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); + (yyval) = list_append((yyvsp[(2) - (3)]), (yyvsp[(1) - (3)])); + if ((yyvsp[(3) - (3)]) != NULL) + mk_assignment((yyvsp[(2) - (3)]), NULL, (yyvsp[(3) - (3)])); } -#line 3860 "awkgram.c" /* yacc.c:1646 */ break; case 178: -#line 1767 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1812 "awkgram.y" { - (yyvsp[0])->opcode = Op_postincrement; + (yyvsp[(1) - (1)])->opcode = Op_postincrement; } -#line 3868 "awkgram.c" /* yacc.c:1646 */ break; case 179: -#line 1771 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1816 "awkgram.y" { - (yyvsp[0])->opcode = Op_postdecrement; + (yyvsp[(1) - (1)])->opcode = Op_postdecrement; } -#line 3876 "awkgram.c" /* yacc.c:1646 */ break; case 180: -#line 1774 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1819 "awkgram.y" { (yyval) = NULL; } -#line 3882 "awkgram.c" /* yacc.c:1646 */ break; case 182: -#line 1782 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1827 "awkgram.y" { yyerrok; } -#line 3888 "awkgram.c" /* yacc.c:1646 */ break; case 183: -#line 1786 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1831 "awkgram.y" { yyerrok; } -#line 3894 "awkgram.c" /* yacc.c:1646 */ break; case 186: -#line 1795 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1840 "awkgram.y" { yyerrok; } -#line 3900 "awkgram.c" /* yacc.c:1646 */ break; case 187: -#line 1799 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); yyerrok; } -#line 3906 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1844 "awkgram.y" + { (yyval) = (yyvsp[(1) - (1)]); yyerrok; } break; case 188: -#line 1803 "awkgram.y" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 1848 "awkgram.y" { yyerrok; } -#line 3912 "awkgram.c" /* yacc.c:1646 */ break; -#line 3916 "awkgram.c" /* yacc.c:1646 */ +/* Line 1792 of yacc.c */ +#line 4165 "awkgram.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3934,7 +4183,7 @@ regular_print: *++yyvsp = yyval; - /* Now 'shift' the result of the reduction. Determine what state + /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -3949,9 +4198,9 @@ regular_print: goto yynewstate; -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -4002,20 +4251,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -4034,7 +4283,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule whose action triggered + /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -4047,29 +4296,29 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -4120,14 +4369,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } - /* Do not reclaim the symbols of the rule whose action triggered + /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -4138,9 +4387,13 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - return yyresult; + /* Make sure YYID is used. */ + return YYID (yyresult); } -#line 1805 "awkgram.y" /* yacc.c:1906 */ + + +/* Line 2055 of yacc.c */ +#line 1850 "awkgram.y" struct token { @@ -4573,6 +4826,8 @@ mk_program() cp = end_block; else cp = list_merge(begin_block, end_block); + if (comment != NULL) + (void) list_append(cp, comment); (void) list_append(cp, ip_atexit); (void) list_append(cp, instruction(Op_stop)); @@ -4605,6 +4860,12 @@ mk_program() if (begin_block != NULL) cp = list_merge(begin_block, cp); + if (comment0 != NULL){ + (void) list_prepend(cp, comment0); + } + if (comment != NULL){ + (void) list_append(cp, comment); + } (void) list_append(cp, ip_atexit); (void) list_append(cp, instruction(Op_stop)); @@ -5278,6 +5539,78 @@ pushback(void) } +/* get_comment --- collect comment text */ + +int get_comment(void) +{ + int c; + int sl; + tok = tokstart; + tokadd('#'); + sl = sourceline; + + while (true){ + while ((c = nextc(false)) != '\n' && c != END_FILE){ + tokadd(c); + } + if (c == '\n'){ + tokadd(c); + sourceline++; + do { + c = nextc(false); + if (c == '\n') { + sourceline++; + tokadd(c); + } + } while (isspace(c) && c != END_FILE) ; + if ( c == END_FILE) + break; + else if (c != '#'){ + pushback(); + break; + } else + tokadd(c); + } else + break; + } + comment = bcalloc(Op_comment, 1, sl); + comment->source_file = source; + comment->memory = make_str_node(tokstart, tok - tokstart, 0); + + return c; +} + +/* split_comment --- split initial comment text into program and function parts */ + +void split_comment(void) +{ + char *p; + int l; + int j; + NODE *n; + + p = comment->memory->stptr; + l = comment->memory->stlen - 3; + /* have at least two comments so split at last blank line ( \n\n) */ + while (l >= 0){ + if (p[l] == '\n' && p[l+1] == '\n'){ + commentf = comment; + n = commentf->memory; + commentf->memory = make_str_node(p + l + 2, n->stlen - l - 2, 0); + /* create program comment */ + comment0 = bcalloc(Op_comment, 1, sourceline); + comment0->source_file = comment->source_file; + p[l + 2] = 0; + comment0->memory = make_str_node(p , l + 2, 0); + comment = NULL; + freenode(n); + break; + } + else l--; + } + +} + /* allow_newline --- allow newline after &&, ||, ? and : */ static void @@ -5292,30 +5625,13 @@ allow_newline(void) break; } if (c == '#') { -// if (do_pretty_print) { - tok = tokstart; - tokadd('#'); + if (do_pretty_print && !do_profile) { + /* collect comment byte code iff doing pretty print but not profiling. */ + c = get_comment(); + } else { while ((c = nextc(false)) != '\n' && c != END_FILE) - tokadd(c); - if (c == '\n') - tokadd(c); - - if (comment != NULL) { - size_t new = comment->memory->stlen + (tok - tokstart) + 2; - erealloc(comment->memory->stptr, char *, new, "allow_newline"); - memcpy(comment->memory->stptr + comment->memory->stlen, tokstart, (tok - tokstart)); - comment->memory->stlen += (tok - tokstart); - comment->memory->stptr[comment->memory->stlen] = '\0'; - } else { - comment = bcalloc(Op_comment, 1, sourceline); - comment->source_file = source; - - comment->memory = make_str_node(tokstart, tok - tokstart, 0); - } -// } else { -// while ((c = nextc()) != '\n' && c != END_FILE) -// continue; -// } + continue; + } if (c == END_FILE) { pushback(); break; @@ -5519,37 +5835,18 @@ retry: return lasttok = NEWLINE; case '#': /* it's a comment */ -// if (do_pretty_print) { - tok = tokstart; - tokadd('#'); - while ((c = nextc(false)) != '\n') { - if (c == END_FILE) - break; - tokadd(c); - } - if (c == '\n') - tokadd(c); - - if (comment != NULL) { - size_t new = comment->memory->stlen + (tok - tokstart) + 2; - erealloc(comment->memory->stptr, char *, new, "yylex"); - memcpy(comment->memory->stptr + comment->memory->stlen, tokstart, (tok - tokstart)); - comment->memory->stlen += (tok - tokstart); - comment->memory->stptr[comment->memory->stlen] = '\0'; - } else { - comment = bcalloc(Op_comment, 1, sourceline); - comment->source_file = source; - comment->memory = make_str_node(tokstart, tok - tokstart, 0); - } + if (do_pretty_print && ! do_profile) { + /* collect comment byte code iff doing pretty print but not profiling. */ + c = get_comment(); if (c == END_FILE) return lasttok = NEWLINE_EOF; -// } else { -// while ((c = nextc()) != '\n') { -// if (c == END_FILE) -// return lasttok = NEWLINE_EOF; -// } -// } + } else { + while ((c = nextc(false)) != '\n') { + if (c == END_FILE) + return lasttok = NEWLINE_EOF; + } + } sourceline++; return lasttok = NEWLINE; @@ -5559,7 +5856,7 @@ retry: case '\\': #ifdef RELAXED_CONTINUATION /* - * This code puports to allow comments and/or whitespace + * This code purports to allow comments and/or whitespace * after the `\' at the end of a line used for continuation. * Use it at your own risk. We think it's a bad idea, which * is why it's not on by default. @@ -5576,9 +5873,13 @@ retry: lintwarn( _("use of `\\ #...' line continuation is not portable")); } - while ((c = nextc(false)) != '\n') - if (c == END_FILE) - break; + if (do_pretty_print && !do_profile) + c = get_comment(); + else { + while ((c = nextc(false)) != '\n') + if (c == END_FILE) + break; + } } pushback(); } @@ -5790,7 +6091,7 @@ retry: lastline = sourceline; return lasttok = c; } - did_newline++; + did_newline = true; --lexptr; /* pick up } next time */ return lasttok = NEWLINE; @@ -6639,6 +6940,14 @@ mk_function(INSTRUCTION *fi, INSTRUCTION *def) (t + 1)->tail_call = true; } + /* add any pre-function comment to start of action for profile.c */ + + if (commentf != NULL){ + commentf->source_line = 0; + (void) list_prepend(def, commentf); + commentf = NULL; + } + /* add an implicit return at end; * also used by 'return' command in debugger */ @@ -7460,11 +7769,6 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action) } } -// if (comment != NULL) { -// ip = list_prepend(ip, comment); -// comment = NULL; -// } - list_append(rule_list, rp + 1); if (rule_block[rule] == NULL) -- cgit v1.2.3 From 01629cb09cce23f1b8c014280b97a2f19ca34e25 Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Tue, 9 Sep 2014 09:04:03 +0930 Subject: sync awkgram --- awkgram.c | 1 - 1 file changed, 1 deletion(-) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index 9704e1c7..82426e42 100644 --- a/awkgram.c +++ b/awkgram.c @@ -5847,7 +5847,6 @@ retry: return lasttok = NEWLINE_EOF; } } - sourceline++; return lasttok = NEWLINE; case '@': -- cgit v1.2.3 From f7cd8393105d286074d6e1a918b4fd6228f00245 Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Tue, 9 Sep 2014 16:38:39 +0930 Subject: fix awkgram.y --- awkgram.c | 1 + 1 file changed, 1 insertion(+) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index 82426e42..9704e1c7 100644 --- a/awkgram.c +++ b/awkgram.c @@ -5847,6 +5847,7 @@ retry: return lasttok = NEWLINE_EOF; } } + sourceline++; return lasttok = NEWLINE; case '@': -- cgit v1.2.3 From f671c30534a2e3b0675f81cbb82f0d0e82ace6c3 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 12 Sep 2014 18:15:37 +0300 Subject: Minor code cleanups. --- awkgram.c | 2688 ++++++++++++++++++++++++++++--------------------------------- 1 file changed, 1243 insertions(+), 1445 deletions(-) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index c9c539d9..3ea5d6c9 100644 --- a/awkgram.c +++ b/awkgram.c @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7" +#define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -62,8 +62,7 @@ /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 26 "awkgram.y" +#line 26 "awkgram.y" /* yacc.c:339 */ #ifdef GAWKDEBUG #define YYDEBUG 12 @@ -192,7 +191,7 @@ static INSTRUCTION *comment = NULL; static INSTRUCTION *comment0 = NULL; static INSTRUCTION *commentf = NULL; -static int func_first = 1; +static bool func_first = true; static inline INSTRUCTION *list_create(INSTRUCTION *x); static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x); @@ -205,14 +204,13 @@ extern double fmod(double x, double y); #define is_identchar(c) (isalnum(c) || (c) == '_') -/* Line 371 of yacc.c */ -#line 210 "awkgram.c" +#line 208 "awkgram.c" /* yacc.c:339 */ -# ifndef YY_NULL +# ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# define YY_NULLPTR nullptr # else -# define YY_NULL 0 +# define YY_NULLPTR 0 # endif # endif @@ -225,7 +223,7 @@ extern double fmod(double x, double y); #endif -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -233,64 +231,63 @@ extern double fmod(double x, double y); extern int yydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - FUNC_CALL = 258, - NAME = 259, - REGEXP = 260, - FILENAME = 261, - YNUMBER = 262, - YSTRING = 263, - RELOP = 264, - IO_OUT = 265, - IO_IN = 266, - ASSIGNOP = 267, - ASSIGN = 268, - MATCHOP = 269, - CONCAT_OP = 270, - SUBSCRIPT = 271, - LEX_BEGIN = 272, - LEX_END = 273, - LEX_IF = 274, - LEX_ELSE = 275, - LEX_RETURN = 276, - LEX_DELETE = 277, - LEX_SWITCH = 278, - LEX_CASE = 279, - LEX_DEFAULT = 280, - LEX_WHILE = 281, - LEX_DO = 282, - LEX_FOR = 283, - LEX_BREAK = 284, - LEX_CONTINUE = 285, - LEX_PRINT = 286, - LEX_PRINTF = 287, - LEX_NEXT = 288, - LEX_EXIT = 289, - LEX_FUNCTION = 290, - LEX_BEGINFILE = 291, - LEX_ENDFILE = 292, - LEX_GETLINE = 293, - LEX_NEXTFILE = 294, - LEX_IN = 295, - LEX_AND = 296, - LEX_OR = 297, - INCREMENT = 298, - DECREMENT = 299, - LEX_BUILTIN = 300, - LEX_LENGTH = 301, - LEX_EOF = 302, - LEX_INCLUDE = 303, - LEX_EVAL = 304, - LEX_LOAD = 305, - NEWLINE = 306, - SLASH_BEFORE_EQUAL = 307, - UNARY = 308 - }; + enum yytokentype + { + FUNC_CALL = 258, + NAME = 259, + REGEXP = 260, + FILENAME = 261, + YNUMBER = 262, + YSTRING = 263, + RELOP = 264, + IO_OUT = 265, + IO_IN = 266, + ASSIGNOP = 267, + ASSIGN = 268, + MATCHOP = 269, + CONCAT_OP = 270, + SUBSCRIPT = 271, + LEX_BEGIN = 272, + LEX_END = 273, + LEX_IF = 274, + LEX_ELSE = 275, + LEX_RETURN = 276, + LEX_DELETE = 277, + LEX_SWITCH = 278, + LEX_CASE = 279, + LEX_DEFAULT = 280, + LEX_WHILE = 281, + LEX_DO = 282, + LEX_FOR = 283, + LEX_BREAK = 284, + LEX_CONTINUE = 285, + LEX_PRINT = 286, + LEX_PRINTF = 287, + LEX_NEXT = 288, + LEX_EXIT = 289, + LEX_FUNCTION = 290, + LEX_BEGINFILE = 291, + LEX_ENDFILE = 292, + LEX_GETLINE = 293, + LEX_NEXTFILE = 294, + LEX_IN = 295, + LEX_AND = 296, + LEX_OR = 297, + INCREMENT = 298, + DECREMENT = 299, + LEX_BUILTIN = 300, + LEX_LENGTH = 301, + LEX_EOF = 302, + LEX_INCLUDE = 303, + LEX_EVAL = 304, + LEX_LOAD = 305, + NEWLINE = 306, + SLASH_BEFORE_EQUAL = 307, + UNARY = 308 + }; #endif /* Tokens. */ #define FUNC_CALL 258 @@ -345,37 +342,23 @@ extern int yydebug; #define SLASH_BEFORE_EQUAL 307 #define UNARY 308 - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE yylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 379 "awkgram.c" +#line 362 "awkgram.c" /* yacc.c:358 */ #ifdef short # undef short @@ -389,11 +372,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -413,8 +393,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -436,6 +415,33 @@ typedef short int yytype_int16; # endif #endif +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -443,24 +449,26 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif + #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -478,8 +486,7 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -491,8 +498,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -508,7 +515,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -516,15 +523,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -534,7 +539,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -559,16 +564,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif @@ -587,7 +592,7 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -603,17 +608,19 @@ union yyalloc #define YYNNTS 65 /* YYNRULES -- Number of rules. */ #define YYNRULES 188 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 335 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 308 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -650,117 +657,28 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 4, 7, 10, 13, 16, 19, 22, - 25, 30, 35, 37, 40, 42, 44, 47, 49, 50, - 52, 57, 59, 61, 63, 65, 71, 73, 75, 77, - 80, 82, 84, 91, 92, 96, 98, 100, 101, 104, - 107, 109, 112, 115, 119, 121, 131, 138, 147, 156, - 169, 181, 183, 186, 189, 192, 195, 199, 200, 205, - 208, 209, 214, 215, 220, 225, 227, 228, 230, 231, - 234, 237, 243, 248, 250, 253, 256, 258, 260, 262, - 264, 266, 270, 271, 272, 276, 283, 293, 295, 298, - 299, 301, 302, 305, 306, 308, 310, 314, 316, 319, - 323, 324, 326, 327, 329, 331, 335, 337, 340, 344, - 348, 352, 356, 360, 364, 368, 372, 378, 380, 382, - 384, 387, 389, 391, 393, 395, 397, 399, 402, 404, - 408, 412, 416, 420, 424, 428, 432, 435, 438, 444, - 449, 453, 457, 461, 465, 469, 473, 475, 478, 482, - 487, 492, 494, 496, 498, 501, 504, 506, 508, 511, - 514, 516, 519, 524, 525, 527, 528, 531, 533, 536, - 538, 542, 544, 547, 550, 552, 555, 557, 561, 563, - 565, 566, 569, 572, 574, 575, 577, 579, 581 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 76, 0, -1, -1, 76, 77, -1, 76, 105, -1, - 76, 47, -1, 76, 1, -1, 80, 81, -1, 80, - 89, -1, 84, 81, -1, 69, 48, 78, 89, -1, - 69, 50, 79, 89, -1, 6, -1, 6, 1, -1, - 1, -1, 6, -1, 6, 1, -1, 1, -1, -1, - 113, -1, 113, 55, 106, 113, -1, 17, -1, 18, - -1, 36, -1, 37, -1, 133, 88, 134, 136, 106, - -1, 4, -1, 3, -1, 83, -1, 69, 49, -1, - 45, -1, 46, -1, 35, 82, 67, 108, 135, 106, - -1, -1, 87, 86, 5, -1, 61, -1, 52, -1, - -1, 88, 90, -1, 88, 1, -1, 105, -1, 137, - 106, -1, 137, 106, -1, 133, 88, 134, -1, 104, - -1, 23, 67, 113, 135, 106, 133, 97, 106, 134, - -1, 26, 67, 113, 135, 106, 90, -1, 27, 106, - 90, 26, 67, 113, 135, 106, -1, 28, 67, 4, - 40, 130, 135, 106, 90, -1, 28, 67, 96, 137, - 106, 113, 137, 106, 96, 135, 106, 90, -1, 28, - 67, 96, 137, 106, 137, 106, 96, 135, 106, 90, - -1, 91, -1, 29, 89, -1, 30, 89, -1, 33, - 89, -1, 39, 89, -1, 34, 110, 89, -1, -1, - 21, 92, 110, 89, -1, 93, 89, -1, -1, 100, - 94, 101, 102, -1, -1, 22, 4, 95, 124, -1, - 22, 67, 4, 68, -1, 113, -1, -1, 93, -1, - -1, 97, 98, -1, 97, 1, -1, 24, 99, 138, - 106, 88, -1, 25, 138, 106, 88, -1, 7, -1, - 59, 7, -1, 58, 7, -1, 8, -1, 85, -1, - 31, -1, 32, -1, 111, -1, 67, 112, 135, -1, - -1, -1, 10, 103, 117, -1, 19, 67, 113, 135, - 106, 90, -1, 19, 67, 113, 135, 106, 90, 20, - 106, 90, -1, 51, -1, 105, 51, -1, -1, 105, - -1, -1, 56, 118, -1, -1, 109, -1, 4, -1, - 109, 139, 4, -1, 1, -1, 109, 1, -1, 109, - 139, 1, -1, -1, 113, -1, -1, 112, -1, 113, - -1, 112, 139, 113, -1, 1, -1, 112, 1, -1, - 112, 1, 113, -1, 112, 139, 1, -1, 131, 114, - 113, -1, 113, 41, 113, -1, 113, 42, 113, -1, - 113, 14, 113, -1, 113, 40, 130, -1, 113, 116, - 113, -1, 113, 53, 113, 54, 113, -1, 117, -1, - 13, -1, 12, -1, 52, 13, -1, 9, -1, 56, - -1, 115, -1, 57, -1, 118, -1, 119, -1, 117, - 118, -1, 120, -1, 118, 65, 118, -1, 118, 60, - 118, -1, 118, 61, 118, -1, 118, 62, 118, -1, - 118, 58, 118, -1, 118, 59, 118, -1, 38, 123, - 107, -1, 131, 43, -1, 131, 44, -1, 67, 112, - 135, 40, 130, -1, 117, 11, 38, 123, -1, 119, - 65, 118, -1, 119, 60, 118, -1, 119, 61, 118, - -1, 119, 62, 118, -1, 119, 58, 118, -1, 119, - 59, 118, -1, 85, -1, 63, 118, -1, 67, 113, - 135, -1, 45, 67, 111, 135, -1, 46, 67, 111, - 135, -1, 46, -1, 121, -1, 131, -1, 43, 131, - -1, 44, 131, -1, 7, -1, 8, -1, 59, 118, - -1, 58, 118, -1, 122, -1, 69, 122, -1, 3, - 67, 111, 135, -1, -1, 131, -1, -1, 125, 16, - -1, 126, -1, 125, 126, -1, 127, -1, 70, 112, - 71, -1, 127, -1, 128, 127, -1, 128, 16, -1, - 4, -1, 4, 129, -1, 130, -1, 66, 120, 132, - -1, 43, -1, 44, -1, -1, 72, 106, -1, 73, - 106, -1, 68, -1, -1, 137, -1, 74, -1, 54, - -1, 55, 106, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 207, 207, 209, 214, 215, 221, 233, 237, 248, 254, 259, 267, 275, 277, 282, 290, 292, 298, 305, 314, 340, 353, 365, 372, 382, 394, 396, 398, 404, - 409, 410, 414, 443, 442, 476, 478, 483, 489, 517, - 522, 523, 527, 529, 531, 538, 628, 670, 712, 825, - 832, 839, 849, 858, 867, 876, 887, 903, 902, 926, - 938, 938, 1036, 1036, 1069, 1099, 1105, 1106, 1112, 1113, - 1120, 1125, 1137, 1151, 1153, 1161, 1166, 1168, 1176, 1178, - 1187, 1188, 1196, 1201, 1201, 1212, 1216, 1224, 1225, 1228, - 1230, 1235, 1236, 1245, 1246, 1251, 1256, 1262, 1264, 1266, - 1273, 1274, 1280, 1281, 1286, 1288, 1293, 1295, 1303, 1308, - 1317, 1324, 1326, 1328, 1344, 1354, 1361, 1363, 1368, 1370, - 1372, 1380, 1382, 1387, 1389, 1394, 1396, 1398, 1448, 1450, - 1452, 1454, 1456, 1458, 1460, 1462, 1476, 1481, 1486, 1511, - 1517, 1519, 1521, 1523, 1525, 1527, 1532, 1536, 1568, 1570, - 1576, 1582, 1595, 1596, 1597, 1602, 1607, 1611, 1615, 1630, - 1643, 1648, 1684, 1702, 1703, 1709, 1710, 1715, 1717, 1724, - 1741, 1758, 1760, 1767, 1772, 1780, 1790, 1802, 1811, 1815, - 1819, 1823, 1827, 1831, 1834, 1836, 1840, 1844, 1848 + 409, 410, 414, 449, 448, 482, 484, 489, 495, 523, + 528, 529, 533, 535, 537, 544, 634, 676, 718, 831, + 838, 845, 855, 864, 873, 882, 893, 909, 908, 932, + 944, 944, 1042, 1042, 1075, 1105, 1111, 1112, 1118, 1119, + 1126, 1131, 1143, 1157, 1159, 1167, 1172, 1174, 1182, 1184, + 1193, 1194, 1202, 1207, 1207, 1218, 1222, 1230, 1231, 1234, + 1236, 1241, 1242, 1251, 1252, 1257, 1262, 1268, 1270, 1272, + 1279, 1280, 1286, 1287, 1292, 1294, 1299, 1301, 1309, 1314, + 1323, 1330, 1332, 1334, 1350, 1360, 1367, 1369, 1374, 1376, + 1378, 1386, 1388, 1393, 1395, 1400, 1402, 1404, 1454, 1456, + 1458, 1460, 1462, 1464, 1466, 1468, 1482, 1487, 1492, 1517, + 1523, 1525, 1527, 1529, 1531, 1533, 1538, 1542, 1574, 1576, + 1582, 1588, 1601, 1602, 1603, 1608, 1613, 1617, 1621, 1636, + 1649, 1654, 1690, 1708, 1709, 1715, 1716, 1721, 1723, 1730, + 1747, 1764, 1766, 1773, 1778, 1786, 1796, 1808, 1817, 1821, + 1825, 1829, 1833, 1837, 1840, 1842, 1846, 1850, 1854 }; #endif @@ -793,13 +711,13 @@ static const char *const yytname[] = "func_call", "direct_func_call", "opt_variable", "delete_subscript_list", "delete_subscript", "delete_exp_list", "bracketed_exp_list", "subscript", "subscript_list", "simple_variable", "variable", "opt_incdec", "l_brace", - "r_brace", "r_paren", "opt_semi", "semi", "colon", "comma", YY_NULL + "r_brace", "r_paren", "opt_semi", "semi", "colon", "comma", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -813,110 +731,18 @@ static const yytype_uint16 yytoknum[] = }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 75, 76, 76, 76, 76, 76, 77, 77, 77, - 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, - 80, 80, 80, 80, 80, 81, 82, 82, 82, 82, - 83, 83, 84, 86, 85, 87, 87, 88, 88, 88, - 89, 89, 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 91, 91, 91, 91, 91, 92, 91, 91, - 94, 93, 95, 93, 93, 93, 96, 96, 97, 97, - 97, 98, 98, 99, 99, 99, 99, 99, 100, 100, - 101, 101, 102, 103, 102, 104, 104, 105, 105, 106, - 106, 107, 107, 108, 108, 109, 109, 109, 109, 109, - 110, 110, 111, 111, 112, 112, 112, 112, 112, 112, - 113, 113, 113, 113, 113, 113, 113, 113, 114, 114, - 114, 115, 115, 116, 116, 117, 117, 117, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 119, - 119, 119, 119, 119, 119, 119, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 121, 121, 122, 123, 123, 124, 124, 125, 125, 126, - 127, 128, 128, 129, 130, 130, 131, 131, 132, 132, - 132, 133, 134, 135, 136, 136, 137, 138, 139 -}; +#define YYPACT_NINF -273 -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, - 4, 4, 1, 2, 1, 1, 2, 1, 0, 1, - 4, 1, 1, 1, 1, 5, 1, 1, 1, 2, - 1, 1, 6, 0, 3, 1, 1, 0, 2, 2, - 1, 2, 2, 3, 1, 9, 6, 8, 8, 12, - 11, 1, 2, 2, 2, 2, 3, 0, 4, 2, - 0, 4, 0, 4, 4, 1, 0, 1, 0, 2, - 2, 5, 4, 1, 2, 2, 1, 1, 1, 1, - 1, 3, 0, 0, 3, 6, 9, 1, 2, 0, - 1, 0, 2, 0, 1, 1, 3, 1, 2, 3, - 0, 1, 0, 1, 1, 3, 1, 2, 3, 3, - 3, 3, 3, 3, 3, 3, 5, 1, 1, 1, - 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, - 3, 3, 3, 3, 3, 3, 2, 2, 5, 4, - 3, 3, 3, 3, 3, 3, 1, 2, 3, 4, - 4, 1, 1, 1, 2, 2, 1, 1, 2, 2, - 1, 2, 4, 0, 1, 0, 2, 1, 2, 1, - 3, 1, 2, 2, 1, 2, 1, 3, 1, 1, - 0, 2, 2, 1, 0, 1, 1, 1, 2 -}; +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-273))) -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 0, 1, 6, 0, 174, 156, 157, 21, 22, - 0, 23, 24, 163, 0, 0, 0, 151, 5, 87, - 36, 0, 0, 35, 0, 0, 0, 0, 3, 0, - 0, 146, 33, 4, 19, 117, 125, 126, 128, 152, - 160, 176, 153, 0, 0, 171, 0, 175, 27, 26, - 30, 31, 0, 0, 28, 91, 164, 154, 155, 0, - 0, 0, 159, 153, 158, 147, 0, 180, 153, 106, - 0, 104, 0, 0, 161, 89, 186, 7, 8, 40, - 37, 89, 9, 0, 88, 121, 0, 0, 0, 0, - 0, 89, 122, 124, 123, 0, 0, 127, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 119, 118, 136, 137, 0, 0, 0, 0, 104, 0, - 173, 172, 29, 0, 0, 135, 0, 0, 0, 178, - 179, 177, 107, 89, 183, 0, 0, 148, 14, 0, - 0, 17, 0, 0, 90, 181, 0, 41, 34, 113, - 114, 111, 112, 0, 0, 115, 163, 133, 134, 130, - 131, 132, 129, 144, 145, 141, 142, 143, 140, 120, - 110, 162, 170, 97, 95, 0, 0, 92, 149, 150, - 108, 188, 0, 109, 105, 13, 10, 16, 11, 39, - 0, 57, 0, 0, 0, 89, 0, 0, 0, 78, - 79, 0, 100, 0, 89, 38, 51, 0, 60, 44, - 65, 37, 184, 89, 0, 20, 139, 89, 98, 0, - 138, 0, 100, 62, 0, 0, 0, 0, 66, 52, - 53, 54, 0, 101, 55, 182, 59, 0, 0, 89, - 185, 42, 116, 32, 99, 96, 0, 0, 165, 0, - 0, 0, 0, 174, 67, 0, 56, 0, 82, 80, - 43, 25, 89, 58, 63, 0, 167, 169, 64, 89, - 89, 0, 0, 89, 0, 83, 61, 0, 166, 168, - 0, 0, 0, 0, 0, 81, 0, 85, 68, 46, - 0, 89, 0, 89, 84, 89, 0, 89, 0, 89, - 66, 0, 70, 0, 0, 69, 0, 47, 48, 66, - 0, 86, 73, 76, 0, 0, 77, 0, 187, 89, - 45, 0, 89, 75, 74, 89, 37, 89, 0, 37, - 0, 0, 50, 0, 49 -}; +#define YYTABLE_NINF -104 -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 1, 28, 140, 143, 29, 77, 53, 54, 30, - 31, 83, 32, 146, 78, 205, 206, 222, 207, 237, - 248, 255, 296, 305, 317, 208, 258, 276, 286, 209, - 144, 145, 125, 175, 176, 232, 116, 117, 210, 115, - 94, 95, 35, 36, 37, 38, 39, 40, 55, 264, - 265, 266, 45, 46, 47, 41, 42, 131, 211, 212, - 137, 239, 213, 319, 136 -}; +#define yytable_value_is_error(Yytable_value) \ + (!!((Yytable_value) == (-104))) -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -273 + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { -273, 376, -273, -273, -27, -21, -273, -273, -273, -273, @@ -955,7 +781,48 @@ static const yytype_int16 yypact[] = 448, 710, -273, 522, -273 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 2, 0, 1, 6, 0, 174, 156, 157, 21, 22, + 0, 23, 24, 163, 0, 0, 0, 151, 5, 87, + 36, 0, 0, 35, 0, 0, 0, 0, 3, 0, + 0, 146, 33, 4, 19, 117, 125, 126, 128, 152, + 160, 176, 153, 0, 0, 171, 0, 175, 27, 26, + 30, 31, 0, 0, 28, 91, 164, 154, 155, 0, + 0, 0, 159, 153, 158, 147, 0, 180, 153, 106, + 0, 104, 0, 0, 161, 89, 186, 7, 8, 40, + 37, 89, 9, 0, 88, 121, 0, 0, 0, 0, + 0, 89, 122, 124, 123, 0, 0, 127, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 119, 118, 136, 137, 0, 0, 0, 0, 104, 0, + 173, 172, 29, 0, 0, 135, 0, 0, 0, 178, + 179, 177, 107, 89, 183, 0, 0, 148, 14, 0, + 0, 17, 0, 0, 90, 181, 0, 41, 34, 113, + 114, 111, 112, 0, 0, 115, 163, 133, 134, 130, + 131, 132, 129, 144, 145, 141, 142, 143, 140, 120, + 110, 162, 170, 97, 95, 0, 0, 92, 149, 150, + 108, 188, 0, 109, 105, 13, 10, 16, 11, 39, + 0, 57, 0, 0, 0, 89, 0, 0, 0, 78, + 79, 0, 100, 0, 89, 38, 51, 0, 60, 44, + 65, 37, 184, 89, 0, 20, 139, 89, 98, 0, + 138, 0, 100, 62, 0, 0, 0, 0, 66, 52, + 53, 54, 0, 101, 55, 182, 59, 0, 0, 89, + 185, 42, 116, 32, 99, 96, 0, 0, 165, 0, + 0, 0, 0, 174, 67, 0, 56, 0, 82, 80, + 43, 25, 89, 58, 63, 0, 167, 169, 64, 89, + 89, 0, 0, 89, 0, 83, 61, 0, 166, 168, + 0, 0, 0, 0, 0, 81, 0, 85, 68, 46, + 0, 89, 0, 89, 84, 89, 0, 89, 0, 89, + 66, 0, 70, 0, 0, 69, 0, 47, 48, 66, + 0, 86, 73, 76, 0, 0, 77, 0, 187, 89, + 45, 0, 89, 75, 74, 89, 37, 89, 0, 37, + 0, 0, 50, 0, 49 +}; + + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -273, -273, -273, -273, -273, -273, 208, -273, -273, -273, @@ -967,10 +834,21 @@ static const yytype_int16 yypgoto[] = -46, -273, -25, -57, 85 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -104 + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 1, 28, 140, 143, 29, 77, 53, 54, 30, + 31, 83, 32, 146, 78, 205, 206, 222, 207, 237, + 248, 255, 296, 305, 317, 208, 258, 276, 286, 209, + 144, 145, 125, 175, 176, 232, 116, 117, 210, 115, + 94, 95, 35, 36, 37, 38, 39, 40, 55, 264, + 265, 266, 45, 46, 47, 41, 42, 131, 211, 212, + 137, 239, 213, 319, 136 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 34, 80, 80, 70, 81, 126, 127, 260, 121, 238, @@ -1091,12 +969,6 @@ static const yytype_int16 yytable[] = 0, 90, 214, 0, 92, 93 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-273))) - -#define yytable_value_is_error(Yytable_value) \ - (!!((Yytable_value) == (-104))) - static const yytype_int16 yycheck[] = { 1, 29, 30, 26, 29, 59, 60, 238, 46, 211, @@ -1217,8 +1089,8 @@ static const yytype_int16 yycheck[] = -1, 53, 54, -1, 56, 57 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 76, 0, 1, 3, 4, 7, 8, 17, 18, @@ -1257,30 +1129,64 @@ static const yytype_uint8 yystos[] = 88, 106, 90, 88, 90 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 75, 76, 76, 76, 76, 76, 77, 77, 77, + 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, + 80, 80, 80, 80, 80, 81, 82, 82, 82, 82, + 83, 83, 84, 86, 85, 87, 87, 88, 88, 88, + 89, 89, 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 91, 91, 91, 91, 91, 92, 91, 91, + 94, 93, 95, 93, 93, 93, 96, 96, 97, 97, + 97, 98, 98, 99, 99, 99, 99, 99, 100, 100, + 101, 101, 102, 103, 102, 104, 104, 105, 105, 106, + 106, 107, 107, 108, 108, 109, 109, 109, 109, 109, + 110, 110, 111, 111, 112, 112, 112, 112, 112, 112, + 113, 113, 113, 113, 113, 113, 113, 113, 114, 114, + 114, 115, 115, 116, 116, 117, 117, 117, 118, 118, + 118, 118, 118, 118, 118, 118, 118, 118, 118, 119, + 119, 119, 119, 119, 119, 119, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 121, 121, 122, 123, 123, 124, 124, 125, 125, 126, + 127, 128, 128, 129, 130, 130, 131, 131, 132, 132, + 132, 133, 134, 135, 136, 136, 137, 138, 139 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, + 4, 4, 1, 2, 1, 1, 2, 1, 0, 1, + 4, 1, 1, 1, 1, 5, 1, 1, 1, 2, + 1, 1, 6, 0, 3, 1, 1, 0, 2, 2, + 1, 2, 2, 3, 1, 9, 6, 8, 8, 12, + 11, 1, 2, 2, 2, 2, 3, 0, 4, 2, + 0, 4, 0, 4, 4, 1, 0, 1, 0, 2, + 2, 5, 4, 1, 2, 2, 1, 1, 1, 1, + 1, 3, 0, 0, 3, 6, 9, 1, 2, 0, + 1, 0, 2, 0, 1, 1, 3, 1, 2, 3, + 0, 1, 0, 1, 1, 3, 1, 2, 3, 3, + 3, 3, 3, 3, 3, 3, 5, 1, 1, 1, + 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, + 3, 3, 3, 3, 3, 3, 2, 2, 5, 4, + 3, 3, 3, 3, 3, 3, 1, 2, 3, 4, + 4, 1, 1, 1, 2, 2, 1, 1, 2, 2, + 1, 2, 4, 0, 1, 0, 2, 1, 2, 1, + 3, 1, 2, 2, 1, 2, 1, 3, 1, 1, + 0, 2, 2, 1, 0, 1, 1, 1, 2 +}; + + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + #define YYRECOVERING() (!!yyerrstatus) @@ -1297,27 +1203,15 @@ do \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -1327,40 +1221,36 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { FILE *yyo = yyoutput; YYUSE (yyo); @@ -1369,14 +1259,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -1384,22 +1268,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); @@ -1410,16 +1283,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1430,49 +1295,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1486,7 +1344,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1509,15 +1367,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1533,16 +1384,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1572,27 +1415,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1615,11 +1458,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULL; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1627,10 +1470,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1680,7 +1519,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; @@ -1747,31 +1586,17 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif { YYUSE (yyvaluep); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1780,18 +1605,8 @@ yydestruct (yymsg, yytype, yyvaluep) /* The lookahead symbol. */ int yychar; - -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - +YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; @@ -1800,35 +1615,16 @@ int yynerrs; | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (void) -#else -int -yyparse () - -#endif -#endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -1896,23 +1692,23 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1920,22 +1716,22 @@ yyparse () # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1944,10 +1740,10 @@ yyparse () yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1976,7 +1772,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (); } if (yychar <= YYEOF) @@ -2041,7 +1837,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -2055,27 +1851,26 @@ yyreduce: switch (yyn) { case 3: -/* Line 1792 of yacc.c */ -#line 210 "awkgram.y" +#line 210 "awkgram.y" /* yacc.c:1646 */ { rule = 0; yyerrok; } +#line 1860 "awkgram.c" /* yacc.c:1646 */ break; case 5: -/* Line 1792 of yacc.c */ -#line 216 "awkgram.y" +#line 216 "awkgram.y" /* yacc.c:1646 */ { next_sourcefile(); if (sourcefile == srcfiles) process_deferred(); } +#line 1870 "awkgram.c" /* yacc.c:1646 */ break; case 6: -/* Line 1792 of yacc.c */ -#line 222 "awkgram.y" +#line 222 "awkgram.y" /* yacc.c:1646 */ { rule = 0; /* @@ -2084,306 +1879,312 @@ yyreduce: */ /* yyerrok; */ } +#line 1883 "awkgram.c" /* yacc.c:1646 */ break; case 7: -/* Line 1792 of yacc.c */ -#line 234 "awkgram.y" +#line 234 "awkgram.y" /* yacc.c:1646 */ { - (void) append_rule((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); + (void) append_rule((yyvsp[-1]), (yyvsp[0])); } +#line 1891 "awkgram.c" /* yacc.c:1646 */ break; case 8: -/* Line 1792 of yacc.c */ -#line 238 "awkgram.y" +#line 238 "awkgram.y" /* yacc.c:1646 */ { if (rule != Rule) { msg(_("%s blocks must have an action part"), ruletab[rule]); errcount++; - } else if ((yyvsp[(1) - (2)]) == NULL) { + } else if ((yyvsp[-1]) == NULL) { msg(_("each rule must have a pattern or an action part")); errcount++; } else /* pattern rule with non-empty pattern */ - (void) append_rule((yyvsp[(1) - (2)]), NULL); + (void) append_rule((yyvsp[-1]), NULL); } +#line 1906 "awkgram.c" /* yacc.c:1646 */ break; case 9: -/* Line 1792 of yacc.c */ -#line 249 "awkgram.y" +#line 249 "awkgram.y" /* yacc.c:1646 */ { in_function = NULL; - (void) mk_function((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); + (void) mk_function((yyvsp[-1]), (yyvsp[0])); yyerrok; } +#line 1916 "awkgram.c" /* yacc.c:1646 */ break; case 10: -/* Line 1792 of yacc.c */ -#line 255 "awkgram.y" +#line 255 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } +#line 1925 "awkgram.c" /* yacc.c:1646 */ break; case 11: -/* Line 1792 of yacc.c */ -#line 260 "awkgram.y" +#line 260 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } +#line 1934 "awkgram.c" /* yacc.c:1646 */ break; case 12: -/* Line 1792 of yacc.c */ -#line 268 "awkgram.y" +#line 268 "awkgram.y" /* yacc.c:1646 */ { - if (include_source((yyvsp[(1) - (1)])) < 0) + if (include_source((yyvsp[0])) < 0) YYABORT; - efree((yyvsp[(1) - (1)])->lextok); - bcfree((yyvsp[(1) - (1)])); + efree((yyvsp[0])->lextok); + bcfree((yyvsp[0])); (yyval) = NULL; } +#line 1946 "awkgram.c" /* yacc.c:1646 */ break; case 13: -/* Line 1792 of yacc.c */ -#line 276 "awkgram.y" +#line 276 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 1952 "awkgram.c" /* yacc.c:1646 */ break; case 14: -/* Line 1792 of yacc.c */ -#line 278 "awkgram.y" +#line 278 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 1958 "awkgram.c" /* yacc.c:1646 */ break; case 15: -/* Line 1792 of yacc.c */ -#line 283 "awkgram.y" +#line 283 "awkgram.y" /* yacc.c:1646 */ { - if (load_library((yyvsp[(1) - (1)])) < 0) + if (load_library((yyvsp[0])) < 0) YYABORT; - efree((yyvsp[(1) - (1)])->lextok); - bcfree((yyvsp[(1) - (1)])); + efree((yyvsp[0])->lextok); + bcfree((yyvsp[0])); (yyval) = NULL; } +#line 1970 "awkgram.c" /* yacc.c:1646 */ break; case 16: -/* Line 1792 of yacc.c */ -#line 291 "awkgram.y" +#line 291 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 1976 "awkgram.c" /* yacc.c:1646 */ break; case 17: -/* Line 1792 of yacc.c */ -#line 293 "awkgram.y" +#line 293 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 1982 "awkgram.c" /* yacc.c:1646 */ break; case 18: -/* Line 1792 of yacc.c */ -#line 298 "awkgram.y" +#line 298 "awkgram.y" /* yacc.c:1646 */ { rule = Rule; - if (comment != NULL){ + if (comment != NULL) { (yyval) = list_create(comment); comment = NULL; } else (yyval) = NULL; } +#line 1994 "awkgram.c" /* yacc.c:1646 */ break; case 19: -/* Line 1792 of yacc.c */ -#line 306 "awkgram.y" +#line 306 "awkgram.y" /* yacc.c:1646 */ { rule = Rule; - if (comment != NULL){ - (yyval) = list_prepend((yyvsp[(1) - (1)]), comment); + if (comment != NULL) { + (yyval) = list_prepend((yyvsp[0]), comment); comment = NULL; } else - (yyval) = (yyvsp[(1) - (1)]); + (yyval) = (yyvsp[0]); } +#line 2006 "awkgram.c" /* yacc.c:1646 */ break; case 20: -/* Line 1792 of yacc.c */ -#line 315 "awkgram.y" +#line 315 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *tp; - add_lint((yyvsp[(1) - (4)]), LINT_assign_in_cond); - add_lint((yyvsp[(4) - (4)]), LINT_assign_in_cond); + add_lint((yyvsp[-3]), LINT_assign_in_cond); + add_lint((yyvsp[0]), LINT_assign_in_cond); tp = instruction(Op_no_op); - list_prepend((yyvsp[(1) - (4)]), bcalloc(Op_line_range, !!do_pretty_print + 1, 0)); - (yyvsp[(1) - (4)])->nexti->triggered = false; - (yyvsp[(1) - (4)])->nexti->target_jmp = (yyvsp[(4) - (4)])->nexti; + list_prepend((yyvsp[-3]), bcalloc(Op_line_range, !!do_pretty_print + 1, 0)); + (yyvsp[-3])->nexti->triggered = false; + (yyvsp[-3])->nexti->target_jmp = (yyvsp[0])->nexti; - list_append((yyvsp[(1) - (4)]), instruction(Op_cond_pair)); - (yyvsp[(1) - (4)])->lasti->line_range = (yyvsp[(1) - (4)])->nexti; - (yyvsp[(1) - (4)])->lasti->target_jmp = tp; + list_append((yyvsp[-3]), instruction(Op_cond_pair)); + (yyvsp[-3])->lasti->line_range = (yyvsp[-3])->nexti; + (yyvsp[-3])->lasti->target_jmp = tp; - list_append((yyvsp[(4) - (4)]), instruction(Op_cond_pair)); - (yyvsp[(4) - (4)])->lasti->line_range = (yyvsp[(1) - (4)])->nexti; - (yyvsp[(4) - (4)])->lasti->target_jmp = tp; + list_append((yyvsp[0]), instruction(Op_cond_pair)); + (yyvsp[0])->lasti->line_range = (yyvsp[-3])->nexti; + (yyvsp[0])->lasti->target_jmp = tp; if (do_pretty_print) { - ((yyvsp[(1) - (4)])->nexti + 1)->condpair_left = (yyvsp[(1) - (4)])->lasti; - ((yyvsp[(1) - (4)])->nexti + 1)->condpair_right = (yyvsp[(4) - (4)])->lasti; + ((yyvsp[-3])->nexti + 1)->condpair_left = (yyvsp[-3])->lasti; + ((yyvsp[-3])->nexti + 1)->condpair_right = (yyvsp[0])->lasti; } - (yyval) = list_append(list_merge((yyvsp[(1) - (4)]), (yyvsp[(4) - (4)])), tp); + (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); rule = Rule; } +#line 2036 "awkgram.c" /* yacc.c:1646 */ break; case 21: -/* Line 1792 of yacc.c */ -#line 341 "awkgram.y" +#line 341 "awkgram.y" /* yacc.c:1646 */ { static int begin_seen = 0; - func_first = 0; + func_first = false; INSTRUCTION *ip; if (do_lint_old && ++begin_seen == 2) - warning_ln((yyvsp[(1) - (1)])->source_line, + warning_ln((yyvsp[0])->source_line, _("old awk does not support multiple `BEGIN' or `END' rules")); - (yyvsp[(1) - (1)])->in_rule = rule = BEGIN; - (yyvsp[(1) - (1)])->source_file = source; - (yyval) = (yyvsp[(1) - (1)]); + (yyvsp[0])->in_rule = rule = BEGIN; + (yyvsp[0])->source_file = source; + (yyval) = (yyvsp[0]); } +#line 2053 "awkgram.c" /* yacc.c:1646 */ break; case 22: -/* Line 1792 of yacc.c */ -#line 354 "awkgram.y" +#line 354 "awkgram.y" /* yacc.c:1646 */ { static int end_seen = 0; - func_first = 0; + func_first = false; if (do_lint_old && ++end_seen == 2) - warning_ln((yyvsp[(1) - (1)])->source_line, + warning_ln((yyvsp[0])->source_line, _("old awk does not support multiple `BEGIN' or `END' rules")); - (yyvsp[(1) - (1)])->in_rule = rule = END; - (yyvsp[(1) - (1)])->source_file = source; - (yyval) = (yyvsp[(1) - (1)]); + (yyvsp[0])->in_rule = rule = END; + (yyvsp[0])->source_file = source; + (yyval) = (yyvsp[0]); } +#line 2069 "awkgram.c" /* yacc.c:1646 */ break; case 23: -/* Line 1792 of yacc.c */ -#line 366 "awkgram.y" +#line 366 "awkgram.y" /* yacc.c:1646 */ { - func_first = 0; - (yyvsp[(1) - (1)])->in_rule = rule = BEGINFILE; - (yyvsp[(1) - (1)])->source_file = source; - (yyval) = (yyvsp[(1) - (1)]); + func_first = false; + (yyvsp[0])->in_rule = rule = BEGINFILE; + (yyvsp[0])->source_file = source; + (yyval) = (yyvsp[0]); } +#line 2080 "awkgram.c" /* yacc.c:1646 */ break; case 24: -/* Line 1792 of yacc.c */ -#line 373 "awkgram.y" +#line 373 "awkgram.y" /* yacc.c:1646 */ { - func_first = 0; - (yyvsp[(1) - (1)])->in_rule = rule = ENDFILE; - (yyvsp[(1) - (1)])->source_file = source; - (yyval) = (yyvsp[(1) - (1)]); + func_first = false; + (yyvsp[0])->in_rule = rule = ENDFILE; + (yyvsp[0])->source_file = source; + (yyval) = (yyvsp[0]); } +#line 2091 "awkgram.c" /* yacc.c:1646 */ break; case 25: -/* Line 1792 of yacc.c */ -#line 383 "awkgram.y" +#line 383 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; - if ((yyvsp[(2) - (5)]) == NULL) + if ((yyvsp[-3]) == NULL) ip = list_create(instruction(Op_no_op)); else - ip = (yyvsp[(2) - (5)]); + ip = (yyvsp[-3]); (yyval) = ip; } +#line 2104 "awkgram.c" /* yacc.c:1646 */ break; case 26: -/* Line 1792 of yacc.c */ -#line 395 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 395 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 2110 "awkgram.c" /* yacc.c:1646 */ break; case 27: -/* Line 1792 of yacc.c */ -#line 397 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 397 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 2116 "awkgram.c" /* yacc.c:1646 */ break; case 28: -/* Line 1792 of yacc.c */ -#line 399 "awkgram.y" +#line 399 "awkgram.y" /* yacc.c:1646 */ { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); YYABORT; } +#line 2126 "awkgram.c" /* yacc.c:1646 */ break; case 29: -/* Line 1792 of yacc.c */ -#line 405 "awkgram.y" - { (yyval) = (yyvsp[(2) - (2)]); } +#line 405 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 2132 "awkgram.c" /* yacc.c:1646 */ break; case 32: -/* Line 1792 of yacc.c */ -#line 415 "awkgram.y" +#line 415 "awkgram.y" /* yacc.c:1646 */ { -/* treat any comments between BOF and the first function definition (with no intervening BEGIN etc block) as program comments - Special kludge: iff there are more than one such comments, treat the last as a function comment. */ - if (comment != NULL && func_first && strstr(comment->memory->stptr, "\n\n") != NULL) + /* + * treat any comments between BOF and the first function + * definition (with no intervening BEGIN etc block) as + * program comments. Special kludge: iff there are more + * than one such comments, treat the last as a function + * comment. + */ + if (comment != NULL && func_first + && strstr(comment->memory->stptr, "\n\n") != NULL) split_comment(); - /* save any other pre-function comment as function comment */ - if (comment != NULL){ + /* save any other pre-function comment as function comment */ + if (comment != NULL) { commentf = comment; comment = NULL; } - func_first = 0; - (yyvsp[(1) - (6)])->source_file = source; - if (install_function((yyvsp[(2) - (6)])->lextok, (yyvsp[(1) - (6)]), (yyvsp[(4) - (6)])) < 0) + func_first = false; + (yyvsp[-5])->source_file = source; + if (install_function((yyvsp[-4])->lextok, (yyvsp[-5]), (yyvsp[-2])) < 0) YYABORT; - in_function = (yyvsp[(2) - (6)])->lextok; - (yyvsp[(2) - (6)])->lextok = NULL; - bcfree((yyvsp[(2) - (6)])); + in_function = (yyvsp[-4])->lextok; + (yyvsp[-4])->lextok = NULL; + bcfree((yyvsp[-4])); /* $4 already free'd in install_function */ - (yyval) = (yyvsp[(1) - (6)]); + (yyval) = (yyvsp[-5]); } +#line 2163 "awkgram.c" /* yacc.c:1646 */ break; case 33: -/* Line 1792 of yacc.c */ -#line 443 "awkgram.y" +#line 449 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } +#line 2169 "awkgram.c" /* yacc.c:1646 */ break; case 34: -/* Line 1792 of yacc.c */ -#line 445 "awkgram.y" +#line 451 "awkgram.y" /* yacc.c:1646 */ { NODE *n, *exp; char *re; size_t len; - re = (yyvsp[(3) - (3)])->lextok; - (yyvsp[(3) - (3)])->lextok = NULL; + re = (yyvsp[0])->lextok; + (yyvsp[0])->lextok = NULL; len = strlen(re); if (do_lint) { if (len == 0) - lintwarn_ln((yyvsp[(3) - (3)])->source_line, + lintwarn_ln((yyvsp[0])->source_line, _("regexp constant `//' looks like a C++ comment, but is not")); else if (re[0] == '*' && re[len-1] == '*') /* possible C comment */ - lintwarn_ln((yyvsp[(3) - (3)])->source_line, + lintwarn_ln((yyvsp[0])->source_line, _("regexp constant `/%s/' looks like a C comment, but is not"), re); } @@ -2393,93 +2194,93 @@ yyreduce: unref(exp); YYABORT; } - (yyval) = (yyvsp[(3) - (3)]); + (yyval) = (yyvsp[0]); (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } +#line 2202 "awkgram.c" /* yacc.c:1646 */ break; case 35: -/* Line 1792 of yacc.c */ -#line 477 "awkgram.y" - { bcfree((yyvsp[(1) - (1)])); } +#line 483 "awkgram.y" /* yacc.c:1646 */ + { bcfree((yyvsp[0])); } +#line 2208 "awkgram.c" /* yacc.c:1646 */ break; case 37: -/* Line 1792 of yacc.c */ -#line 483 "awkgram.y" +#line 489 "awkgram.y" /* yacc.c:1646 */ { - if (comment != NULL){ + if (comment != NULL) { (yyval) = list_create(comment); comment = NULL; } else (yyval) = NULL; } +#line 2219 "awkgram.c" /* yacc.c:1646 */ break; case 38: -/* Line 1792 of yacc.c */ -#line 490 "awkgram.y" +#line 496 "awkgram.y" /* yacc.c:1646 */ { - if ((yyvsp[(2) - (2)]) == NULL) { + if ((yyvsp[0]) == NULL) { if (comment == NULL) - (yyval) = (yyvsp[(1) - (2)]); + (yyval) = (yyvsp[-1]); else { - (yyval) = list_append((yyvsp[(1) - (2)]), comment); + (yyval) = list_append((yyvsp[-1]), comment); comment = NULL; } } else { - add_lint((yyvsp[(2) - (2)]), LINT_no_effect); - if ((yyvsp[(1) - (2)]) == NULL) { + add_lint((yyvsp[0]), LINT_no_effect); + if ((yyvsp[-1]) == NULL) { if (comment == NULL) - (yyval) = (yyvsp[(2) - (2)]); + (yyval) = (yyvsp[0]); else { - (yyval) = list_append((yyvsp[(2) - (2)]), comment); + (yyval) = list_append((yyvsp[0]), comment); comment = NULL; } } else { - if (comment != NULL){ - list_append((yyvsp[(2) - (2)]), comment); + if (comment != NULL) { + list_append((yyvsp[0]), comment); comment = NULL; } - (yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); + (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } } yyerrok; } +#line 2251 "awkgram.c" /* yacc.c:1646 */ break; case 39: -/* Line 1792 of yacc.c */ -#line 518 "awkgram.y" +#line 524 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 2257 "awkgram.c" /* yacc.c:1646 */ break; case 42: -/* Line 1792 of yacc.c */ -#line 528 "awkgram.y" +#line 534 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 2263 "awkgram.c" /* yacc.c:1646 */ break; case 43: -/* Line 1792 of yacc.c */ -#line 530 "awkgram.y" - { (yyval) = (yyvsp[(2) - (3)]); } +#line 536 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[-1]); } +#line 2269 "awkgram.c" /* yacc.c:1646 */ break; case 44: -/* Line 1792 of yacc.c */ -#line 532 "awkgram.y" +#line 538 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) - (yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_exec_count)); + (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else - (yyval) = (yyvsp[(1) - (1)]); + (yyval) = (yyvsp[0]); } +#line 2280 "awkgram.c" /* yacc.c:1646 */ break; case 45: -/* Line 1792 of yacc.c */ -#line 539 "awkgram.y" +#line 545 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2494,9 +2295,9 @@ yyreduce: dflt = instruction(Op_jmp); dflt->target_jmp = tbreak; /* if no case match and no explicit default */ - if ((yyvsp[(7) - (9)]) != NULL) { - curr = (yyvsp[(7) - (9)])->nexti; - bcfree((yyvsp[(7) - (9)])); /* Op_list */ + if ((yyvsp[-2]) != NULL) { + curr = (yyvsp[-2])->nexti; + bcfree((yyvsp[-2])); /* Op_list */ } /* else curr = NULL; */ @@ -2552,13 +2353,13 @@ yyreduce: if (case_values != NULL) efree(case_values); - ip = (yyvsp[(3) - (9)]); + ip = (yyvsp[-6]); if (do_pretty_print) { - (void) list_prepend(ip, (yyvsp[(1) - (9)])); + (void) list_prepend(ip, (yyvsp[-8])); (void) list_prepend(ip, instruction(Op_exec_count)); - (yyvsp[(1) - (9)])->target_break = tbreak; - ((yyvsp[(1) - (9)]) + 1)->switch_start = cexp->nexti; - ((yyvsp[(1) - (9)]) + 1)->switch_end = cexp->lasti; + (yyvsp[-8])->target_break = tbreak; + ((yyvsp[-8]) + 1)->switch_start = cexp->nexti; + ((yyvsp[-8]) + 1)->switch_end = cexp->lasti; }/* else $1 is NULL */ @@ -2569,11 +2370,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } +#line 2374 "awkgram.c" /* yacc.c:1646 */ break; case 46: -/* Line 1792 of yacc.c */ -#line 629 "awkgram.y" +#line 635 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2591,22 +2392,22 @@ yyreduce: INSTRUCTION *ip, *tbreak, *tcont; tbreak = instruction(Op_no_op); - add_lint((yyvsp[(3) - (6)]), LINT_assign_in_cond); - tcont = (yyvsp[(3) - (6)])->nexti; - ip = list_append((yyvsp[(3) - (6)]), instruction(Op_jmp_false)); + add_lint((yyvsp[-3]), LINT_assign_in_cond); + tcont = (yyvsp[-3])->nexti; + ip = list_append((yyvsp[-3]), instruction(Op_jmp_false)); ip->lasti->target_jmp = tbreak; if (do_pretty_print) { (void) list_append(ip, instruction(Op_exec_count)); - (yyvsp[(1) - (6)])->target_break = tbreak; - (yyvsp[(1) - (6)])->target_continue = tcont; - ((yyvsp[(1) - (6)]) + 1)->while_body = ip->lasti; - (void) list_prepend(ip, (yyvsp[(1) - (6)])); + (yyvsp[-5])->target_break = tbreak; + (yyvsp[-5])->target_continue = tcont; + ((yyvsp[-5]) + 1)->while_body = ip->lasti; + (void) list_prepend(ip, (yyvsp[-5])); }/* else $1 is NULL */ - if ((yyvsp[(6) - (6)]) != NULL) - (void) list_merge(ip, (yyvsp[(6) - (6)])); + if ((yyvsp[0]) != NULL) + (void) list_merge(ip, (yyvsp[0])); (void) list_append(ip, instruction(Op_jmp)); ip->lasti->target_jmp = tcont; (yyval) = list_append(ip, tbreak); @@ -2615,11 +2416,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } +#line 2420 "awkgram.c" /* yacc.c:1646 */ break; case 47: -/* Line 1792 of yacc.c */ -#line 671 "awkgram.y" +#line 677 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2636,12 +2437,12 @@ yyreduce: INSTRUCTION *ip, *tbreak, *tcont; tbreak = instruction(Op_no_op); - tcont = (yyvsp[(6) - (8)])->nexti; - add_lint((yyvsp[(6) - (8)]), LINT_assign_in_cond); - if ((yyvsp[(3) - (8)]) != NULL) - ip = list_merge((yyvsp[(3) - (8)]), (yyvsp[(6) - (8)])); + tcont = (yyvsp[-2])->nexti; + add_lint((yyvsp[-2]), LINT_assign_in_cond); + if ((yyvsp[-5]) != NULL) + ip = list_merge((yyvsp[-5]), (yyvsp[-2])); else - ip = list_prepend((yyvsp[(6) - (8)]), instruction(Op_no_op)); + ip = list_prepend((yyvsp[-2]), instruction(Op_no_op)); if (do_pretty_print) (void) list_prepend(ip, instruction(Op_exec_count)); (void) list_append(ip, instruction(Op_jmp_true)); @@ -2653,29 +2454,29 @@ yyreduce: fix_break_continue(ip, tbreak, tcont); if (do_pretty_print) { - (yyvsp[(1) - (8)])->target_break = tbreak; - (yyvsp[(1) - (8)])->target_continue = tcont; - ((yyvsp[(1) - (8)]) + 1)->doloop_cond = tcont; - (yyval) = list_prepend(ip, (yyvsp[(1) - (8)])); - bcfree((yyvsp[(4) - (8)])); + (yyvsp[-7])->target_break = tbreak; + (yyvsp[-7])->target_continue = tcont; + ((yyvsp[-7]) + 1)->doloop_cond = tcont; + (yyval) = list_prepend(ip, (yyvsp[-7])); + bcfree((yyvsp[-4])); } /* else $1 and $4 are NULLs */ } +#line 2466 "awkgram.c" /* yacc.c:1646 */ break; case 48: -/* Line 1792 of yacc.c */ -#line 713 "awkgram.y" +#line 719 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; - char *var_name = (yyvsp[(3) - (8)])->lextok; - - if ((yyvsp[(8) - (8)]) != NULL - && (yyvsp[(8) - (8)])->lasti->opcode == Op_K_delete - && (yyvsp[(8) - (8)])->lasti->expr_count == 1 - && (yyvsp[(8) - (8)])->nexti->opcode == Op_push - && ((yyvsp[(8) - (8)])->nexti->memory->type != Node_var || !((yyvsp[(8) - (8)])->nexti->memory->var_update)) - && strcmp((yyvsp[(8) - (8)])->nexti->memory->vname, var_name) == 0 + char *var_name = (yyvsp[-5])->lextok; + + if ((yyvsp[0]) != NULL + && (yyvsp[0])->lasti->opcode == Op_K_delete + && (yyvsp[0])->lasti->expr_count == 1 + && (yyvsp[0])->nexti->opcode == Op_push + && ((yyvsp[0])->nexti->memory->type != Node_var || !((yyvsp[0])->nexti->memory->var_update)) + && strcmp((yyvsp[0])->nexti->memory->vname, var_name) == 0 ) { /* Efficiency hack. Recognize the special case of @@ -2692,25 +2493,25 @@ yyreduce: */ NODE *arr = NULL; - ip = (yyvsp[(8) - (8)])->nexti->nexti; - if ((yyvsp[(5) - (8)])->nexti->opcode == Op_push && (yyvsp[(5) - (8)])->lasti == (yyvsp[(5) - (8)])->nexti) - arr = (yyvsp[(5) - (8)])->nexti->memory; + ip = (yyvsp[0])->nexti->nexti; + if ((yyvsp[-3])->nexti->opcode == Op_push && (yyvsp[-3])->lasti == (yyvsp[-3])->nexti) + arr = (yyvsp[-3])->nexti->memory; if (arr != NULL && ip->opcode == Op_no_op && ip->nexti->opcode == Op_push_array && strcmp(ip->nexti->memory->vname, arr->vname) == 0 - && ip->nexti->nexti == (yyvsp[(8) - (8)])->lasti + && ip->nexti->nexti == (yyvsp[0])->lasti ) { - (void) make_assignable((yyvsp[(8) - (8)])->nexti); - (yyvsp[(8) - (8)])->lasti->opcode = Op_K_delete_loop; - (yyvsp[(8) - (8)])->lasti->expr_count = 0; - if ((yyvsp[(1) - (8)]) != NULL) - bcfree((yyvsp[(1) - (8)])); + (void) make_assignable((yyvsp[0])->nexti); + (yyvsp[0])->lasti->opcode = Op_K_delete_loop; + (yyvsp[0])->lasti->expr_count = 0; + if ((yyvsp[-7]) != NULL) + bcfree((yyvsp[-7])); efree(var_name); - bcfree((yyvsp[(3) - (8)])); - bcfree((yyvsp[(4) - (8)])); - bcfree((yyvsp[(5) - (8)])); - (yyval) = (yyvsp[(8) - (8)]); + bcfree((yyvsp[-5])); + bcfree((yyvsp[-4])); + bcfree((yyvsp[-3])); + (yyval) = (yyvsp[0]); } else goto regular_loop; } else { @@ -2727,50 +2528,50 @@ yyreduce: * ib:[Op_arrayfor_final ] */ regular_loop: - ip = (yyvsp[(5) - (8)]); + ip = (yyvsp[-3]); ip->nexti->opcode = Op_push_array; tbreak = instruction(Op_arrayfor_final); - (yyvsp[(4) - (8)])->opcode = Op_arrayfor_incr; - (yyvsp[(4) - (8)])->array_var = variable((yyvsp[(3) - (8)])->source_line, var_name, Node_var); - (yyvsp[(4) - (8)])->target_jmp = tbreak; - tcont = (yyvsp[(4) - (8)]); - (yyvsp[(3) - (8)])->opcode = Op_arrayfor_init; - (yyvsp[(3) - (8)])->target_jmp = tbreak; - (void) list_append(ip, (yyvsp[(3) - (8)])); + (yyvsp[-4])->opcode = Op_arrayfor_incr; + (yyvsp[-4])->array_var = variable((yyvsp[-5])->source_line, var_name, Node_var); + (yyvsp[-4])->target_jmp = tbreak; + tcont = (yyvsp[-4]); + (yyvsp[-5])->opcode = Op_arrayfor_init; + (yyvsp[-5])->target_jmp = tbreak; + (void) list_append(ip, (yyvsp[-5])); if (do_pretty_print) { - (yyvsp[(1) - (8)])->opcode = Op_K_arrayfor; - (yyvsp[(1) - (8)])->target_continue = tcont; - (yyvsp[(1) - (8)])->target_break = tbreak; - (void) list_append(ip, (yyvsp[(1) - (8)])); + (yyvsp[-7])->opcode = Op_K_arrayfor; + (yyvsp[-7])->target_continue = tcont; + (yyvsp[-7])->target_break = tbreak; + (void) list_append(ip, (yyvsp[-7])); } /* else $1 is NULL */ /* add update_FOO instruction if necessary */ - if ((yyvsp[(4) - (8)])->array_var->type == Node_var && (yyvsp[(4) - (8)])->array_var->var_update) { + if ((yyvsp[-4])->array_var->type == Node_var && (yyvsp[-4])->array_var->var_update) { (void) list_append(ip, instruction(Op_var_update)); - ip->lasti->update_var = (yyvsp[(4) - (8)])->array_var->var_update; + ip->lasti->update_var = (yyvsp[-4])->array_var->var_update; } - (void) list_append(ip, (yyvsp[(4) - (8)])); + (void) list_append(ip, (yyvsp[-4])); /* add set_FOO instruction if necessary */ - if ((yyvsp[(4) - (8)])->array_var->type == Node_var && (yyvsp[(4) - (8)])->array_var->var_assign) { + if ((yyvsp[-4])->array_var->type == Node_var && (yyvsp[-4])->array_var->var_assign) { (void) list_append(ip, instruction(Op_var_assign)); - ip->lasti->assign_var = (yyvsp[(4) - (8)])->array_var->var_assign; + ip->lasti->assign_var = (yyvsp[-4])->array_var->var_assign; } if (do_pretty_print) { (void) list_append(ip, instruction(Op_exec_count)); - ((yyvsp[(1) - (8)]) + 1)->forloop_cond = (yyvsp[(4) - (8)]); - ((yyvsp[(1) - (8)]) + 1)->forloop_body = ip->lasti; + ((yyvsp[-7]) + 1)->forloop_cond = (yyvsp[-4]); + ((yyvsp[-7]) + 1)->forloop_body = ip->lasti; } - if ((yyvsp[(8) - (8)]) != NULL) - (void) list_merge(ip, (yyvsp[(8) - (8)])); + if ((yyvsp[0]) != NULL) + (void) list_merge(ip, (yyvsp[0])); (void) list_append(ip, instruction(Op_jmp)); - ip->lasti->target_jmp = (yyvsp[(4) - (8)]); + ip->lasti->target_jmp = (yyvsp[-4]); (yyval) = list_append(ip, tbreak); fix_break_continue(ip, tbreak, tcont); } @@ -2778,157 +2579,157 @@ regular_loop: break_allowed--; continue_allowed--; } +#line 2583 "awkgram.c" /* yacc.c:1646 */ break; case 49: -/* Line 1792 of yacc.c */ -#line 826 "awkgram.y" +#line 832 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = mk_for_loop((yyvsp[(1) - (12)]), (yyvsp[(3) - (12)]), (yyvsp[(6) - (12)]), (yyvsp[(9) - (12)]), (yyvsp[(12) - (12)])); + (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } +#line 2594 "awkgram.c" /* yacc.c:1646 */ break; case 50: -/* Line 1792 of yacc.c */ -#line 833 "awkgram.y" +#line 839 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = mk_for_loop((yyvsp[(1) - (11)]), (yyvsp[(3) - (11)]), (INSTRUCTION *) NULL, (yyvsp[(8) - (11)]), (yyvsp[(11) - (11)])); + (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } +#line 2605 "awkgram.c" /* yacc.c:1646 */ break; case 51: -/* Line 1792 of yacc.c */ -#line 840 "awkgram.y" +#line 846 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) - (yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_exec_count)); + (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else - (yyval) = (yyvsp[(1) - (1)]); + (yyval) = (yyvsp[0]); } +#line 2616 "awkgram.c" /* yacc.c:1646 */ break; case 52: -/* Line 1792 of yacc.c */ -#line 850 "awkgram.y" +#line 856 "awkgram.y" /* yacc.c:1646 */ { if (! break_allowed) - error_ln((yyvsp[(1) - (2)])->source_line, + error_ln((yyvsp[-1])->source_line, _("`break' is not allowed outside a loop or switch")); - (yyvsp[(1) - (2)])->target_jmp = NULL; - (yyval) = list_create((yyvsp[(1) - (2)])); + (yyvsp[-1])->target_jmp = NULL; + (yyval) = list_create((yyvsp[-1])); } +#line 2629 "awkgram.c" /* yacc.c:1646 */ break; case 53: -/* Line 1792 of yacc.c */ -#line 859 "awkgram.y" +#line 865 "awkgram.y" /* yacc.c:1646 */ { if (! continue_allowed) - error_ln((yyvsp[(1) - (2)])->source_line, + error_ln((yyvsp[-1])->source_line, _("`continue' is not allowed outside a loop")); - (yyvsp[(1) - (2)])->target_jmp = NULL; - (yyval) = list_create((yyvsp[(1) - (2)])); + (yyvsp[-1])->target_jmp = NULL; + (yyval) = list_create((yyvsp[-1])); } +#line 2642 "awkgram.c" /* yacc.c:1646 */ break; case 54: -/* Line 1792 of yacc.c */ -#line 868 "awkgram.y" +#line 874 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) - error_ln((yyvsp[(1) - (2)])->source_line, + error_ln((yyvsp[-1])->source_line, _("`next' used in %s action"), ruletab[rule]); - (yyvsp[(1) - (2)])->target_jmp = ip_rec; - (yyval) = list_create((yyvsp[(1) - (2)])); + (yyvsp[-1])->target_jmp = ip_rec; + (yyval) = list_create((yyvsp[-1])); } +#line 2655 "awkgram.c" /* yacc.c:1646 */ break; case 55: -/* Line 1792 of yacc.c */ -#line 877 "awkgram.y" +#line 883 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) - error_ln((yyvsp[(1) - (2)])->source_line, + error_ln((yyvsp[-1])->source_line, _("`nextfile' used in %s action"), ruletab[rule]); - (yyvsp[(1) - (2)])->target_newfile = ip_newfile; - (yyvsp[(1) - (2)])->target_endfile = ip_endfile; - (yyval) = list_create((yyvsp[(1) - (2)])); + (yyvsp[-1])->target_newfile = ip_newfile; + (yyvsp[-1])->target_endfile = ip_endfile; + (yyval) = list_create((yyvsp[-1])); } +#line 2670 "awkgram.c" /* yacc.c:1646 */ break; case 56: -/* Line 1792 of yacc.c */ -#line 888 "awkgram.y" +#line 894 "awkgram.y" /* yacc.c:1646 */ { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. */ - (yyvsp[(1) - (3)])->target_end = ip_end; /* first instruction in end_block */ - (yyvsp[(1) - (3)])->target_atexit = ip_atexit; /* cleanup and go home */ + (yyvsp[-2])->target_end = ip_end; /* first instruction in end_block */ + (yyvsp[-2])->target_atexit = ip_atexit; /* cleanup and go home */ - if ((yyvsp[(2) - (3)]) == NULL) { - (yyval) = list_create((yyvsp[(1) - (3)])); + if ((yyvsp[-1]) == NULL) { + (yyval) = list_create((yyvsp[-2])); (void) list_prepend((yyval), instruction(Op_push_i)); (yyval)->nexti->memory = dupnode(Nnull_string); } else - (yyval) = list_append((yyvsp[(2) - (3)]), (yyvsp[(1) - (3)])); + (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); } +#line 2689 "awkgram.c" /* yacc.c:1646 */ break; case 57: -/* Line 1792 of yacc.c */ -#line 903 "awkgram.y" +#line 909 "awkgram.y" /* yacc.c:1646 */ { if (! in_function) yyerror(_("`return' used outside function context")); } +#line 2698 "awkgram.c" /* yacc.c:1646 */ break; case 58: -/* Line 1792 of yacc.c */ -#line 906 "awkgram.y" +#line 912 "awkgram.y" /* yacc.c:1646 */ { - if ((yyvsp[(3) - (4)]) == NULL) { - (yyval) = list_create((yyvsp[(1) - (4)])); + if ((yyvsp[-1]) == NULL) { + (yyval) = list_create((yyvsp[-3])); (void) list_prepend((yyval), instruction(Op_push_i)); (yyval)->nexti->memory = dupnode(Nnull_string); } else { if (do_optimize - && (yyvsp[(3) - (4)])->lasti->opcode == Op_func_call - && strcmp((yyvsp[(3) - (4)])->lasti->func_name, in_function) == 0 + && (yyvsp[-1])->lasti->opcode == Op_func_call + && strcmp((yyvsp[-1])->lasti->func_name, in_function) == 0 ) { /* Do tail recursion optimization. Tail * call without a return value is recognized * in mk_function(). */ - ((yyvsp[(3) - (4)])->lasti + 1)->tail_call = true; + ((yyvsp[-1])->lasti + 1)->tail_call = true; } - (yyval) = list_append((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)])); + (yyval) = list_append((yyvsp[-1]), (yyvsp[-3])); } } +#line 2723 "awkgram.c" /* yacc.c:1646 */ break; case 60: -/* Line 1792 of yacc.c */ -#line 938 "awkgram.y" +#line 944 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } +#line 2729 "awkgram.c" /* yacc.c:1646 */ break; case 61: -/* Line 1792 of yacc.c */ -#line 939 "awkgram.y" +#line 945 "awkgram.y" /* yacc.c:1646 */ { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2936,12 +2737,12 @@ regular_loop: * which is faster for these two cases. */ - if ((yyvsp[(1) - (4)])->opcode == Op_K_print && - ((yyvsp[(3) - (4)]) == NULL - || ((yyvsp[(3) - (4)])->lasti->opcode == Op_field_spec - && (yyvsp[(3) - (4)])->nexti->nexti->nexti == (yyvsp[(3) - (4)])->lasti - && (yyvsp[(3) - (4)])->nexti->nexti->opcode == Op_push_i - && (yyvsp[(3) - (4)])->nexti->nexti->memory->type == Node_val) + if ((yyvsp[-3])->opcode == Op_K_print && + ((yyvsp[-1]) == NULL + || ((yyvsp[-1])->lasti->opcode == Op_field_spec + && (yyvsp[-1])->nexti->nexti->nexti == (yyvsp[-1])->lasti + && (yyvsp[-1])->nexti->nexti->opcode == Op_push_i + && (yyvsp[-1])->nexti->nexti->memory->type == Node_val) ) ) { static bool warned = false; @@ -2954,37 +2755,37 @@ regular_loop: * [Op_K_print_rec | NULL | redir_type | expr_count] */ - if ((yyvsp[(3) - (4)]) != NULL) { - NODE *n = (yyvsp[(3) - (4)])->nexti->nexti->memory; + if ((yyvsp[-1]) != NULL) { + NODE *n = (yyvsp[-1])->nexti->nexti->memory; if (! iszero(n)) goto regular_print; - bcfree((yyvsp[(3) - (4)])->lasti); /* Op_field_spec */ + bcfree((yyvsp[-1])->lasti); /* Op_field_spec */ unref(n); /* Node_val */ - bcfree((yyvsp[(3) - (4)])->nexti->nexti); /* Op_push_i */ - bcfree((yyvsp[(3) - (4)])->nexti); /* Op_list */ - bcfree((yyvsp[(3) - (4)])); /* Op_list */ + bcfree((yyvsp[-1])->nexti->nexti); /* Op_push_i */ + bcfree((yyvsp[-1])->nexti); /* Op_list */ + bcfree((yyvsp[-1])); /* Op_list */ } else { if (do_lint && (rule == BEGIN || rule == END) && ! warned) { warned = true; - lintwarn_ln((yyvsp[(1) - (4)])->source_line, + lintwarn_ln((yyvsp[-3])->source_line, _("plain `print' in BEGIN or END rule should probably be `print \"\"'")); } } - (yyvsp[(1) - (4)])->expr_count = 0; - (yyvsp[(1) - (4)])->opcode = Op_K_print_rec; - if ((yyvsp[(4) - (4)]) == NULL) { /* no redircetion */ - (yyvsp[(1) - (4)])->redir_type = redirect_none; - (yyval) = list_create((yyvsp[(1) - (4)])); + (yyvsp[-3])->expr_count = 0; + (yyvsp[-3])->opcode = Op_K_print_rec; + if ((yyvsp[0]) == NULL) { /* no redircetion */ + (yyvsp[-3])->redir_type = redirect_none; + (yyval) = list_create((yyvsp[-3])); } else { INSTRUCTION *ip; - ip = (yyvsp[(4) - (4)])->nexti; - (yyvsp[(1) - (4)])->redir_type = ip->redir_type; - (yyvsp[(4) - (4)])->nexti = ip->nexti; + ip = (yyvsp[0])->nexti; + (yyvsp[-3])->redir_type = ip->redir_type; + (yyvsp[0])->nexti = ip->nexti; bcfree(ip); - (yyval) = list_append((yyvsp[(4) - (4)]), (yyvsp[(1) - (4)])); + (yyval) = list_append((yyvsp[0]), (yyvsp[-3])); } } else { /* ----------------- @@ -2997,59 +2798,59 @@ regular_loop: * */ regular_print: - if ((yyvsp[(4) - (4)]) == NULL) { /* no redirection */ - if ((yyvsp[(3) - (4)]) == NULL) { /* printf without arg */ - (yyvsp[(1) - (4)])->expr_count = 0; - (yyvsp[(1) - (4)])->redir_type = redirect_none; - (yyval) = list_create((yyvsp[(1) - (4)])); + if ((yyvsp[0]) == NULL) { /* no redirection */ + if ((yyvsp[-1]) == NULL) { /* printf without arg */ + (yyvsp[-3])->expr_count = 0; + (yyvsp[-3])->redir_type = redirect_none; + (yyval) = list_create((yyvsp[-3])); } else { - INSTRUCTION *t = (yyvsp[(3) - (4)]); - (yyvsp[(1) - (4)])->expr_count = count_expressions(&t, false); - (yyvsp[(1) - (4)])->redir_type = redirect_none; - (yyval) = list_append(t, (yyvsp[(1) - (4)])); + INSTRUCTION *t = (yyvsp[-1]); + (yyvsp[-3])->expr_count = count_expressions(&t, false); + (yyvsp[-3])->redir_type = redirect_none; + (yyval) = list_append(t, (yyvsp[-3])); } } else { INSTRUCTION *ip; - ip = (yyvsp[(4) - (4)])->nexti; - (yyvsp[(1) - (4)])->redir_type = ip->redir_type; - (yyvsp[(4) - (4)])->nexti = ip->nexti; + ip = (yyvsp[0])->nexti; + (yyvsp[-3])->redir_type = ip->redir_type; + (yyvsp[0])->nexti = ip->nexti; bcfree(ip); - if ((yyvsp[(3) - (4)]) == NULL) { - (yyvsp[(1) - (4)])->expr_count = 0; - (yyval) = list_append((yyvsp[(4) - (4)]), (yyvsp[(1) - (4)])); + if ((yyvsp[-1]) == NULL) { + (yyvsp[-3])->expr_count = 0; + (yyval) = list_append((yyvsp[0]), (yyvsp[-3])); } else { - INSTRUCTION *t = (yyvsp[(3) - (4)]); - (yyvsp[(1) - (4)])->expr_count = count_expressions(&t, false); - (yyval) = list_append(list_merge((yyvsp[(4) - (4)]), t), (yyvsp[(1) - (4)])); + INSTRUCTION *t = (yyvsp[-1]); + (yyvsp[-3])->expr_count = count_expressions(&t, false); + (yyval) = list_append(list_merge((yyvsp[0]), t), (yyvsp[-3])); } } } } +#line 2830 "awkgram.c" /* yacc.c:1646 */ break; case 62: -/* Line 1792 of yacc.c */ -#line 1036 "awkgram.y" +#line 1042 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } +#line 2836 "awkgram.c" /* yacc.c:1646 */ break; case 63: -/* Line 1792 of yacc.c */ -#line 1037 "awkgram.y" +#line 1043 "awkgram.y" /* yacc.c:1646 */ { - char *arr = (yyvsp[(2) - (4)])->lextok; + char *arr = (yyvsp[-2])->lextok; - (yyvsp[(2) - (4)])->opcode = Op_push_array; - (yyvsp[(2) - (4)])->memory = variable((yyvsp[(2) - (4)])->source_line, arr, Node_var_new); + (yyvsp[-2])->opcode = Op_push_array; + (yyvsp[-2])->memory = variable((yyvsp[-2])->source_line, arr, Node_var_new); if (! do_posix && ! do_traditional) { - if ((yyvsp[(2) - (4)])->memory == symbol_table) + if ((yyvsp[-2])->memory == symbol_table) fatal(_("`delete' is not allowed with SYMTAB")); - else if ((yyvsp[(2) - (4)])->memory == func_table) + else if ((yyvsp[-2])->memory == func_table) fatal(_("`delete' is not allowed with FUNCTAB")); } - if ((yyvsp[(4) - (4)]) == NULL) { + if ((yyvsp[0]) == NULL) { /* * As of September 2012, POSIX has added support * for `delete array'. See: @@ -3061,525 +2862,525 @@ regular_print: * Also, since BWK awk supports it, we don't have to * check do_traditional either. */ - (yyvsp[(1) - (4)])->expr_count = 0; - (yyval) = list_append(list_create((yyvsp[(2) - (4)])), (yyvsp[(1) - (4)])); + (yyvsp[-3])->expr_count = 0; + (yyval) = list_append(list_create((yyvsp[-2])), (yyvsp[-3])); } else { - (yyvsp[(1) - (4)])->expr_count = sub_counter; - (yyval) = list_append(list_append((yyvsp[(4) - (4)]), (yyvsp[(2) - (4)])), (yyvsp[(1) - (4)])); + (yyvsp[-3])->expr_count = sub_counter; + (yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3])); } } +#line 2873 "awkgram.c" /* yacc.c:1646 */ break; case 64: -/* Line 1792 of yacc.c */ -#line 1074 "awkgram.y" +#line 1080 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; - char *arr = (yyvsp[(3) - (4)])->lextok; + char *arr = (yyvsp[-1])->lextok; if (do_lint && ! warned) { warned = true; - lintwarn_ln((yyvsp[(1) - (4)])->source_line, + lintwarn_ln((yyvsp[-3])->source_line, _("`delete(array)' is a non-portable tawk extension")); } if (do_traditional) { - error_ln((yyvsp[(1) - (4)])->source_line, + error_ln((yyvsp[-3])->source_line, _("`delete(array)' is a non-portable tawk extension")); } - (yyvsp[(3) - (4)])->memory = variable((yyvsp[(3) - (4)])->source_line, arr, Node_var_new); - (yyvsp[(3) - (4)])->opcode = Op_push_array; - (yyvsp[(1) - (4)])->expr_count = 0; - (yyval) = list_append(list_create((yyvsp[(3) - (4)])), (yyvsp[(1) - (4)])); + (yyvsp[-1])->memory = variable((yyvsp[-1])->source_line, arr, Node_var_new); + (yyvsp[-1])->opcode = Op_push_array; + (yyvsp[-3])->expr_count = 0; + (yyval) = list_append(list_create((yyvsp[-1])), (yyvsp[-3])); if (! do_posix && ! do_traditional) { - if ((yyvsp[(3) - (4)])->memory == symbol_table) + if ((yyvsp[-1])->memory == symbol_table) fatal(_("`delete' is not allowed with SYMTAB")); - else if ((yyvsp[(3) - (4)])->memory == func_table) + else if ((yyvsp[-1])->memory == func_table) fatal(_("`delete' is not allowed with FUNCTAB")); } } +#line 2903 "awkgram.c" /* yacc.c:1646 */ break; case 65: -/* Line 1792 of yacc.c */ -#line 1100 "awkgram.y" - { (yyval) = optimize_assignment((yyvsp[(1) - (1)])); } +#line 1106 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = optimize_assignment((yyvsp[0])); } +#line 2909 "awkgram.c" /* yacc.c:1646 */ break; case 66: -/* Line 1792 of yacc.c */ -#line 1105 "awkgram.y" +#line 1111 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 2915 "awkgram.c" /* yacc.c:1646 */ break; case 67: -/* Line 1792 of yacc.c */ -#line 1107 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1113 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 2921 "awkgram.c" /* yacc.c:1646 */ break; case 68: -/* Line 1792 of yacc.c */ -#line 1112 "awkgram.y" +#line 1118 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 2927 "awkgram.c" /* yacc.c:1646 */ break; case 69: -/* Line 1792 of yacc.c */ -#line 1114 "awkgram.y" +#line 1120 "awkgram.y" /* yacc.c:1646 */ { - if ((yyvsp[(1) - (2)]) == NULL) - (yyval) = list_create((yyvsp[(2) - (2)])); + if ((yyvsp[-1]) == NULL) + (yyval) = list_create((yyvsp[0])); else - (yyval) = list_prepend((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); + (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } +#line 2938 "awkgram.c" /* yacc.c:1646 */ break; case 70: -/* Line 1792 of yacc.c */ -#line 1121 "awkgram.y" +#line 1127 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 2944 "awkgram.c" /* yacc.c:1646 */ break; case 71: -/* Line 1792 of yacc.c */ -#line 1126 "awkgram.y" +#line 1132 "awkgram.y" /* yacc.c:1646 */ { - INSTRUCTION *casestmt = (yyvsp[(5) - (5)]); - if ((yyvsp[(5) - (5)]) == NULL) + INSTRUCTION *casestmt = (yyvsp[0]); + if ((yyvsp[0]) == NULL) casestmt = list_create(instruction(Op_no_op)); if (do_pretty_print) (void) list_prepend(casestmt, instruction(Op_exec_count)); - (yyvsp[(1) - (5)])->case_exp = (yyvsp[(2) - (5)]); - (yyvsp[(1) - (5)])->case_stmt = casestmt; - bcfree((yyvsp[(3) - (5)])); - (yyval) = (yyvsp[(1) - (5)]); + (yyvsp[-4])->case_exp = (yyvsp[-3]); + (yyvsp[-4])->case_stmt = casestmt; + bcfree((yyvsp[-2])); + (yyval) = (yyvsp[-4]); } +#line 2960 "awkgram.c" /* yacc.c:1646 */ break; case 72: -/* Line 1792 of yacc.c */ -#line 1138 "awkgram.y" +#line 1144 "awkgram.y" /* yacc.c:1646 */ { - INSTRUCTION *casestmt = (yyvsp[(4) - (4)]); - if ((yyvsp[(4) - (4)]) == NULL) + INSTRUCTION *casestmt = (yyvsp[0]); + if ((yyvsp[0]) == NULL) casestmt = list_create(instruction(Op_no_op)); if (do_pretty_print) (void) list_prepend(casestmt, instruction(Op_exec_count)); - bcfree((yyvsp[(2) - (4)])); - (yyvsp[(1) - (4)])->case_stmt = casestmt; - (yyval) = (yyvsp[(1) - (4)]); + bcfree((yyvsp[-2])); + (yyvsp[-3])->case_stmt = casestmt; + (yyval) = (yyvsp[-3]); } +#line 2975 "awkgram.c" /* yacc.c:1646 */ break; case 73: -/* Line 1792 of yacc.c */ -#line 1152 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1158 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 2981 "awkgram.c" /* yacc.c:1646 */ break; case 74: -/* Line 1792 of yacc.c */ -#line 1154 "awkgram.y" +#line 1160 "awkgram.y" /* yacc.c:1646 */ { - NODE *n = (yyvsp[(2) - (2)])->memory; + NODE *n = (yyvsp[0])->memory; (void) force_number(n); negate_num(n); - bcfree((yyvsp[(1) - (2)])); - (yyval) = (yyvsp[(2) - (2)]); + bcfree((yyvsp[-1])); + (yyval) = (yyvsp[0]); } +#line 2993 "awkgram.c" /* yacc.c:1646 */ break; case 75: -/* Line 1792 of yacc.c */ -#line 1162 "awkgram.y" +#line 1168 "awkgram.y" /* yacc.c:1646 */ { - bcfree((yyvsp[(1) - (2)])); - (yyval) = (yyvsp[(2) - (2)]); + bcfree((yyvsp[-1])); + (yyval) = (yyvsp[0]); } +#line 3002 "awkgram.c" /* yacc.c:1646 */ break; case 76: -/* Line 1792 of yacc.c */ -#line 1167 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1173 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3008 "awkgram.c" /* yacc.c:1646 */ break; case 77: -/* Line 1792 of yacc.c */ -#line 1169 "awkgram.y" +#line 1175 "awkgram.y" /* yacc.c:1646 */ { - (yyvsp[(1) - (1)])->opcode = Op_push_re; - (yyval) = (yyvsp[(1) - (1)]); + (yyvsp[0])->opcode = Op_push_re; + (yyval) = (yyvsp[0]); } +#line 3017 "awkgram.c" /* yacc.c:1646 */ break; case 78: -/* Line 1792 of yacc.c */ -#line 1177 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1183 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3023 "awkgram.c" /* yacc.c:1646 */ break; case 79: -/* Line 1792 of yacc.c */ -#line 1179 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1185 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3029 "awkgram.c" /* yacc.c:1646 */ break; case 81: -/* Line 1792 of yacc.c */ -#line 1189 "awkgram.y" +#line 1195 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = (yyvsp[(2) - (3)]); + (yyval) = (yyvsp[-1]); } +#line 3037 "awkgram.c" /* yacc.c:1646 */ break; case 82: -/* Line 1792 of yacc.c */ -#line 1196 "awkgram.y" +#line 1202 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; (yyval) = NULL; } +#line 3047 "awkgram.c" /* yacc.c:1646 */ break; case 83: -/* Line 1792 of yacc.c */ -#line 1201 "awkgram.y" +#line 1207 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } +#line 3053 "awkgram.c" /* yacc.c:1646 */ break; case 84: -/* Line 1792 of yacc.c */ -#line 1202 "awkgram.y" +#line 1208 "awkgram.y" /* yacc.c:1646 */ { - if ((yyvsp[(1) - (3)])->redir_type == redirect_twoway - && (yyvsp[(3) - (3)])->lasti->opcode == Op_K_getline_redir - && (yyvsp[(3) - (3)])->lasti->redir_type == redirect_twoway) + if ((yyvsp[-2])->redir_type == redirect_twoway + && (yyvsp[0])->lasti->opcode == Op_K_getline_redir + && (yyvsp[0])->lasti->redir_type == redirect_twoway) yyerror(_("multistage two-way pipelines don't work")); - (yyval) = list_prepend((yyvsp[(3) - (3)]), (yyvsp[(1) - (3)])); + (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } +#line 3065 "awkgram.c" /* yacc.c:1646 */ break; case 85: -/* Line 1792 of yacc.c */ -#line 1213 "awkgram.y" +#line 1219 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = mk_condition((yyvsp[(3) - (6)]), (yyvsp[(1) - (6)]), (yyvsp[(6) - (6)]), NULL, NULL); + (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } +#line 3073 "awkgram.c" /* yacc.c:1646 */ break; case 86: -/* Line 1792 of yacc.c */ -#line 1218 "awkgram.y" +#line 1224 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = mk_condition((yyvsp[(3) - (9)]), (yyvsp[(1) - (9)]), (yyvsp[(6) - (9)]), (yyvsp[(7) - (9)]), (yyvsp[(9) - (9)])); + (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } +#line 3081 "awkgram.c" /* yacc.c:1646 */ break; case 91: -/* Line 1792 of yacc.c */ -#line 1235 "awkgram.y" +#line 1241 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 3087 "awkgram.c" /* yacc.c:1646 */ break; case 92: -/* Line 1792 of yacc.c */ -#line 1237 "awkgram.y" +#line 1243 "awkgram.y" /* yacc.c:1646 */ { - bcfree((yyvsp[(1) - (2)])); - (yyval) = (yyvsp[(2) - (2)]); + bcfree((yyvsp[-1])); + (yyval) = (yyvsp[0]); } +#line 3096 "awkgram.c" /* yacc.c:1646 */ break; case 93: -/* Line 1792 of yacc.c */ -#line 1245 "awkgram.y" +#line 1251 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 3102 "awkgram.c" /* yacc.c:1646 */ break; case 94: -/* Line 1792 of yacc.c */ -#line 1247 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]) ; } +#line 1253 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]) ; } +#line 3108 "awkgram.c" /* yacc.c:1646 */ break; case 95: -/* Line 1792 of yacc.c */ -#line 1252 "awkgram.y" +#line 1258 "awkgram.y" /* yacc.c:1646 */ { - (yyvsp[(1) - (1)])->param_count = 0; - (yyval) = list_create((yyvsp[(1) - (1)])); + (yyvsp[0])->param_count = 0; + (yyval) = list_create((yyvsp[0])); } +#line 3117 "awkgram.c" /* yacc.c:1646 */ break; case 96: -/* Line 1792 of yacc.c */ -#line 1257 "awkgram.y" +#line 1263 "awkgram.y" /* yacc.c:1646 */ { - (yyvsp[(3) - (3)])->param_count = (yyvsp[(1) - (3)])->lasti->param_count + 1; - (yyval) = list_append((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); + (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; + (yyval) = list_append((yyvsp[-2]), (yyvsp[0])); yyerrok; } +#line 3127 "awkgram.c" /* yacc.c:1646 */ break; case 97: -/* Line 1792 of yacc.c */ -#line 1263 "awkgram.y" +#line 1269 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 3133 "awkgram.c" /* yacc.c:1646 */ break; case 98: -/* Line 1792 of yacc.c */ -#line 1265 "awkgram.y" - { (yyval) = (yyvsp[(1) - (2)]); } +#line 1271 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[-1]); } +#line 3139 "awkgram.c" /* yacc.c:1646 */ break; case 99: -/* Line 1792 of yacc.c */ -#line 1267 "awkgram.y" - { (yyval) = (yyvsp[(1) - (3)]); } +#line 1273 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[-2]); } +#line 3145 "awkgram.c" /* yacc.c:1646 */ break; case 100: -/* Line 1792 of yacc.c */ -#line 1273 "awkgram.y" +#line 1279 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 3151 "awkgram.c" /* yacc.c:1646 */ break; case 101: -/* Line 1792 of yacc.c */ -#line 1275 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1281 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3157 "awkgram.c" /* yacc.c:1646 */ break; case 102: -/* Line 1792 of yacc.c */ -#line 1280 "awkgram.y" +#line 1286 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 3163 "awkgram.c" /* yacc.c:1646 */ break; case 103: -/* Line 1792 of yacc.c */ -#line 1282 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1288 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3169 "awkgram.c" /* yacc.c:1646 */ break; case 104: -/* Line 1792 of yacc.c */ -#line 1287 "awkgram.y" - { (yyval) = mk_expression_list(NULL, (yyvsp[(1) - (1)])); } +#line 1293 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } +#line 3175 "awkgram.c" /* yacc.c:1646 */ break; case 105: -/* Line 1792 of yacc.c */ -#line 1289 "awkgram.y" +#line 1295 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); + (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } +#line 3184 "awkgram.c" /* yacc.c:1646 */ break; case 106: -/* Line 1792 of yacc.c */ -#line 1294 "awkgram.y" +#line 1300 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 3190 "awkgram.c" /* yacc.c:1646 */ break; case 107: -/* Line 1792 of yacc.c */ -#line 1296 "awkgram.y" +#line 1302 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets * snode get a list of arguments that it can count. */ - (yyval) = (yyvsp[(1) - (2)]); + (yyval) = (yyvsp[-1]); } +#line 3202 "awkgram.c" /* yacc.c:1646 */ break; case 108: -/* Line 1792 of yacc.c */ -#line 1304 "awkgram.y" +#line 1310 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ - (yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); + (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } +#line 3211 "awkgram.c" /* yacc.c:1646 */ break; case 109: -/* Line 1792 of yacc.c */ -#line 1309 "awkgram.y" +#line 1315 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ - (yyval) = (yyvsp[(1) - (3)]); + (yyval) = (yyvsp[-2]); } +#line 3220 "awkgram.c" /* yacc.c:1646 */ break; case 110: -/* Line 1792 of yacc.c */ -#line 1318 "awkgram.y" +#line 1324 "awkgram.y" /* yacc.c:1646 */ { - if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode == Op_match_rec) - lintwarn_ln((yyvsp[(2) - (3)])->source_line, + if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec) + lintwarn_ln((yyvsp[-1])->source_line, _("regular expression on right of assignment")); - (yyval) = mk_assignment((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); + (yyval) = mk_assignment((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3231 "awkgram.c" /* yacc.c:1646 */ break; case 111: -/* Line 1792 of yacc.c */ -#line 1325 "awkgram.y" - { (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } +#line 1331 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3237 "awkgram.c" /* yacc.c:1646 */ break; case 112: -/* Line 1792 of yacc.c */ -#line 1327 "awkgram.y" - { (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } +#line 1333 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3243 "awkgram.c" /* yacc.c:1646 */ break; case 113: -/* Line 1792 of yacc.c */ -#line 1329 "awkgram.y" +#line 1335 "awkgram.y" /* yacc.c:1646 */ { - if ((yyvsp[(1) - (3)])->lasti->opcode == Op_match_rec) - warning_ln((yyvsp[(2) - (3)])->source_line, + if ((yyvsp[-2])->lasti->opcode == Op_match_rec) + warning_ln((yyvsp[-1])->source_line, _("regular expression on left of `~' or `!~' operator")); - if ((yyvsp[(3) - (3)])->lasti == (yyvsp[(3) - (3)])->nexti && (yyvsp[(3) - (3)])->nexti->opcode == Op_match_rec) { - (yyvsp[(2) - (3)])->memory = (yyvsp[(3) - (3)])->nexti->memory; - bcfree((yyvsp[(3) - (3)])->nexti); /* Op_match_rec */ - bcfree((yyvsp[(3) - (3)])); /* Op_list */ - (yyval) = list_append((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)])); + if ((yyvsp[0])->lasti == (yyvsp[0])->nexti && (yyvsp[0])->nexti->opcode == Op_match_rec) { + (yyvsp[-1])->memory = (yyvsp[0])->nexti->memory; + bcfree((yyvsp[0])->nexti); /* Op_match_rec */ + bcfree((yyvsp[0])); /* Op_list */ + (yyval) = list_append((yyvsp[-2]), (yyvsp[-1])); } else { - (yyvsp[(2) - (3)])->memory = make_regnode(Node_dynregex, NULL); - (yyval) = list_append(list_merge((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])), (yyvsp[(2) - (3)])); + (yyvsp[-1])->memory = make_regnode(Node_dynregex, NULL); + (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } +#line 3263 "awkgram.c" /* yacc.c:1646 */ break; case 114: -/* Line 1792 of yacc.c */ -#line 1345 "awkgram.y" +#line 1351 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) - warning_ln((yyvsp[(2) - (3)])->source_line, + warning_ln((yyvsp[-1])->source_line, _("old awk does not support the keyword `in' except after `for'")); - (yyvsp[(3) - (3)])->nexti->opcode = Op_push_array; - (yyvsp[(2) - (3)])->opcode = Op_in_array; - (yyvsp[(2) - (3)])->expr_count = 1; - (yyval) = list_append(list_merge((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])), (yyvsp[(2) - (3)])); + (yyvsp[0])->nexti->opcode = Op_push_array; + (yyvsp[-1])->opcode = Op_in_array; + (yyvsp[-1])->expr_count = 1; + (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } +#line 3277 "awkgram.c" /* yacc.c:1646 */ break; case 115: -/* Line 1792 of yacc.c */ -#line 1355 "awkgram.y" +#line 1361 "awkgram.y" /* yacc.c:1646 */ { - if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode == Op_match_rec) - lintwarn_ln((yyvsp[(2) - (3)])->source_line, + if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec) + lintwarn_ln((yyvsp[-1])->source_line, _("regular expression on right of comparison")); - (yyval) = list_append(list_merge((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])), (yyvsp[(2) - (3)])); + (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } +#line 3288 "awkgram.c" /* yacc.c:1646 */ break; case 116: -/* Line 1792 of yacc.c */ -#line 1362 "awkgram.y" - { (yyval) = mk_condition((yyvsp[(1) - (5)]), (yyvsp[(2) - (5)]), (yyvsp[(3) - (5)]), (yyvsp[(4) - (5)]), (yyvsp[(5) - (5)])); } +#line 1368 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } +#line 3294 "awkgram.c" /* yacc.c:1646 */ break; case 117: -/* Line 1792 of yacc.c */ -#line 1364 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1370 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3300 "awkgram.c" /* yacc.c:1646 */ break; case 118: -/* Line 1792 of yacc.c */ -#line 1369 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1375 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3306 "awkgram.c" /* yacc.c:1646 */ break; case 119: -/* Line 1792 of yacc.c */ -#line 1371 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1377 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3312 "awkgram.c" /* yacc.c:1646 */ break; case 120: -/* Line 1792 of yacc.c */ -#line 1373 "awkgram.y" +#line 1379 "awkgram.y" /* yacc.c:1646 */ { - (yyvsp[(2) - (2)])->opcode = Op_assign_quotient; - (yyval) = (yyvsp[(2) - (2)]); + (yyvsp[0])->opcode = Op_assign_quotient; + (yyval) = (yyvsp[0]); } +#line 3321 "awkgram.c" /* yacc.c:1646 */ break; case 121: -/* Line 1792 of yacc.c */ -#line 1381 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1387 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3327 "awkgram.c" /* yacc.c:1646 */ break; case 122: -/* Line 1792 of yacc.c */ -#line 1383 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1389 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3333 "awkgram.c" /* yacc.c:1646 */ break; case 123: -/* Line 1792 of yacc.c */ -#line 1388 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1394 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3339 "awkgram.c" /* yacc.c:1646 */ break; case 124: -/* Line 1792 of yacc.c */ -#line 1390 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1396 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3345 "awkgram.c" /* yacc.c:1646 */ break; case 125: -/* Line 1792 of yacc.c */ -#line 1395 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1401 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3351 "awkgram.c" /* yacc.c:1646 */ break; case 126: -/* Line 1792 of yacc.c */ -#line 1397 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1403 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3357 "awkgram.c" /* yacc.c:1646 */ break; case 127: -/* Line 1792 of yacc.c */ -#line 1399 "awkgram.y" +#line 1405 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; - if ((yyvsp[(1) - (2)])->lasti->opcode == Op_concat) { + if ((yyvsp[-1])->lasti->opcode == Op_concat) { /* multiple (> 2) adjacent strings optimization */ - is_simple_var = ((yyvsp[(1) - (2)])->lasti->concat_flag & CSVAR); - count = (yyvsp[(1) - (2)])->lasti->expr_count + 1; - (yyvsp[(1) - (2)])->lasti->opcode = Op_no_op; + is_simple_var = ((yyvsp[-1])->lasti->concat_flag & CSVAR); + count = (yyvsp[-1])->lasti->expr_count + 1; + (yyvsp[-1])->lasti->opcode = Op_no_op; } else { - is_simple_var = ((yyvsp[(1) - (2)])->nexti->opcode == Op_push - && (yyvsp[(1) - (2)])->lasti == (yyvsp[(1) - (2)])->nexti); /* first exp. is a simple + is_simple_var = ((yyvsp[-1])->nexti->opcode == Op_push + && (yyvsp[-1])->lasti == (yyvsp[-1])->nexti); /* first exp. is a simple * variable?; kludge for use * in Op_assign_concat. */ } if (do_optimize - && (yyvsp[(1) - (2)])->nexti == (yyvsp[(1) - (2)])->lasti && (yyvsp[(1) - (2)])->nexti->opcode == Op_push_i - && (yyvsp[(2) - (2)])->nexti == (yyvsp[(2) - (2)])->lasti && (yyvsp[(2) - (2)])->nexti->opcode == Op_push_i + && (yyvsp[-1])->nexti == (yyvsp[-1])->lasti && (yyvsp[-1])->nexti->opcode == Op_push_i + && (yyvsp[0])->nexti == (yyvsp[0])->lasti && (yyvsp[0])->nexti->opcode == Op_push_i ) { - NODE *n1 = (yyvsp[(1) - (2)])->nexti->memory; - NODE *n2 = (yyvsp[(2) - (2)])->nexti->memory; + NODE *n1 = (yyvsp[-1])->nexti->memory; + NODE *n2 = (yyvsp[0])->nexti->memory; size_t nlen; n1 = force_string(n1); @@ -3592,184 +3393,184 @@ regular_print: n1->flags &= ~(NUMCUR|NUMBER|NUMINT); n1->flags |= (STRING|STRCUR); unref(n2); - bcfree((yyvsp[(2) - (2)])->nexti); - bcfree((yyvsp[(2) - (2)])); - (yyval) = (yyvsp[(1) - (2)]); + bcfree((yyvsp[0])->nexti); + bcfree((yyvsp[0])); + (yyval) = (yyvsp[-1]); } else { - (yyval) = list_append(list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])), instruction(Op_concat)); + (yyval) = list_append(list_merge((yyvsp[-1]), (yyvsp[0])), instruction(Op_concat)); (yyval)->lasti->concat_flag = (is_simple_var ? CSVAR : 0); (yyval)->lasti->expr_count = count; if (count > max_args) max_args = count; } } +#line 3408 "awkgram.c" /* yacc.c:1646 */ break; case 129: -/* Line 1792 of yacc.c */ -#line 1451 "awkgram.y" - { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } +#line 1457 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3414 "awkgram.c" /* yacc.c:1646 */ break; case 130: -/* Line 1792 of yacc.c */ -#line 1453 "awkgram.y" - { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } +#line 1459 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3420 "awkgram.c" /* yacc.c:1646 */ break; case 131: -/* Line 1792 of yacc.c */ -#line 1455 "awkgram.y" - { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } +#line 1461 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3426 "awkgram.c" /* yacc.c:1646 */ break; case 132: -/* Line 1792 of yacc.c */ -#line 1457 "awkgram.y" - { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } +#line 1463 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3432 "awkgram.c" /* yacc.c:1646 */ break; case 133: -/* Line 1792 of yacc.c */ -#line 1459 "awkgram.y" - { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } +#line 1465 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3438 "awkgram.c" /* yacc.c:1646 */ break; case 134: -/* Line 1792 of yacc.c */ -#line 1461 "awkgram.y" - { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } +#line 1467 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3444 "awkgram.c" /* yacc.c:1646 */ break; case 135: -/* Line 1792 of yacc.c */ -#line 1463 "awkgram.y" +#line 1469 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' */ - if ((rule == BEGINFILE || rule == ENDFILE) && (yyvsp[(3) - (3)]) == NULL) - error_ln((yyvsp[(1) - (3)])->source_line, + if ((rule == BEGINFILE || rule == ENDFILE) && (yyvsp[0]) == NULL) + error_ln((yyvsp[-2])->source_line, _("non-redirected `getline' invalid inside `%s' rule"), ruletab[rule]); - if (do_lint && rule == END && (yyvsp[(3) - (3)]) == NULL) - lintwarn_ln((yyvsp[(1) - (3)])->source_line, + if (do_lint && rule == END && (yyvsp[0]) == NULL) + lintwarn_ln((yyvsp[-2])->source_line, _("non-redirected `getline' undefined inside END action")); - (yyval) = mk_getline((yyvsp[(1) - (3)]), (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), redirect_input); + (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } +#line 3462 "awkgram.c" /* yacc.c:1646 */ break; case 136: -/* Line 1792 of yacc.c */ -#line 1477 "awkgram.y" +#line 1483 "awkgram.y" /* yacc.c:1646 */ { - (yyvsp[(2) - (2)])->opcode = Op_postincrement; - (yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) - (2)])); + (yyvsp[0])->opcode = Op_postincrement; + (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } +#line 3471 "awkgram.c" /* yacc.c:1646 */ break; case 137: -/* Line 1792 of yacc.c */ -#line 1482 "awkgram.y" +#line 1488 "awkgram.y" /* yacc.c:1646 */ { - (yyvsp[(2) - (2)])->opcode = Op_postdecrement; - (yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) - (2)])); + (yyvsp[0])->opcode = Op_postdecrement; + (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } +#line 3480 "awkgram.c" /* yacc.c:1646 */ break; case 138: -/* Line 1792 of yacc.c */ -#line 1487 "awkgram.y" +#line 1493 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { - warning_ln((yyvsp[(4) - (5)])->source_line, + warning_ln((yyvsp[-1])->source_line, _("old awk does not support the keyword `in' except after `for'")); - warning_ln((yyvsp[(4) - (5)])->source_line, + warning_ln((yyvsp[-1])->source_line, _("old awk does not support multidimensional arrays")); } - (yyvsp[(5) - (5)])->nexti->opcode = Op_push_array; - (yyvsp[(4) - (5)])->opcode = Op_in_array; - if ((yyvsp[(2) - (5)]) == NULL) { /* error */ + (yyvsp[0])->nexti->opcode = Op_push_array; + (yyvsp[-1])->opcode = Op_in_array; + if ((yyvsp[-3]) == NULL) { /* error */ errcount++; - (yyvsp[(4) - (5)])->expr_count = 0; - (yyval) = list_merge((yyvsp[(5) - (5)]), (yyvsp[(4) - (5)])); + (yyvsp[-1])->expr_count = 0; + (yyval) = list_merge((yyvsp[0]), (yyvsp[-1])); } else { - INSTRUCTION *t = (yyvsp[(2) - (5)]); - (yyvsp[(4) - (5)])->expr_count = count_expressions(&t, false); - (yyval) = list_append(list_merge(t, (yyvsp[(5) - (5)])), (yyvsp[(4) - (5)])); + INSTRUCTION *t = (yyvsp[-3]); + (yyvsp[-1])->expr_count = count_expressions(&t, false); + (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } +#line 3504 "awkgram.c" /* yacc.c:1646 */ break; case 139: -/* Line 1792 of yacc.c */ -#line 1512 "awkgram.y" +#line 1518 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = mk_getline((yyvsp[(3) - (4)]), (yyvsp[(4) - (4)]), (yyvsp[(1) - (4)]), (yyvsp[(2) - (4)])->redir_type); - bcfree((yyvsp[(2) - (4)])); + (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); + bcfree((yyvsp[-2])); } +#line 3513 "awkgram.c" /* yacc.c:1646 */ break; case 140: -/* Line 1792 of yacc.c */ -#line 1518 "awkgram.y" - { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } +#line 1524 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3519 "awkgram.c" /* yacc.c:1646 */ break; case 141: -/* Line 1792 of yacc.c */ -#line 1520 "awkgram.y" - { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } +#line 1526 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3525 "awkgram.c" /* yacc.c:1646 */ break; case 142: -/* Line 1792 of yacc.c */ -#line 1522 "awkgram.y" - { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } +#line 1528 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3531 "awkgram.c" /* yacc.c:1646 */ break; case 143: -/* Line 1792 of yacc.c */ -#line 1524 "awkgram.y" - { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } +#line 1530 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3537 "awkgram.c" /* yacc.c:1646 */ break; case 144: -/* Line 1792 of yacc.c */ -#line 1526 "awkgram.y" - { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } +#line 1532 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3543 "awkgram.c" /* yacc.c:1646 */ break; case 145: -/* Line 1792 of yacc.c */ -#line 1528 "awkgram.y" - { (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); } +#line 1534 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } +#line 3549 "awkgram.c" /* yacc.c:1646 */ break; case 146: -/* Line 1792 of yacc.c */ -#line 1533 "awkgram.y" +#line 1539 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = list_create((yyvsp[(1) - (1)])); + (yyval) = list_create((yyvsp[0])); } +#line 3557 "awkgram.c" /* yacc.c:1646 */ break; case 147: -/* Line 1792 of yacc.c */ -#line 1537 "awkgram.y" +#line 1543 "awkgram.y" /* yacc.c:1646 */ { - if ((yyvsp[(2) - (2)])->opcode == Op_match_rec) { - (yyvsp[(2) - (2)])->opcode = Op_nomatch; - (yyvsp[(1) - (2)])->opcode = Op_push_i; - (yyvsp[(1) - (2)])->memory = make_number(0.0); - (yyval) = list_append(list_append(list_create((yyvsp[(1) - (2)])), - instruction(Op_field_spec)), (yyvsp[(2) - (2)])); + if ((yyvsp[0])->opcode == Op_match_rec) { + (yyvsp[0])->opcode = Op_nomatch; + (yyvsp[-1])->opcode = Op_push_i; + (yyvsp[-1])->memory = make_number(0.0); + (yyval) = list_append(list_append(list_create((yyvsp[-1])), + instruction(Op_field_spec)), (yyvsp[0])); } else { - if (do_optimize && (yyvsp[(2) - (2)])->nexti == (yyvsp[(2) - (2)])->lasti - && (yyvsp[(2) - (2)])->nexti->opcode == Op_push_i - && ((yyvsp[(2) - (2)])->nexti->memory->flags & (MPFN|MPZN)) == 0 + if (do_optimize && (yyvsp[0])->nexti == (yyvsp[0])->lasti + && (yyvsp[0])->nexti->opcode == Op_push_i + && ((yyvsp[0])->nexti->memory->flags & (MPFN|MPZN)) == 0 ) { - NODE *n = (yyvsp[(2) - (2)])->nexti->memory; + NODE *n = (yyvsp[0])->nexti->memory; if ((n->flags & (STRCUR|STRING)) != 0) { n->numbr = (AWKNUM) (n->stlen == 0); n->flags &= ~(STRCUR|STRING); @@ -3779,139 +3580,139 @@ regular_print: n->stlen = 0; } else n->numbr = (AWKNUM) (n->numbr == 0.0); - bcfree((yyvsp[(1) - (2)])); - (yyval) = (yyvsp[(2) - (2)]); + bcfree((yyvsp[-1])); + (yyval) = (yyvsp[0]); } else { - (yyvsp[(1) - (2)])->opcode = Op_not; - add_lint((yyvsp[(2) - (2)]), LINT_assign_in_cond); - (yyval) = list_append((yyvsp[(2) - (2)]), (yyvsp[(1) - (2)])); + (yyvsp[-1])->opcode = Op_not; + add_lint((yyvsp[0]), LINT_assign_in_cond); + (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } } +#line 3593 "awkgram.c" /* yacc.c:1646 */ break; case 148: -/* Line 1792 of yacc.c */ -#line 1569 "awkgram.y" - { (yyval) = (yyvsp[(2) - (3)]); } +#line 1575 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[-1]); } +#line 3599 "awkgram.c" /* yacc.c:1646 */ break; case 149: -/* Line 1792 of yacc.c */ -#line 1571 "awkgram.y" +#line 1577 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)])); + (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } +#line 3609 "awkgram.c" /* yacc.c:1646 */ break; case 150: -/* Line 1792 of yacc.c */ -#line 1577 "awkgram.y" +#line 1583 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)])); + (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } +#line 3619 "awkgram.c" /* yacc.c:1646 */ break; case 151: -/* Line 1792 of yacc.c */ -#line 1583 "awkgram.y" +#line 1589 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; if (do_lint && ! warned) { warned = true; - lintwarn_ln((yyvsp[(1) - (1)])->source_line, + lintwarn_ln((yyvsp[0])->source_line, _("call of `length' without parentheses is not portable")); } - (yyval) = snode(NULL, (yyvsp[(1) - (1)])); + (yyval) = snode(NULL, (yyvsp[0])); if ((yyval) == NULL) YYABORT; } +#line 3636 "awkgram.c" /* yacc.c:1646 */ break; case 154: -/* Line 1792 of yacc.c */ -#line 1598 "awkgram.y" +#line 1604 "awkgram.y" /* yacc.c:1646 */ { - (yyvsp[(1) - (2)])->opcode = Op_preincrement; - (yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) - (2)])); + (yyvsp[-1])->opcode = Op_preincrement; + (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } +#line 3645 "awkgram.c" /* yacc.c:1646 */ break; case 155: -/* Line 1792 of yacc.c */ -#line 1603 "awkgram.y" +#line 1609 "awkgram.y" /* yacc.c:1646 */ { - (yyvsp[(1) - (2)])->opcode = Op_predecrement; - (yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) - (2)])); + (yyvsp[-1])->opcode = Op_predecrement; + (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } +#line 3654 "awkgram.c" /* yacc.c:1646 */ break; case 156: -/* Line 1792 of yacc.c */ -#line 1608 "awkgram.y" +#line 1614 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = list_create((yyvsp[(1) - (1)])); + (yyval) = list_create((yyvsp[0])); } +#line 3662 "awkgram.c" /* yacc.c:1646 */ break; case 157: -/* Line 1792 of yacc.c */ -#line 1612 "awkgram.y" +#line 1618 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = list_create((yyvsp[(1) - (1)])); + (yyval) = list_create((yyvsp[0])); } +#line 3670 "awkgram.c" /* yacc.c:1646 */ break; case 158: -/* Line 1792 of yacc.c */ -#line 1616 "awkgram.y" +#line 1622 "awkgram.y" /* yacc.c:1646 */ { - if ((yyvsp[(2) - (2)])->lasti->opcode == Op_push_i - && ((yyvsp[(2) - (2)])->lasti->memory->flags & (STRCUR|STRING)) == 0 + if ((yyvsp[0])->lasti->opcode == Op_push_i + && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0 ) { - NODE *n = (yyvsp[(2) - (2)])->lasti->memory; + NODE *n = (yyvsp[0])->lasti->memory; (void) force_number(n); negate_num(n); - (yyval) = (yyvsp[(2) - (2)]); - bcfree((yyvsp[(1) - (2)])); + (yyval) = (yyvsp[0]); + bcfree((yyvsp[-1])); } else { - (yyvsp[(1) - (2)])->opcode = Op_unary_minus; - (yyval) = list_append((yyvsp[(2) - (2)]), (yyvsp[(1) - (2)])); + (yyvsp[-1])->opcode = Op_unary_minus; + (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } +#line 3689 "awkgram.c" /* yacc.c:1646 */ break; case 159: -/* Line 1792 of yacc.c */ -#line 1631 "awkgram.y" +#line 1637 "awkgram.y" /* yacc.c:1646 */ { /* * was: $$ = $2 * POSIX semantics: force a conversion to numeric type */ - (yyvsp[(1) - (2)])->opcode = Op_plus_i; - (yyvsp[(1) - (2)])->memory = make_number(0.0); - (yyval) = list_append((yyvsp[(2) - (2)]), (yyvsp[(1) - (2)])); + (yyvsp[-1])->opcode = Op_plus_i; + (yyvsp[-1])->memory = make_number(0.0); + (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } +#line 3703 "awkgram.c" /* yacc.c:1646 */ break; case 160: -/* Line 1792 of yacc.c */ -#line 1644 "awkgram.y" +#line 1650 "awkgram.y" /* yacc.c:1646 */ { - func_use((yyvsp[(1) - (1)])->lasti->func_name, FUNC_USE); - (yyval) = (yyvsp[(1) - (1)]); + func_use((yyvsp[0])->lasti->func_name, FUNC_USE); + (yyval) = (yyvsp[0]); } +#line 3712 "awkgram.c" /* yacc.c:1646 */ break; case 161: -/* Line 1792 of yacc.c */ -#line 1649 "awkgram.y" +#line 1655 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3927,7 +3728,7 @@ regular_print: lintwarn("%s", msg); } - f = (yyvsp[(2) - (2)])->lasti; + f = (yyvsp[0])->lasti; f->opcode = Op_indirect_func_call; name = estrdup(f->func_name, strlen(f->func_name)); if (is_std_var(name)) @@ -3942,71 +3743,71 @@ regular_print: * @f(f="real_fun") */ - (yyval) = list_prepend((yyvsp[(2) - (2)]), t); + (yyval) = list_prepend((yyvsp[0]), t); } +#line 3749 "awkgram.c" /* yacc.c:1646 */ break; case 162: -/* Line 1792 of yacc.c */ -#line 1685 "awkgram.y" +#line 1691 "awkgram.y" /* yacc.c:1646 */ { - param_sanity((yyvsp[(3) - (4)])); - (yyvsp[(1) - (4)])->opcode = Op_func_call; - (yyvsp[(1) - (4)])->func_body = NULL; - if ((yyvsp[(3) - (4)]) == NULL) { /* no argument or error */ - ((yyvsp[(1) - (4)]) + 1)->expr_count = 0; - (yyval) = list_create((yyvsp[(1) - (4)])); + param_sanity((yyvsp[-1])); + (yyvsp[-3])->opcode = Op_func_call; + (yyvsp[-3])->func_body = NULL; + if ((yyvsp[-1]) == NULL) { /* no argument or error */ + ((yyvsp[-3]) + 1)->expr_count = 0; + (yyval) = list_create((yyvsp[-3])); } else { - INSTRUCTION *t = (yyvsp[(3) - (4)]); - ((yyvsp[(1) - (4)]) + 1)->expr_count = count_expressions(&t, true); - (yyval) = list_append(t, (yyvsp[(1) - (4)])); + INSTRUCTION *t = (yyvsp[-1]); + ((yyvsp[-3]) + 1)->expr_count = count_expressions(&t, true); + (yyval) = list_append(t, (yyvsp[-3])); } } +#line 3767 "awkgram.c" /* yacc.c:1646 */ break; case 163: -/* Line 1792 of yacc.c */ -#line 1702 "awkgram.y" +#line 1708 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 3773 "awkgram.c" /* yacc.c:1646 */ break; case 164: -/* Line 1792 of yacc.c */ -#line 1704 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1710 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3779 "awkgram.c" /* yacc.c:1646 */ break; case 165: -/* Line 1792 of yacc.c */ -#line 1709 "awkgram.y" +#line 1715 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 3785 "awkgram.c" /* yacc.c:1646 */ break; case 166: -/* Line 1792 of yacc.c */ -#line 1711 "awkgram.y" - { (yyval) = (yyvsp[(1) - (2)]); } +#line 1717 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[-1]); } +#line 3791 "awkgram.c" /* yacc.c:1646 */ break; case 167: -/* Line 1792 of yacc.c */ -#line 1716 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1722 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3797 "awkgram.c" /* yacc.c:1646 */ break; case 168: -/* Line 1792 of yacc.c */ -#line 1718 "awkgram.y" +#line 1724 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); + (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } +#line 3805 "awkgram.c" /* yacc.c:1646 */ break; case 169: -/* Line 1792 of yacc.c */ -#line 1725 "awkgram.y" +#line 1731 "awkgram.y" /* yacc.c:1646 */ { - INSTRUCTION *ip = (yyvsp[(1) - (1)])->lasti; + INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ if (count > 1) { /* change Op_subscript or Op_sub_array to Op_concat */ @@ -4016,152 +3817,152 @@ regular_print: } else ip->opcode = Op_no_op; sub_counter++; /* count # of dimensions */ - (yyval) = (yyvsp[(1) - (1)]); + (yyval) = (yyvsp[0]); } +#line 3823 "awkgram.c" /* yacc.c:1646 */ break; case 170: -/* Line 1792 of yacc.c */ -#line 1742 "awkgram.y" +#line 1748 "awkgram.y" /* yacc.c:1646 */ { - INSTRUCTION *t = (yyvsp[(2) - (3)]); - if ((yyvsp[(2) - (3)]) == NULL) { - error_ln((yyvsp[(3) - (3)])->source_line, + INSTRUCTION *t = (yyvsp[-1]); + if ((yyvsp[-1]) == NULL) { + error_ln((yyvsp[0])->source_line, _("invalid subscript expression")); /* install Null string as subscript. */ t = list_create(instruction(Op_push_i)); t->nexti->memory = dupnode(Nnull_string); - (yyvsp[(3) - (3)])->sub_count = 1; + (yyvsp[0])->sub_count = 1; } else - (yyvsp[(3) - (3)])->sub_count = count_expressions(&t, false); - (yyval) = list_append(t, (yyvsp[(3) - (3)])); + (yyvsp[0])->sub_count = count_expressions(&t, false); + (yyval) = list_append(t, (yyvsp[0])); } +#line 3841 "awkgram.c" /* yacc.c:1646 */ break; case 171: -/* Line 1792 of yacc.c */ -#line 1759 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); } +#line 1765 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3847 "awkgram.c" /* yacc.c:1646 */ break; case 172: -/* Line 1792 of yacc.c */ -#line 1761 "awkgram.y" +#line 1767 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); + (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } +#line 3855 "awkgram.c" /* yacc.c:1646 */ break; case 173: -/* Line 1792 of yacc.c */ -#line 1768 "awkgram.y" - { (yyval) = (yyvsp[(1) - (2)]); } +#line 1774 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[-1]); } +#line 3861 "awkgram.c" /* yacc.c:1646 */ break; case 174: -/* Line 1792 of yacc.c */ -#line 1773 "awkgram.y" +#line 1779 "awkgram.y" /* yacc.c:1646 */ { - char *var_name = (yyvsp[(1) - (1)])->lextok; + char *var_name = (yyvsp[0])->lextok; - (yyvsp[(1) - (1)])->opcode = Op_push; - (yyvsp[(1) - (1)])->memory = variable((yyvsp[(1) - (1)])->source_line, var_name, Node_var_new); - (yyval) = list_create((yyvsp[(1) - (1)])); + (yyvsp[0])->opcode = Op_push; + (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); + (yyval) = list_create((yyvsp[0])); } +#line 3873 "awkgram.c" /* yacc.c:1646 */ break; case 175: -/* Line 1792 of yacc.c */ -#line 1781 "awkgram.y" +#line 1787 "awkgram.y" /* yacc.c:1646 */ { - char *arr = (yyvsp[(1) - (2)])->lextok; - (yyvsp[(1) - (2)])->memory = variable((yyvsp[(1) - (2)])->source_line, arr, Node_var_new); - (yyvsp[(1) - (2)])->opcode = Op_push_array; - (yyval) = list_prepend((yyvsp[(2) - (2)]), (yyvsp[(1) - (2)])); + char *arr = (yyvsp[-1])->lextok; + (yyvsp[-1])->memory = variable((yyvsp[-1])->source_line, arr, Node_var_new); + (yyvsp[-1])->opcode = Op_push_array; + (yyval) = list_prepend((yyvsp[0]), (yyvsp[-1])); } +#line 3884 "awkgram.c" /* yacc.c:1646 */ break; case 176: -/* Line 1792 of yacc.c */ -#line 1791 "awkgram.y" +#line 1797 "awkgram.y" /* yacc.c:1646 */ { - INSTRUCTION *ip = (yyvsp[(1) - (1)])->nexti; + INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push && ip->memory->type == Node_var && ip->memory->var_update ) { - (yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_var_update)); + (yyval) = list_prepend((yyvsp[0]), instruction(Op_var_update)); (yyval)->nexti->update_var = ip->memory->var_update; } else - (yyval) = (yyvsp[(1) - (1)]); + (yyval) = (yyvsp[0]); } +#line 3900 "awkgram.c" /* yacc.c:1646 */ break; case 177: -/* Line 1792 of yacc.c */ -#line 1803 "awkgram.y" +#line 1809 "awkgram.y" /* yacc.c:1646 */ { - (yyval) = list_append((yyvsp[(2) - (3)]), (yyvsp[(1) - (3)])); - if ((yyvsp[(3) - (3)]) != NULL) - mk_assignment((yyvsp[(2) - (3)]), NULL, (yyvsp[(3) - (3)])); + (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); + if ((yyvsp[0]) != NULL) + mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } +#line 3910 "awkgram.c" /* yacc.c:1646 */ break; case 178: -/* Line 1792 of yacc.c */ -#line 1812 "awkgram.y" +#line 1818 "awkgram.y" /* yacc.c:1646 */ { - (yyvsp[(1) - (1)])->opcode = Op_postincrement; + (yyvsp[0])->opcode = Op_postincrement; } +#line 3918 "awkgram.c" /* yacc.c:1646 */ break; case 179: -/* Line 1792 of yacc.c */ -#line 1816 "awkgram.y" +#line 1822 "awkgram.y" /* yacc.c:1646 */ { - (yyvsp[(1) - (1)])->opcode = Op_postdecrement; + (yyvsp[0])->opcode = Op_postdecrement; } +#line 3926 "awkgram.c" /* yacc.c:1646 */ break; case 180: -/* Line 1792 of yacc.c */ -#line 1819 "awkgram.y" +#line 1825 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } +#line 3932 "awkgram.c" /* yacc.c:1646 */ break; case 182: -/* Line 1792 of yacc.c */ -#line 1827 "awkgram.y" +#line 1833 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } +#line 3938 "awkgram.c" /* yacc.c:1646 */ break; case 183: -/* Line 1792 of yacc.c */ -#line 1831 "awkgram.y" +#line 1837 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } +#line 3944 "awkgram.c" /* yacc.c:1646 */ break; case 186: -/* Line 1792 of yacc.c */ -#line 1840 "awkgram.y" +#line 1846 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } +#line 3950 "awkgram.c" /* yacc.c:1646 */ break; case 187: -/* Line 1792 of yacc.c */ -#line 1844 "awkgram.y" - { (yyval) = (yyvsp[(1) - (1)]); yyerrok; } +#line 1850 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); yyerrok; } +#line 3956 "awkgram.c" /* yacc.c:1646 */ break; case 188: -/* Line 1792 of yacc.c */ -#line 1848 "awkgram.y" +#line 1854 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } +#line 3962 "awkgram.c" /* yacc.c:1646 */ break; -/* Line 1792 of yacc.c */ -#line 4165 "awkgram.c" +#line 3966 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4183,7 +3984,7 @@ regular_print: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -4198,9 +3999,9 @@ regular_print: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -4251,20 +4052,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -4283,7 +4084,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -4296,29 +4097,29 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -4369,14 +4170,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -4387,13 +4188,9 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - -/* Line 2055 of yacc.c */ -#line 1850 "awkgram.y" +#line 1856 "awkgram.y" /* yacc.c:1906 */ struct token { @@ -4861,10 +4658,10 @@ mk_program() if (begin_block != NULL) cp = list_merge(begin_block, cp); - if (comment0 != NULL){ + if (comment0 != NULL) { (void) list_prepend(cp, comment0); } - if (comment != NULL){ + if (comment != NULL) { (void) list_append(cp, comment); } (void) list_append(cp, ip_atexit); @@ -5368,7 +5165,7 @@ get_src_buf() lexend = lexptr + n; if (n == 0) { static bool warned = false; - if (do_lint && newfile && ! warned){ + if (do_lint && newfile && ! warned) { warned = true; sourceline = 0; lintwarn(_("source file `%s' is empty"), source); @@ -5550,11 +5347,11 @@ int get_comment(void) tokadd('#'); sl = sourceline; - while (true){ - while ((c = nextc(false)) != '\n' && c != END_FILE){ + while (true) { + while ((c = nextc(false)) != '\n' && c != END_FILE) { tokadd(c); } - if (c == '\n'){ + if (c == '\n') { tokadd(c); sourceline++; do { @@ -5566,7 +5363,7 @@ int get_comment(void) } while (isspace(c) && c != END_FILE) ; if ( c == END_FILE) break; - else if (c != '#'){ + else if (c != '#') { pushback(); break; } else @@ -5593,23 +5390,23 @@ void split_comment(void) p = comment->memory->stptr; l = comment->memory->stlen - 3; /* have at least two comments so split at last blank line ( \n\n) */ - while (l >= 0){ - if (p[l] == '\n' && p[l+1] == '\n'){ + while (l >= 0) { + if (p[l] == '\n' && p[l+1] == '\n') { commentf = comment; n = commentf->memory; commentf->memory = make_str_node(p + l + 2, n->stlen - l - 2, 0); - /* create program comment */ + /* create program comment */ comment0 = bcalloc(Op_comment, 1, sourceline); comment0->source_file = comment->source_file; p[l + 2] = 0; - comment0->memory = make_str_node(p , l + 2, 0); + comment0->memory = make_str_node(p, l + 2, 0); comment = NULL; freenode(n); break; } - else l--; + else + l--; } - } /* allow_newline --- allow newline after &&, ||, ? and : */ @@ -5655,7 +5452,8 @@ allow_newline(void) * removes the warnings. */ -static int newline_eof() +static int +newline_eof() { /* NB: a newline at end does not start a source line. */ if (lasttok != NEWLINE) { @@ -6943,7 +6741,7 @@ mk_function(INSTRUCTION *fi, INSTRUCTION *def) /* add any pre-function comment to start of action for profile.c */ - if (commentf != NULL){ + if (commentf != NULL) { commentf->source_line = 0; (void) list_prepend(def, commentf); commentf = NULL; -- cgit v1.2.3 From fc9b58482ce186b2fa0461351d4e060735e21b78 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 23 Sep 2014 19:31:58 +0300 Subject: Allow any kind of junk inside quoted strings. --- awkgram.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index b7354f67..06279861 100644 --- a/awkgram.c +++ b/awkgram.c @@ -5734,7 +5734,11 @@ retry: case '"': string: esc_seen = false; - while ((c = nextc(true)) != '"') { + /* + * Allow any kind of junk in quoted string, + * so pass false to nextc(). + */ + while ((c = nextc(false)) != '"') { if (c == '\n') { pushback(); yyerror(_("unterminated string")); -- cgit v1.2.3 From c7882f59b6e5e4bb142928939264ca0c9af8e129 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 27 Sep 2014 21:26:28 +0300 Subject: Minor fix when checking for bad source characters. --- awkgram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index 06279861..63439b36 100644 --- a/awkgram.c +++ b/awkgram.c @@ -5154,7 +5154,7 @@ check_bad_char(int c) } if (iscntrl(c) && ! isspace(c)) - fatal(_("PEBKAC error: invalid character '\\%03o' in source code"), c); + fatal(_("PEBKAC error: invalid character '\\%03o' in source code"), c & 0xFF); } /* nextc --- get the next input character */ -- cgit v1.2.3 From ed633f19bdbb66ac12aaf66cf46b458558eaedbd Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 1 Oct 2014 22:06:31 +0300 Subject: Some cleanups and doc additions. --- awkgram.c | 658 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 329 insertions(+), 329 deletions(-) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index 4fe3b04e..628d398f 100644 --- a/awkgram.c +++ b/awkgram.c @@ -127,7 +127,7 @@ static void check_funcs(void); static ssize_t read_one_line(int fd, void *buffer, size_t count); static int one_line_close(int fd); -void split_comment(void); +static void split_comment(void); static bool want_source = false; static bool want_regexp = false; /* lexical scanning kludge */ @@ -660,23 +660,23 @@ static const yytype_uint16 yyrline[] = { 0, 205, 205, 207, 212, 213, 219, 231, 235, 246, 252, 257, 265, 273, 275, 280, 288, 290, 296, 303, - 312, 338, 351, 363, 370, 380, 392, 394, 396, 402, - 407, 408, 412, 447, 446, 480, 482, 487, 493, 521, - 526, 527, 531, 533, 535, 542, 632, 674, 716, 829, - 836, 843, 853, 862, 871, 880, 891, 907, 906, 930, - 942, 942, 1040, 1040, 1073, 1103, 1109, 1110, 1116, 1117, - 1124, 1129, 1141, 1155, 1157, 1165, 1170, 1172, 1180, 1182, - 1191, 1192, 1200, 1205, 1205, 1216, 1220, 1228, 1229, 1232, - 1234, 1239, 1240, 1249, 1250, 1255, 1260, 1266, 1268, 1270, - 1277, 1278, 1284, 1285, 1290, 1292, 1297, 1299, 1307, 1312, - 1321, 1328, 1330, 1332, 1348, 1358, 1365, 1367, 1372, 1374, - 1376, 1384, 1386, 1391, 1393, 1398, 1400, 1402, 1452, 1454, - 1456, 1458, 1460, 1462, 1464, 1466, 1480, 1485, 1490, 1515, - 1521, 1523, 1525, 1527, 1529, 1531, 1536, 1540, 1572, 1574, - 1580, 1586, 1599, 1600, 1601, 1606, 1611, 1615, 1619, 1634, - 1647, 1652, 1688, 1706, 1707, 1713, 1714, 1719, 1721, 1728, - 1745, 1762, 1764, 1771, 1776, 1784, 1794, 1806, 1815, 1819, - 1823, 1827, 1831, 1835, 1838, 1840, 1844, 1848, 1852 + 312, 338, 350, 362, 369, 379, 391, 393, 395, 401, + 406, 407, 411, 446, 445, 479, 481, 486, 492, 520, + 525, 526, 530, 532, 534, 541, 631, 673, 715, 828, + 835, 842, 852, 861, 870, 879, 890, 906, 905, 929, + 941, 941, 1039, 1039, 1072, 1102, 1108, 1109, 1115, 1116, + 1123, 1128, 1140, 1154, 1156, 1164, 1169, 1171, 1179, 1181, + 1190, 1191, 1199, 1204, 1204, 1215, 1219, 1227, 1228, 1231, + 1233, 1238, 1239, 1248, 1249, 1254, 1259, 1265, 1267, 1269, + 1276, 1277, 1283, 1284, 1289, 1291, 1296, 1298, 1306, 1311, + 1320, 1327, 1329, 1331, 1347, 1357, 1364, 1366, 1371, 1373, + 1375, 1383, 1385, 1390, 1392, 1397, 1399, 1401, 1451, 1453, + 1455, 1457, 1459, 1461, 1463, 1465, 1479, 1484, 1489, 1514, + 1520, 1522, 1524, 1526, 1528, 1530, 1535, 1539, 1571, 1573, + 1579, 1585, 1598, 1599, 1600, 1605, 1610, 1614, 1618, 1633, + 1646, 1651, 1687, 1705, 1706, 1712, 1713, 1718, 1720, 1727, + 1744, 1761, 1763, 1770, 1775, 1783, 1793, 1805, 1814, 1818, + 1822, 1826, 1830, 1834, 1837, 1839, 1843, 1847, 1851 }; #endif @@ -2038,7 +2038,6 @@ yyreduce: { static int begin_seen = 0; func_first = false; - INSTRUCTION *ip; if (do_lint_old && ++begin_seen == 2) warning_ln((yyvsp[0])->source_line, _("old awk does not support multiple `BEGIN' or `END' rules")); @@ -2047,11 +2046,11 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2051 "awkgram.c" /* yacc.c:1646 */ +#line 2050 "awkgram.c" /* yacc.c:1646 */ break; case 22: -#line 352 "awkgram.y" /* yacc.c:1646 */ +#line 351 "awkgram.y" /* yacc.c:1646 */ { static int end_seen = 0; func_first = false; @@ -2063,33 +2062,33 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2067 "awkgram.c" /* yacc.c:1646 */ +#line 2066 "awkgram.c" /* yacc.c:1646 */ break; case 23: -#line 364 "awkgram.y" /* yacc.c:1646 */ +#line 363 "awkgram.y" /* yacc.c:1646 */ { func_first = false; (yyvsp[0])->in_rule = rule = BEGINFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2078 "awkgram.c" /* yacc.c:1646 */ +#line 2077 "awkgram.c" /* yacc.c:1646 */ break; case 24: -#line 371 "awkgram.y" /* yacc.c:1646 */ +#line 370 "awkgram.y" /* yacc.c:1646 */ { func_first = false; (yyvsp[0])->in_rule = rule = ENDFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2089 "awkgram.c" /* yacc.c:1646 */ +#line 2088 "awkgram.c" /* yacc.c:1646 */ break; case 25: -#line 381 "awkgram.y" /* yacc.c:1646 */ +#line 380 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; if ((yyvsp[-3]) == NULL) @@ -2098,39 +2097,39 @@ yyreduce: ip = (yyvsp[-3]); (yyval) = ip; } -#line 2102 "awkgram.c" /* yacc.c:1646 */ +#line 2101 "awkgram.c" /* yacc.c:1646 */ break; case 26: -#line 393 "awkgram.y" /* yacc.c:1646 */ +#line 392 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2108 "awkgram.c" /* yacc.c:1646 */ +#line 2107 "awkgram.c" /* yacc.c:1646 */ break; case 27: -#line 395 "awkgram.y" /* yacc.c:1646 */ +#line 394 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2114 "awkgram.c" /* yacc.c:1646 */ +#line 2113 "awkgram.c" /* yacc.c:1646 */ break; case 28: -#line 397 "awkgram.y" /* yacc.c:1646 */ +#line 396 "awkgram.y" /* yacc.c:1646 */ { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); YYABORT; } -#line 2124 "awkgram.c" /* yacc.c:1646 */ +#line 2123 "awkgram.c" /* yacc.c:1646 */ break; case 29: -#line 403 "awkgram.y" /* yacc.c:1646 */ +#line 402 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2130 "awkgram.c" /* yacc.c:1646 */ +#line 2129 "awkgram.c" /* yacc.c:1646 */ break; case 32: -#line 413 "awkgram.y" /* yacc.c:1646 */ +#line 412 "awkgram.y" /* yacc.c:1646 */ { /* * treat any comments between BOF and the first function @@ -2157,17 +2156,17 @@ yyreduce: /* $4 already free'd in install_function */ (yyval) = (yyvsp[-5]); } -#line 2161 "awkgram.c" /* yacc.c:1646 */ +#line 2160 "awkgram.c" /* yacc.c:1646 */ break; case 33: -#line 447 "awkgram.y" /* yacc.c:1646 */ +#line 446 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } -#line 2167 "awkgram.c" /* yacc.c:1646 */ +#line 2166 "awkgram.c" /* yacc.c:1646 */ break; case 34: -#line 449 "awkgram.y" /* yacc.c:1646 */ +#line 448 "awkgram.y" /* yacc.c:1646 */ { NODE *n, *exp; char *re; @@ -2196,28 +2195,28 @@ yyreduce: (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2200 "awkgram.c" /* yacc.c:1646 */ +#line 2199 "awkgram.c" /* yacc.c:1646 */ break; case 35: -#line 481 "awkgram.y" /* yacc.c:1646 */ +#line 480 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[0])); } -#line 2206 "awkgram.c" /* yacc.c:1646 */ +#line 2205 "awkgram.c" /* yacc.c:1646 */ break; case 37: -#line 487 "awkgram.y" /* yacc.c:1646 */ +#line 486 "awkgram.y" /* yacc.c:1646 */ { if (comment != NULL) { (yyval) = list_create(comment); comment = NULL; } else (yyval) = NULL; } -#line 2217 "awkgram.c" /* yacc.c:1646 */ +#line 2216 "awkgram.c" /* yacc.c:1646 */ break; case 38: -#line 494 "awkgram.y" /* yacc.c:1646 */ +#line 493 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0]) == NULL) { if (comment == NULL) @@ -2245,40 +2244,40 @@ yyreduce: } yyerrok; } -#line 2249 "awkgram.c" /* yacc.c:1646 */ +#line 2248 "awkgram.c" /* yacc.c:1646 */ break; case 39: -#line 522 "awkgram.y" /* yacc.c:1646 */ +#line 521 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2255 "awkgram.c" /* yacc.c:1646 */ +#line 2254 "awkgram.c" /* yacc.c:1646 */ break; case 42: -#line 532 "awkgram.y" /* yacc.c:1646 */ +#line 531 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2261 "awkgram.c" /* yacc.c:1646 */ +#line 2260 "awkgram.c" /* yacc.c:1646 */ break; case 43: -#line 534 "awkgram.y" /* yacc.c:1646 */ +#line 533 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2267 "awkgram.c" /* yacc.c:1646 */ +#line 2266 "awkgram.c" /* yacc.c:1646 */ break; case 44: -#line 536 "awkgram.y" /* yacc.c:1646 */ +#line 535 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2278 "awkgram.c" /* yacc.c:1646 */ +#line 2277 "awkgram.c" /* yacc.c:1646 */ break; case 45: -#line 543 "awkgram.y" /* yacc.c:1646 */ +#line 542 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2299,7 +2298,7 @@ yyreduce: } /* else curr = NULL; */ - for(; curr != NULL; curr = nextc) { + for (; curr != NULL; curr = nextc) { INSTRUCTION *caseexp = curr->case_exp; INSTRUCTION *casestmt = curr->case_stmt; @@ -2368,11 +2367,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2372 "awkgram.c" /* yacc.c:1646 */ +#line 2371 "awkgram.c" /* yacc.c:1646 */ break; case 46: -#line 633 "awkgram.y" /* yacc.c:1646 */ +#line 632 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2414,11 +2413,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2418 "awkgram.c" /* yacc.c:1646 */ +#line 2417 "awkgram.c" /* yacc.c:1646 */ break; case 47: -#line 675 "awkgram.y" /* yacc.c:1646 */ +#line 674 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2460,11 +2459,11 @@ yyreduce: } /* else $1 and $4 are NULLs */ } -#line 2464 "awkgram.c" /* yacc.c:1646 */ +#line 2463 "awkgram.c" /* yacc.c:1646 */ break; case 48: -#line 717 "awkgram.y" /* yacc.c:1646 */ +#line 716 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; char *var_name = (yyvsp[-5])->lextok; @@ -2577,44 +2576,44 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2581 "awkgram.c" /* yacc.c:1646 */ +#line 2580 "awkgram.c" /* yacc.c:1646 */ break; case 49: -#line 830 "awkgram.y" /* yacc.c:1646 */ +#line 829 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2592 "awkgram.c" /* yacc.c:1646 */ +#line 2591 "awkgram.c" /* yacc.c:1646 */ break; case 50: -#line 837 "awkgram.y" /* yacc.c:1646 */ +#line 836 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2603 "awkgram.c" /* yacc.c:1646 */ +#line 2602 "awkgram.c" /* yacc.c:1646 */ break; case 51: -#line 844 "awkgram.y" /* yacc.c:1646 */ +#line 843 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2614 "awkgram.c" /* yacc.c:1646 */ +#line 2613 "awkgram.c" /* yacc.c:1646 */ break; case 52: -#line 854 "awkgram.y" /* yacc.c:1646 */ +#line 853 "awkgram.y" /* yacc.c:1646 */ { if (! break_allowed) error_ln((yyvsp[-1])->source_line, @@ -2623,11 +2622,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2627 "awkgram.c" /* yacc.c:1646 */ +#line 2626 "awkgram.c" /* yacc.c:1646 */ break; case 53: -#line 863 "awkgram.y" /* yacc.c:1646 */ +#line 862 "awkgram.y" /* yacc.c:1646 */ { if (! continue_allowed) error_ln((yyvsp[-1])->source_line, @@ -2636,11 +2635,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2640 "awkgram.c" /* yacc.c:1646 */ +#line 2639 "awkgram.c" /* yacc.c:1646 */ break; case 54: -#line 872 "awkgram.y" /* yacc.c:1646 */ +#line 871 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2649,11 +2648,11 @@ regular_loop: (yyvsp[-1])->target_jmp = ip_rec; (yyval) = list_create((yyvsp[-1])); } -#line 2653 "awkgram.c" /* yacc.c:1646 */ +#line 2652 "awkgram.c" /* yacc.c:1646 */ break; case 55: -#line 881 "awkgram.y" /* yacc.c:1646 */ +#line 880 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2664,11 +2663,11 @@ regular_loop: (yyvsp[-1])->target_endfile = ip_endfile; (yyval) = list_create((yyvsp[-1])); } -#line 2668 "awkgram.c" /* yacc.c:1646 */ +#line 2667 "awkgram.c" /* yacc.c:1646 */ break; case 56: -#line 892 "awkgram.y" /* yacc.c:1646 */ +#line 891 "awkgram.y" /* yacc.c:1646 */ { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2683,20 +2682,20 @@ regular_loop: } else (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); } -#line 2687 "awkgram.c" /* yacc.c:1646 */ +#line 2686 "awkgram.c" /* yacc.c:1646 */ break; case 57: -#line 907 "awkgram.y" /* yacc.c:1646 */ +#line 906 "awkgram.y" /* yacc.c:1646 */ { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2696 "awkgram.c" /* yacc.c:1646 */ +#line 2695 "awkgram.c" /* yacc.c:1646 */ break; case 58: -#line 910 "awkgram.y" /* yacc.c:1646 */ +#line 909 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) { (yyval) = list_create((yyvsp[-3])); @@ -2717,17 +2716,17 @@ regular_loop: (yyval) = list_append((yyvsp[-1]), (yyvsp[-3])); } } -#line 2721 "awkgram.c" /* yacc.c:1646 */ +#line 2720 "awkgram.c" /* yacc.c:1646 */ break; case 60: -#line 942 "awkgram.y" /* yacc.c:1646 */ +#line 941 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } -#line 2727 "awkgram.c" /* yacc.c:1646 */ +#line 2726 "awkgram.c" /* yacc.c:1646 */ break; case 61: -#line 943 "awkgram.y" /* yacc.c:1646 */ +#line 942 "awkgram.y" /* yacc.c:1646 */ { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2824,17 +2823,17 @@ regular_print: } } } -#line 2828 "awkgram.c" /* yacc.c:1646 */ +#line 2827 "awkgram.c" /* yacc.c:1646 */ break; case 62: -#line 1040 "awkgram.y" /* yacc.c:1646 */ +#line 1039 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } -#line 2834 "awkgram.c" /* yacc.c:1646 */ +#line 2833 "awkgram.c" /* yacc.c:1646 */ break; case 63: -#line 1041 "awkgram.y" /* yacc.c:1646 */ +#line 1040 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-2])->lextok; @@ -2867,11 +2866,11 @@ regular_print: (yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3])); } } -#line 2871 "awkgram.c" /* yacc.c:1646 */ +#line 2870 "awkgram.c" /* yacc.c:1646 */ break; case 64: -#line 1078 "awkgram.y" /* yacc.c:1646 */ +#line 1077 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; char *arr = (yyvsp[-1])->lextok; @@ -2897,52 +2896,52 @@ regular_print: fatal(_("`delete' is not allowed with FUNCTAB")); } } -#line 2901 "awkgram.c" /* yacc.c:1646 */ +#line 2900 "awkgram.c" /* yacc.c:1646 */ break; case 65: -#line 1104 "awkgram.y" /* yacc.c:1646 */ +#line 1103 "awkgram.y" /* yacc.c:1646 */ { (yyval) = optimize_assignment((yyvsp[0])); } -#line 2907 "awkgram.c" /* yacc.c:1646 */ +#line 2906 "awkgram.c" /* yacc.c:1646 */ break; case 66: -#line 1109 "awkgram.y" /* yacc.c:1646 */ +#line 1108 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2913 "awkgram.c" /* yacc.c:1646 */ +#line 2912 "awkgram.c" /* yacc.c:1646 */ break; case 67: -#line 1111 "awkgram.y" /* yacc.c:1646 */ +#line 1110 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2919 "awkgram.c" /* yacc.c:1646 */ +#line 2918 "awkgram.c" /* yacc.c:1646 */ break; case 68: -#line 1116 "awkgram.y" /* yacc.c:1646 */ +#line 1115 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2925 "awkgram.c" /* yacc.c:1646 */ +#line 2924 "awkgram.c" /* yacc.c:1646 */ break; case 69: -#line 1118 "awkgram.y" /* yacc.c:1646 */ +#line 1117 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) (yyval) = list_create((yyvsp[0])); else (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } -#line 2936 "awkgram.c" /* yacc.c:1646 */ +#line 2935 "awkgram.c" /* yacc.c:1646 */ break; case 70: -#line 1125 "awkgram.y" /* yacc.c:1646 */ +#line 1124 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2942 "awkgram.c" /* yacc.c:1646 */ +#line 2941 "awkgram.c" /* yacc.c:1646 */ break; case 71: -#line 1130 "awkgram.y" /* yacc.c:1646 */ +#line 1129 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2954,11 +2953,11 @@ regular_print: bcfree((yyvsp[-2])); (yyval) = (yyvsp[-4]); } -#line 2958 "awkgram.c" /* yacc.c:1646 */ +#line 2957 "awkgram.c" /* yacc.c:1646 */ break; case 72: -#line 1142 "awkgram.y" /* yacc.c:1646 */ +#line 1141 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2969,17 +2968,17 @@ regular_print: (yyvsp[-3])->case_stmt = casestmt; (yyval) = (yyvsp[-3]); } -#line 2973 "awkgram.c" /* yacc.c:1646 */ +#line 2972 "awkgram.c" /* yacc.c:1646 */ break; case 73: -#line 1156 "awkgram.y" /* yacc.c:1646 */ +#line 1155 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2979 "awkgram.c" /* yacc.c:1646 */ +#line 2978 "awkgram.c" /* yacc.c:1646 */ break; case 74: -#line 1158 "awkgram.y" /* yacc.c:1646 */ +#line 1157 "awkgram.y" /* yacc.c:1646 */ { NODE *n = (yyvsp[0])->memory; (void) force_number(n); @@ -2987,71 +2986,71 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2991 "awkgram.c" /* yacc.c:1646 */ +#line 2990 "awkgram.c" /* yacc.c:1646 */ break; case 75: -#line 1166 "awkgram.y" /* yacc.c:1646 */ +#line 1165 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3000 "awkgram.c" /* yacc.c:1646 */ +#line 2999 "awkgram.c" /* yacc.c:1646 */ break; case 76: -#line 1171 "awkgram.y" /* yacc.c:1646 */ +#line 1170 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3006 "awkgram.c" /* yacc.c:1646 */ +#line 3005 "awkgram.c" /* yacc.c:1646 */ break; case 77: -#line 1173 "awkgram.y" /* yacc.c:1646 */ +#line 1172 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_push_re; (yyval) = (yyvsp[0]); } -#line 3015 "awkgram.c" /* yacc.c:1646 */ +#line 3014 "awkgram.c" /* yacc.c:1646 */ break; case 78: -#line 1181 "awkgram.y" /* yacc.c:1646 */ +#line 1180 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3021 "awkgram.c" /* yacc.c:1646 */ +#line 3020 "awkgram.c" /* yacc.c:1646 */ break; case 79: -#line 1183 "awkgram.y" /* yacc.c:1646 */ +#line 1182 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3027 "awkgram.c" /* yacc.c:1646 */ +#line 3026 "awkgram.c" /* yacc.c:1646 */ break; case 81: -#line 1193 "awkgram.y" /* yacc.c:1646 */ +#line 1192 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3035 "awkgram.c" /* yacc.c:1646 */ +#line 3034 "awkgram.c" /* yacc.c:1646 */ break; case 82: -#line 1200 "awkgram.y" /* yacc.c:1646 */ +#line 1199 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; (yyval) = NULL; } -#line 3045 "awkgram.c" /* yacc.c:1646 */ +#line 3044 "awkgram.c" /* yacc.c:1646 */ break; case 83: -#line 1205 "awkgram.y" /* yacc.c:1646 */ +#line 1204 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } -#line 3051 "awkgram.c" /* yacc.c:1646 */ +#line 3050 "awkgram.c" /* yacc.c:1646 */ break; case 84: -#line 1206 "awkgram.y" /* yacc.c:1646 */ +#line 1205 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->redir_type == redirect_twoway && (yyvsp[0])->lasti->opcode == Op_K_getline_redir @@ -3059,136 +3058,136 @@ regular_print: yyerror(_("multistage two-way pipelines don't work")); (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } -#line 3063 "awkgram.c" /* yacc.c:1646 */ +#line 3062 "awkgram.c" /* yacc.c:1646 */ break; case 85: -#line 1217 "awkgram.y" /* yacc.c:1646 */ +#line 1216 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } -#line 3071 "awkgram.c" /* yacc.c:1646 */ +#line 3070 "awkgram.c" /* yacc.c:1646 */ break; case 86: -#line 1222 "awkgram.y" /* yacc.c:1646 */ +#line 1221 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } -#line 3079 "awkgram.c" /* yacc.c:1646 */ +#line 3078 "awkgram.c" /* yacc.c:1646 */ break; case 91: -#line 1239 "awkgram.y" /* yacc.c:1646 */ +#line 1238 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3085 "awkgram.c" /* yacc.c:1646 */ +#line 3084 "awkgram.c" /* yacc.c:1646 */ break; case 92: -#line 1241 "awkgram.y" /* yacc.c:1646 */ +#line 1240 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3094 "awkgram.c" /* yacc.c:1646 */ +#line 3093 "awkgram.c" /* yacc.c:1646 */ break; case 93: -#line 1249 "awkgram.y" /* yacc.c:1646 */ +#line 1248 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3100 "awkgram.c" /* yacc.c:1646 */ +#line 3099 "awkgram.c" /* yacc.c:1646 */ break; case 94: -#line 1251 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]) ; } -#line 3106 "awkgram.c" /* yacc.c:1646 */ +#line 1250 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3105 "awkgram.c" /* yacc.c:1646 */ break; case 95: -#line 1256 "awkgram.y" /* yacc.c:1646 */ +#line 1255 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = 0; (yyval) = list_create((yyvsp[0])); } -#line 3115 "awkgram.c" /* yacc.c:1646 */ +#line 3114 "awkgram.c" /* yacc.c:1646 */ break; case 96: -#line 1261 "awkgram.y" /* yacc.c:1646 */ +#line 1260 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; (yyval) = list_append((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3125 "awkgram.c" /* yacc.c:1646 */ +#line 3124 "awkgram.c" /* yacc.c:1646 */ break; case 97: -#line 1267 "awkgram.y" /* yacc.c:1646 */ +#line 1266 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3131 "awkgram.c" /* yacc.c:1646 */ +#line 3130 "awkgram.c" /* yacc.c:1646 */ break; case 98: -#line 1269 "awkgram.y" /* yacc.c:1646 */ +#line 1268 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3137 "awkgram.c" /* yacc.c:1646 */ +#line 3136 "awkgram.c" /* yacc.c:1646 */ break; case 99: -#line 1271 "awkgram.y" /* yacc.c:1646 */ +#line 1270 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } -#line 3143 "awkgram.c" /* yacc.c:1646 */ +#line 3142 "awkgram.c" /* yacc.c:1646 */ break; case 100: -#line 1277 "awkgram.y" /* yacc.c:1646 */ +#line 1276 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3149 "awkgram.c" /* yacc.c:1646 */ +#line 3148 "awkgram.c" /* yacc.c:1646 */ break; case 101: -#line 1279 "awkgram.y" /* yacc.c:1646 */ +#line 1278 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3155 "awkgram.c" /* yacc.c:1646 */ +#line 3154 "awkgram.c" /* yacc.c:1646 */ break; case 102: -#line 1284 "awkgram.y" /* yacc.c:1646 */ +#line 1283 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3161 "awkgram.c" /* yacc.c:1646 */ +#line 3160 "awkgram.c" /* yacc.c:1646 */ break; case 103: -#line 1286 "awkgram.y" /* yacc.c:1646 */ +#line 1285 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3167 "awkgram.c" /* yacc.c:1646 */ +#line 3166 "awkgram.c" /* yacc.c:1646 */ break; case 104: -#line 1291 "awkgram.y" /* yacc.c:1646 */ +#line 1290 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3173 "awkgram.c" /* yacc.c:1646 */ +#line 3172 "awkgram.c" /* yacc.c:1646 */ break; case 105: -#line 1293 "awkgram.y" /* yacc.c:1646 */ +#line 1292 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3182 "awkgram.c" /* yacc.c:1646 */ +#line 3181 "awkgram.c" /* yacc.c:1646 */ break; case 106: -#line 1298 "awkgram.y" /* yacc.c:1646 */ +#line 1297 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3188 "awkgram.c" /* yacc.c:1646 */ +#line 3187 "awkgram.c" /* yacc.c:1646 */ break; case 107: -#line 1300 "awkgram.y" /* yacc.c:1646 */ +#line 1299 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3196,52 +3195,52 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3200 "awkgram.c" /* yacc.c:1646 */ +#line 3199 "awkgram.c" /* yacc.c:1646 */ break; case 108: -#line 1308 "awkgram.y" /* yacc.c:1646 */ +#line 1307 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3209 "awkgram.c" /* yacc.c:1646 */ +#line 3208 "awkgram.c" /* yacc.c:1646 */ break; case 109: -#line 1313 "awkgram.y" /* yacc.c:1646 */ +#line 1312 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3218 "awkgram.c" /* yacc.c:1646 */ +#line 3217 "awkgram.c" /* yacc.c:1646 */ break; case 110: -#line 1322 "awkgram.y" /* yacc.c:1646 */ +#line 1321 "awkgram.y" /* yacc.c:1646 */ { if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec) lintwarn_ln((yyvsp[-1])->source_line, _("regular expression on right of assignment")); (yyval) = mk_assignment((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3229 "awkgram.c" /* yacc.c:1646 */ +#line 3228 "awkgram.c" /* yacc.c:1646 */ break; case 111: -#line 1329 "awkgram.y" /* yacc.c:1646 */ +#line 1328 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3235 "awkgram.c" /* yacc.c:1646 */ +#line 3234 "awkgram.c" /* yacc.c:1646 */ break; case 112: -#line 1331 "awkgram.y" /* yacc.c:1646 */ +#line 1330 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3241 "awkgram.c" /* yacc.c:1646 */ +#line 3240 "awkgram.c" /* yacc.c:1646 */ break; case 113: -#line 1333 "awkgram.y" /* yacc.c:1646 */ +#line 1332 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[-1])->source_line, @@ -3257,11 +3256,11 @@ regular_print: (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } -#line 3261 "awkgram.c" /* yacc.c:1646 */ +#line 3260 "awkgram.c" /* yacc.c:1646 */ break; case 114: -#line 1349 "awkgram.y" /* yacc.c:1646 */ +#line 1348 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) warning_ln((yyvsp[-1])->source_line, @@ -3271,91 +3270,91 @@ regular_print: (yyvsp[-1])->expr_count = 1; (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3275 "awkgram.c" /* yacc.c:1646 */ +#line 3274 "awkgram.c" /* yacc.c:1646 */ break; case 115: -#line 1359 "awkgram.y" /* yacc.c:1646 */ +#line 1358 "awkgram.y" /* yacc.c:1646 */ { if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec) lintwarn_ln((yyvsp[-1])->source_line, _("regular expression on right of comparison")); (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3286 "awkgram.c" /* yacc.c:1646 */ +#line 3285 "awkgram.c" /* yacc.c:1646 */ break; case 116: -#line 1366 "awkgram.y" /* yacc.c:1646 */ +#line 1365 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3292 "awkgram.c" /* yacc.c:1646 */ +#line 3291 "awkgram.c" /* yacc.c:1646 */ break; case 117: -#line 1368 "awkgram.y" /* yacc.c:1646 */ +#line 1367 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3298 "awkgram.c" /* yacc.c:1646 */ +#line 3297 "awkgram.c" /* yacc.c:1646 */ break; case 118: -#line 1373 "awkgram.y" /* yacc.c:1646 */ +#line 1372 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3304 "awkgram.c" /* yacc.c:1646 */ +#line 3303 "awkgram.c" /* yacc.c:1646 */ break; case 119: -#line 1375 "awkgram.y" /* yacc.c:1646 */ +#line 1374 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3310 "awkgram.c" /* yacc.c:1646 */ +#line 3309 "awkgram.c" /* yacc.c:1646 */ break; case 120: -#line 1377 "awkgram.y" /* yacc.c:1646 */ +#line 1376 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_assign_quotient; (yyval) = (yyvsp[0]); } -#line 3319 "awkgram.c" /* yacc.c:1646 */ +#line 3318 "awkgram.c" /* yacc.c:1646 */ break; case 121: -#line 1385 "awkgram.y" /* yacc.c:1646 */ +#line 1384 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3325 "awkgram.c" /* yacc.c:1646 */ +#line 3324 "awkgram.c" /* yacc.c:1646 */ break; case 122: -#line 1387 "awkgram.y" /* yacc.c:1646 */ +#line 1386 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3331 "awkgram.c" /* yacc.c:1646 */ +#line 3330 "awkgram.c" /* yacc.c:1646 */ break; case 123: -#line 1392 "awkgram.y" /* yacc.c:1646 */ +#line 1391 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3337 "awkgram.c" /* yacc.c:1646 */ +#line 3336 "awkgram.c" /* yacc.c:1646 */ break; case 124: -#line 1394 "awkgram.y" /* yacc.c:1646 */ +#line 1393 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3343 "awkgram.c" /* yacc.c:1646 */ +#line 3342 "awkgram.c" /* yacc.c:1646 */ break; case 125: -#line 1399 "awkgram.y" /* yacc.c:1646 */ +#line 1398 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3349 "awkgram.c" /* yacc.c:1646 */ +#line 3348 "awkgram.c" /* yacc.c:1646 */ break; case 126: -#line 1401 "awkgram.y" /* yacc.c:1646 */ +#line 1400 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3355 "awkgram.c" /* yacc.c:1646 */ +#line 3354 "awkgram.c" /* yacc.c:1646 */ break; case 127: -#line 1403 "awkgram.y" /* yacc.c:1646 */ +#line 1402 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; @@ -3402,47 +3401,47 @@ regular_print: max_args = count; } } -#line 3406 "awkgram.c" /* yacc.c:1646 */ +#line 3405 "awkgram.c" /* yacc.c:1646 */ break; case 129: -#line 1455 "awkgram.y" /* yacc.c:1646 */ +#line 1454 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3412 "awkgram.c" /* yacc.c:1646 */ +#line 3411 "awkgram.c" /* yacc.c:1646 */ break; case 130: -#line 1457 "awkgram.y" /* yacc.c:1646 */ +#line 1456 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3418 "awkgram.c" /* yacc.c:1646 */ +#line 3417 "awkgram.c" /* yacc.c:1646 */ break; case 131: -#line 1459 "awkgram.y" /* yacc.c:1646 */ +#line 1458 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3424 "awkgram.c" /* yacc.c:1646 */ +#line 3423 "awkgram.c" /* yacc.c:1646 */ break; case 132: -#line 1461 "awkgram.y" /* yacc.c:1646 */ +#line 1460 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3430 "awkgram.c" /* yacc.c:1646 */ +#line 3429 "awkgram.c" /* yacc.c:1646 */ break; case 133: -#line 1463 "awkgram.y" /* yacc.c:1646 */ +#line 1462 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3436 "awkgram.c" /* yacc.c:1646 */ +#line 3435 "awkgram.c" /* yacc.c:1646 */ break; case 134: -#line 1465 "awkgram.y" /* yacc.c:1646 */ +#line 1464 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3442 "awkgram.c" /* yacc.c:1646 */ +#line 3441 "awkgram.c" /* yacc.c:1646 */ break; case 135: -#line 1467 "awkgram.y" /* yacc.c:1646 */ +#line 1466 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3456,29 +3455,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } -#line 3460 "awkgram.c" /* yacc.c:1646 */ +#line 3459 "awkgram.c" /* yacc.c:1646 */ break; case 136: -#line 1481 "awkgram.y" /* yacc.c:1646 */ +#line 1480 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3469 "awkgram.c" /* yacc.c:1646 */ +#line 3468 "awkgram.c" /* yacc.c:1646 */ break; case 137: -#line 1486 "awkgram.y" /* yacc.c:1646 */ +#line 1485 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3478 "awkgram.c" /* yacc.c:1646 */ +#line 3477 "awkgram.c" /* yacc.c:1646 */ break; case 138: -#line 1491 "awkgram.y" /* yacc.c:1646 */ +#line 1490 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { warning_ln((yyvsp[-1])->source_line, @@ -3498,64 +3497,64 @@ regular_print: (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } -#line 3502 "awkgram.c" /* yacc.c:1646 */ +#line 3501 "awkgram.c" /* yacc.c:1646 */ break; case 139: -#line 1516 "awkgram.y" /* yacc.c:1646 */ +#line 1515 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); bcfree((yyvsp[-2])); } -#line 3511 "awkgram.c" /* yacc.c:1646 */ +#line 3510 "awkgram.c" /* yacc.c:1646 */ break; case 140: -#line 1522 "awkgram.y" /* yacc.c:1646 */ +#line 1521 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3517 "awkgram.c" /* yacc.c:1646 */ +#line 3516 "awkgram.c" /* yacc.c:1646 */ break; case 141: -#line 1524 "awkgram.y" /* yacc.c:1646 */ +#line 1523 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3523 "awkgram.c" /* yacc.c:1646 */ +#line 3522 "awkgram.c" /* yacc.c:1646 */ break; case 142: -#line 1526 "awkgram.y" /* yacc.c:1646 */ +#line 1525 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3529 "awkgram.c" /* yacc.c:1646 */ +#line 3528 "awkgram.c" /* yacc.c:1646 */ break; case 143: -#line 1528 "awkgram.y" /* yacc.c:1646 */ +#line 1527 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3535 "awkgram.c" /* yacc.c:1646 */ +#line 3534 "awkgram.c" /* yacc.c:1646 */ break; case 144: -#line 1530 "awkgram.y" /* yacc.c:1646 */ +#line 1529 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3541 "awkgram.c" /* yacc.c:1646 */ +#line 3540 "awkgram.c" /* yacc.c:1646 */ break; case 145: -#line 1532 "awkgram.y" /* yacc.c:1646 */ +#line 1531 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3547 "awkgram.c" /* yacc.c:1646 */ +#line 3546 "awkgram.c" /* yacc.c:1646 */ break; case 146: -#line 1537 "awkgram.y" /* yacc.c:1646 */ +#line 1536 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3555 "awkgram.c" /* yacc.c:1646 */ +#line 3554 "awkgram.c" /* yacc.c:1646 */ break; case 147: -#line 1541 "awkgram.y" /* yacc.c:1646 */ +#line 1540 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->opcode == Op_match_rec) { (yyvsp[0])->opcode = Op_nomatch; @@ -3587,37 +3586,37 @@ regular_print: } } } -#line 3591 "awkgram.c" /* yacc.c:1646 */ +#line 3590 "awkgram.c" /* yacc.c:1646 */ break; case 148: -#line 1573 "awkgram.y" /* yacc.c:1646 */ +#line 1572 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3597 "awkgram.c" /* yacc.c:1646 */ +#line 3596 "awkgram.c" /* yacc.c:1646 */ break; case 149: -#line 1575 "awkgram.y" /* yacc.c:1646 */ +#line 1574 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3607 "awkgram.c" /* yacc.c:1646 */ +#line 3606 "awkgram.c" /* yacc.c:1646 */ break; case 150: -#line 1581 "awkgram.y" /* yacc.c:1646 */ +#line 1580 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3617 "awkgram.c" /* yacc.c:1646 */ +#line 3616 "awkgram.c" /* yacc.c:1646 */ break; case 151: -#line 1587 "awkgram.y" /* yacc.c:1646 */ +#line 1586 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; @@ -3630,45 +3629,45 @@ regular_print: if ((yyval) == NULL) YYABORT; } -#line 3634 "awkgram.c" /* yacc.c:1646 */ +#line 3633 "awkgram.c" /* yacc.c:1646 */ break; case 154: -#line 1602 "awkgram.y" /* yacc.c:1646 */ +#line 1601 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3643 "awkgram.c" /* yacc.c:1646 */ +#line 3642 "awkgram.c" /* yacc.c:1646 */ break; case 155: -#line 1607 "awkgram.y" /* yacc.c:1646 */ +#line 1606 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3652 "awkgram.c" /* yacc.c:1646 */ +#line 3651 "awkgram.c" /* yacc.c:1646 */ break; case 156: -#line 1612 "awkgram.y" /* yacc.c:1646 */ +#line 1611 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3660 "awkgram.c" /* yacc.c:1646 */ +#line 3659 "awkgram.c" /* yacc.c:1646 */ break; case 157: -#line 1616 "awkgram.y" /* yacc.c:1646 */ +#line 1615 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3668 "awkgram.c" /* yacc.c:1646 */ +#line 3667 "awkgram.c" /* yacc.c:1646 */ break; case 158: -#line 1620 "awkgram.y" /* yacc.c:1646 */ +#line 1619 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0 @@ -3683,11 +3682,11 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3687 "awkgram.c" /* yacc.c:1646 */ +#line 3686 "awkgram.c" /* yacc.c:1646 */ break; case 159: -#line 1635 "awkgram.y" /* yacc.c:1646 */ +#line 1634 "awkgram.y" /* yacc.c:1646 */ { /* * was: $$ = $2 @@ -3697,20 +3696,20 @@ regular_print: (yyvsp[-1])->memory = make_number(0.0); (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } -#line 3701 "awkgram.c" /* yacc.c:1646 */ +#line 3700 "awkgram.c" /* yacc.c:1646 */ break; case 160: -#line 1648 "awkgram.y" /* yacc.c:1646 */ +#line 1647 "awkgram.y" /* yacc.c:1646 */ { func_use((yyvsp[0])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[0]); } -#line 3710 "awkgram.c" /* yacc.c:1646 */ +#line 3709 "awkgram.c" /* yacc.c:1646 */ break; case 161: -#line 1653 "awkgram.y" /* yacc.c:1646 */ +#line 1652 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3743,11 +3742,11 @@ regular_print: (yyval) = list_prepend((yyvsp[0]), t); } -#line 3747 "awkgram.c" /* yacc.c:1646 */ +#line 3746 "awkgram.c" /* yacc.c:1646 */ break; case 162: -#line 1689 "awkgram.y" /* yacc.c:1646 */ +#line 1688 "awkgram.y" /* yacc.c:1646 */ { param_sanity((yyvsp[-1])); (yyvsp[-3])->opcode = Op_func_call; @@ -3761,49 +3760,49 @@ regular_print: (yyval) = list_append(t, (yyvsp[-3])); } } -#line 3765 "awkgram.c" /* yacc.c:1646 */ +#line 3764 "awkgram.c" /* yacc.c:1646 */ break; case 163: -#line 1706 "awkgram.y" /* yacc.c:1646 */ +#line 1705 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3771 "awkgram.c" /* yacc.c:1646 */ +#line 3770 "awkgram.c" /* yacc.c:1646 */ break; case 164: -#line 1708 "awkgram.y" /* yacc.c:1646 */ +#line 1707 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3777 "awkgram.c" /* yacc.c:1646 */ +#line 3776 "awkgram.c" /* yacc.c:1646 */ break; case 165: -#line 1713 "awkgram.y" /* yacc.c:1646 */ +#line 1712 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3783 "awkgram.c" /* yacc.c:1646 */ +#line 3782 "awkgram.c" /* yacc.c:1646 */ break; case 166: -#line 1715 "awkgram.y" /* yacc.c:1646 */ +#line 1714 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3789 "awkgram.c" /* yacc.c:1646 */ +#line 3788 "awkgram.c" /* yacc.c:1646 */ break; case 167: -#line 1720 "awkgram.y" /* yacc.c:1646 */ +#line 1719 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3795 "awkgram.c" /* yacc.c:1646 */ +#line 3794 "awkgram.c" /* yacc.c:1646 */ break; case 168: -#line 1722 "awkgram.y" /* yacc.c:1646 */ +#line 1721 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3803 "awkgram.c" /* yacc.c:1646 */ +#line 3802 "awkgram.c" /* yacc.c:1646 */ break; case 169: -#line 1729 "awkgram.y" /* yacc.c:1646 */ +#line 1728 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3817,11 +3816,11 @@ regular_print: sub_counter++; /* count # of dimensions */ (yyval) = (yyvsp[0]); } -#line 3821 "awkgram.c" /* yacc.c:1646 */ +#line 3820 "awkgram.c" /* yacc.c:1646 */ break; case 170: -#line 1746 "awkgram.y" /* yacc.c:1646 */ +#line 1745 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *t = (yyvsp[-1]); if ((yyvsp[-1]) == NULL) { @@ -3835,31 +3834,31 @@ regular_print: (yyvsp[0])->sub_count = count_expressions(&t, false); (yyval) = list_append(t, (yyvsp[0])); } -#line 3839 "awkgram.c" /* yacc.c:1646 */ +#line 3838 "awkgram.c" /* yacc.c:1646 */ break; case 171: -#line 1763 "awkgram.y" /* yacc.c:1646 */ +#line 1762 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3845 "awkgram.c" /* yacc.c:1646 */ +#line 3844 "awkgram.c" /* yacc.c:1646 */ break; case 172: -#line 1765 "awkgram.y" /* yacc.c:1646 */ +#line 1764 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3853 "awkgram.c" /* yacc.c:1646 */ +#line 3852 "awkgram.c" /* yacc.c:1646 */ break; case 173: -#line 1772 "awkgram.y" /* yacc.c:1646 */ +#line 1771 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3859 "awkgram.c" /* yacc.c:1646 */ +#line 3858 "awkgram.c" /* yacc.c:1646 */ break; case 174: -#line 1777 "awkgram.y" /* yacc.c:1646 */ +#line 1776 "awkgram.y" /* yacc.c:1646 */ { char *var_name = (yyvsp[0])->lextok; @@ -3867,22 +3866,22 @@ regular_print: (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); (yyval) = list_create((yyvsp[0])); } -#line 3871 "awkgram.c" /* yacc.c:1646 */ +#line 3870 "awkgram.c" /* yacc.c:1646 */ break; case 175: -#line 1785 "awkgram.y" /* yacc.c:1646 */ +#line 1784 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-1])->lextok; (yyvsp[-1])->memory = variable((yyvsp[-1])->source_line, arr, Node_var_new); (yyvsp[-1])->opcode = Op_push_array; (yyval) = list_prepend((yyvsp[0]), (yyvsp[-1])); } -#line 3882 "awkgram.c" /* yacc.c:1646 */ +#line 3881 "awkgram.c" /* yacc.c:1646 */ break; case 176: -#line 1795 "awkgram.y" /* yacc.c:1646 */ +#line 1794 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push @@ -3894,73 +3893,73 @@ regular_print: } else (yyval) = (yyvsp[0]); } -#line 3898 "awkgram.c" /* yacc.c:1646 */ +#line 3897 "awkgram.c" /* yacc.c:1646 */ break; case 177: -#line 1807 "awkgram.y" /* yacc.c:1646 */ +#line 1806 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); if ((yyvsp[0]) != NULL) mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3908 "awkgram.c" /* yacc.c:1646 */ +#line 3907 "awkgram.c" /* yacc.c:1646 */ break; case 178: -#line 1816 "awkgram.y" /* yacc.c:1646 */ +#line 1815 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; } -#line 3916 "awkgram.c" /* yacc.c:1646 */ +#line 3915 "awkgram.c" /* yacc.c:1646 */ break; case 179: -#line 1820 "awkgram.y" /* yacc.c:1646 */ +#line 1819 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; } -#line 3924 "awkgram.c" /* yacc.c:1646 */ +#line 3923 "awkgram.c" /* yacc.c:1646 */ break; case 180: -#line 1823 "awkgram.y" /* yacc.c:1646 */ +#line 1822 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3930 "awkgram.c" /* yacc.c:1646 */ +#line 3929 "awkgram.c" /* yacc.c:1646 */ break; case 182: -#line 1831 "awkgram.y" /* yacc.c:1646 */ +#line 1830 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3936 "awkgram.c" /* yacc.c:1646 */ +#line 3935 "awkgram.c" /* yacc.c:1646 */ break; case 183: -#line 1835 "awkgram.y" /* yacc.c:1646 */ +#line 1834 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3942 "awkgram.c" /* yacc.c:1646 */ +#line 3941 "awkgram.c" /* yacc.c:1646 */ break; case 186: -#line 1844 "awkgram.y" /* yacc.c:1646 */ +#line 1843 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3948 "awkgram.c" /* yacc.c:1646 */ +#line 3947 "awkgram.c" /* yacc.c:1646 */ break; case 187: -#line 1848 "awkgram.y" /* yacc.c:1646 */ +#line 1847 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); yyerrok; } -#line 3954 "awkgram.c" /* yacc.c:1646 */ +#line 3953 "awkgram.c" /* yacc.c:1646 */ break; case 188: -#line 1852 "awkgram.y" /* yacc.c:1646 */ +#line 1851 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3960 "awkgram.c" /* yacc.c:1646 */ +#line 3959 "awkgram.c" /* yacc.c:1646 */ break; -#line 3964 "awkgram.c" /* yacc.c:1646 */ +#line 3963 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4188,7 +4187,7 @@ yyreturn: #endif return yyresult; } -#line 1854 "awkgram.y" /* yacc.c:1906 */ +#line 1853 "awkgram.y" /* yacc.c:1906 */ struct token { @@ -5256,7 +5255,7 @@ again: mbstate_t tmp_state; size_t mbclen; - for (idx = 0 ; lexptr + idx < lexend ; idx++) { + for (idx = 0; lexptr + idx < lexend; idx++) { tmp_state = cur_mbstate; mbclen = mbrlen(lexptr, idx + 1, &tmp_state); @@ -5337,7 +5336,8 @@ pushback(void) /* get_comment --- collect comment text */ -int get_comment(void) +int +get_comment(void) { int c; int sl; @@ -5358,7 +5358,7 @@ int get_comment(void) sourceline++; tokadd(c); } - } while (isspace(c) && c != END_FILE) ; + } while (isspace(c) && c != END_FILE); if ( c == END_FILE) break; else if (c != '#') { @@ -5378,11 +5378,11 @@ int get_comment(void) /* split_comment --- split initial comment text into program and function parts */ -void split_comment(void) +static void +split_comment(void) { char *p; int l; - int j; NODE *n; p = comment->memory->stptr; -- cgit v1.2.3 From 4959339c8a962b54bf33fd9e3d9f46b3f1c3c29e Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 2 Oct 2014 20:06:36 +0300 Subject: Code review and minor whitespace cleanups. --- awkgram.c | 677 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 342 insertions(+), 335 deletions(-) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index 628d398f..637eb436 100644 --- a/awkgram.c +++ b/awkgram.c @@ -659,24 +659,24 @@ static const yytype_uint8 yytranslate[] = static const yytype_uint16 yyrline[] = { 0, 205, 205, 207, 212, 213, 219, 231, 235, 246, - 252, 257, 265, 273, 275, 280, 288, 290, 296, 303, - 312, 338, 350, 362, 369, 379, 391, 393, 395, 401, - 406, 407, 411, 446, 445, 479, 481, 486, 492, 520, - 525, 526, 530, 532, 534, 541, 631, 673, 715, 828, - 835, 842, 852, 861, 870, 879, 890, 906, 905, 929, - 941, 941, 1039, 1039, 1072, 1102, 1108, 1109, 1115, 1116, - 1123, 1128, 1140, 1154, 1156, 1164, 1169, 1171, 1179, 1181, - 1190, 1191, 1199, 1204, 1204, 1215, 1219, 1227, 1228, 1231, - 1233, 1238, 1239, 1248, 1249, 1254, 1259, 1265, 1267, 1269, - 1276, 1277, 1283, 1284, 1289, 1291, 1296, 1298, 1306, 1311, - 1320, 1327, 1329, 1331, 1347, 1357, 1364, 1366, 1371, 1373, - 1375, 1383, 1385, 1390, 1392, 1397, 1399, 1401, 1451, 1453, - 1455, 1457, 1459, 1461, 1463, 1465, 1479, 1484, 1489, 1514, - 1520, 1522, 1524, 1526, 1528, 1530, 1535, 1539, 1571, 1573, - 1579, 1585, 1598, 1599, 1600, 1605, 1610, 1614, 1618, 1633, - 1646, 1651, 1687, 1705, 1706, 1712, 1713, 1718, 1720, 1727, - 1744, 1761, 1763, 1770, 1775, 1783, 1793, 1805, 1814, 1818, - 1822, 1826, 1830, 1834, 1837, 1839, 1843, 1847, 1851 + 252, 257, 265, 273, 275, 280, 288, 290, 296, 304, + 314, 340, 353, 366, 373, 383, 395, 397, 399, 405, + 410, 411, 415, 450, 449, 483, 485, 490, 496, 524, + 529, 530, 534, 536, 538, 545, 635, 677, 719, 832, + 839, 846, 856, 865, 874, 883, 894, 910, 909, 933, + 945, 945, 1043, 1043, 1076, 1106, 1112, 1113, 1119, 1120, + 1127, 1132, 1144, 1158, 1160, 1168, 1173, 1175, 1183, 1185, + 1194, 1195, 1203, 1208, 1208, 1219, 1223, 1231, 1232, 1235, + 1237, 1242, 1243, 1252, 1253, 1258, 1263, 1269, 1271, 1273, + 1280, 1281, 1287, 1288, 1293, 1295, 1300, 1302, 1310, 1315, + 1324, 1331, 1333, 1335, 1351, 1361, 1368, 1370, 1375, 1377, + 1379, 1387, 1389, 1394, 1396, 1401, 1403, 1405, 1455, 1457, + 1459, 1461, 1463, 1465, 1467, 1469, 1483, 1488, 1493, 1518, + 1524, 1526, 1528, 1530, 1532, 1534, 1539, 1543, 1575, 1577, + 1583, 1589, 1602, 1603, 1604, 1609, 1614, 1618, 1622, 1637, + 1650, 1655, 1691, 1709, 1710, 1716, 1717, 1722, 1724, 1731, + 1748, 1765, 1767, 1774, 1779, 1787, 1797, 1809, 1818, 1822, + 1826, 1830, 1834, 1838, 1841, 1843, 1847, 1851, 1855 }; #endif @@ -1981,30 +1981,32 @@ yyreduce: case 18: #line 296 "awkgram.y" /* yacc.c:1646 */ - { rule = Rule; + { + rule = Rule; if (comment != NULL) { (yyval) = list_create(comment); comment = NULL; } else (yyval) = NULL; } -#line 1992 "awkgram.c" /* yacc.c:1646 */ +#line 1993 "awkgram.c" /* yacc.c:1646 */ break; case 19: -#line 304 "awkgram.y" /* yacc.c:1646 */ - { rule = Rule; +#line 305 "awkgram.y" /* yacc.c:1646 */ + { + rule = Rule; if (comment != NULL) { (yyval) = list_prepend((yyvsp[0]), comment); comment = NULL; } else (yyval) = (yyvsp[0]); } -#line 2004 "awkgram.c" /* yacc.c:1646 */ +#line 2006 "awkgram.c" /* yacc.c:1646 */ break; case 20: -#line 313 "awkgram.y" /* yacc.c:1646 */ +#line 315 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *tp; @@ -2030,13 +2032,14 @@ yyreduce: (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); rule = Rule; } -#line 2034 "awkgram.c" /* yacc.c:1646 */ +#line 2036 "awkgram.c" /* yacc.c:1646 */ break; case 21: -#line 339 "awkgram.y" /* yacc.c:1646 */ +#line 341 "awkgram.y" /* yacc.c:1646 */ { static int begin_seen = 0; + func_first = false; if (do_lint_old && ++begin_seen == 2) warning_ln((yyvsp[0])->source_line, @@ -2046,13 +2049,14 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2050 "awkgram.c" /* yacc.c:1646 */ +#line 2053 "awkgram.c" /* yacc.c:1646 */ break; case 22: -#line 351 "awkgram.y" /* yacc.c:1646 */ +#line 354 "awkgram.y" /* yacc.c:1646 */ { static int end_seen = 0; + func_first = false; if (do_lint_old && ++end_seen == 2) warning_ln((yyvsp[0])->source_line, @@ -2062,33 +2066,33 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2066 "awkgram.c" /* yacc.c:1646 */ +#line 2070 "awkgram.c" /* yacc.c:1646 */ break; case 23: -#line 363 "awkgram.y" /* yacc.c:1646 */ +#line 367 "awkgram.y" /* yacc.c:1646 */ { func_first = false; (yyvsp[0])->in_rule = rule = BEGINFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2077 "awkgram.c" /* yacc.c:1646 */ +#line 2081 "awkgram.c" /* yacc.c:1646 */ break; case 24: -#line 370 "awkgram.y" /* yacc.c:1646 */ +#line 374 "awkgram.y" /* yacc.c:1646 */ { func_first = false; (yyvsp[0])->in_rule = rule = ENDFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2088 "awkgram.c" /* yacc.c:1646 */ +#line 2092 "awkgram.c" /* yacc.c:1646 */ break; case 25: -#line 380 "awkgram.y" /* yacc.c:1646 */ +#line 384 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; if ((yyvsp[-3]) == NULL) @@ -2097,39 +2101,39 @@ yyreduce: ip = (yyvsp[-3]); (yyval) = ip; } -#line 2101 "awkgram.c" /* yacc.c:1646 */ +#line 2105 "awkgram.c" /* yacc.c:1646 */ break; case 26: -#line 392 "awkgram.y" /* yacc.c:1646 */ +#line 396 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2107 "awkgram.c" /* yacc.c:1646 */ +#line 2111 "awkgram.c" /* yacc.c:1646 */ break; case 27: -#line 394 "awkgram.y" /* yacc.c:1646 */ +#line 398 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2113 "awkgram.c" /* yacc.c:1646 */ +#line 2117 "awkgram.c" /* yacc.c:1646 */ break; case 28: -#line 396 "awkgram.y" /* yacc.c:1646 */ +#line 400 "awkgram.y" /* yacc.c:1646 */ { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); YYABORT; } -#line 2123 "awkgram.c" /* yacc.c:1646 */ +#line 2127 "awkgram.c" /* yacc.c:1646 */ break; case 29: -#line 402 "awkgram.y" /* yacc.c:1646 */ +#line 406 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2129 "awkgram.c" /* yacc.c:1646 */ +#line 2133 "awkgram.c" /* yacc.c:1646 */ break; case 32: -#line 412 "awkgram.y" /* yacc.c:1646 */ +#line 416 "awkgram.y" /* yacc.c:1646 */ { /* * treat any comments between BOF and the first function @@ -2156,17 +2160,17 @@ yyreduce: /* $4 already free'd in install_function */ (yyval) = (yyvsp[-5]); } -#line 2160 "awkgram.c" /* yacc.c:1646 */ +#line 2164 "awkgram.c" /* yacc.c:1646 */ break; case 33: -#line 446 "awkgram.y" /* yacc.c:1646 */ +#line 450 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } -#line 2166 "awkgram.c" /* yacc.c:1646 */ +#line 2170 "awkgram.c" /* yacc.c:1646 */ break; case 34: -#line 448 "awkgram.y" /* yacc.c:1646 */ +#line 452 "awkgram.y" /* yacc.c:1646 */ { NODE *n, *exp; char *re; @@ -2195,28 +2199,28 @@ yyreduce: (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2199 "awkgram.c" /* yacc.c:1646 */ +#line 2203 "awkgram.c" /* yacc.c:1646 */ break; case 35: -#line 480 "awkgram.y" /* yacc.c:1646 */ +#line 484 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[0])); } -#line 2205 "awkgram.c" /* yacc.c:1646 */ +#line 2209 "awkgram.c" /* yacc.c:1646 */ break; case 37: -#line 486 "awkgram.y" /* yacc.c:1646 */ +#line 490 "awkgram.y" /* yacc.c:1646 */ { if (comment != NULL) { (yyval) = list_create(comment); comment = NULL; } else (yyval) = NULL; } -#line 2216 "awkgram.c" /* yacc.c:1646 */ +#line 2220 "awkgram.c" /* yacc.c:1646 */ break; case 38: -#line 493 "awkgram.y" /* yacc.c:1646 */ +#line 497 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0]) == NULL) { if (comment == NULL) @@ -2244,40 +2248,40 @@ yyreduce: } yyerrok; } -#line 2248 "awkgram.c" /* yacc.c:1646 */ +#line 2252 "awkgram.c" /* yacc.c:1646 */ break; case 39: -#line 521 "awkgram.y" /* yacc.c:1646 */ +#line 525 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2254 "awkgram.c" /* yacc.c:1646 */ +#line 2258 "awkgram.c" /* yacc.c:1646 */ break; case 42: -#line 531 "awkgram.y" /* yacc.c:1646 */ +#line 535 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2260 "awkgram.c" /* yacc.c:1646 */ +#line 2264 "awkgram.c" /* yacc.c:1646 */ break; case 43: -#line 533 "awkgram.y" /* yacc.c:1646 */ +#line 537 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2266 "awkgram.c" /* yacc.c:1646 */ +#line 2270 "awkgram.c" /* yacc.c:1646 */ break; case 44: -#line 535 "awkgram.y" /* yacc.c:1646 */ +#line 539 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2277 "awkgram.c" /* yacc.c:1646 */ +#line 2281 "awkgram.c" /* yacc.c:1646 */ break; case 45: -#line 542 "awkgram.y" /* yacc.c:1646 */ +#line 546 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2367,11 +2371,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2371 "awkgram.c" /* yacc.c:1646 */ +#line 2375 "awkgram.c" /* yacc.c:1646 */ break; case 46: -#line 632 "awkgram.y" /* yacc.c:1646 */ +#line 636 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2413,11 +2417,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2417 "awkgram.c" /* yacc.c:1646 */ +#line 2421 "awkgram.c" /* yacc.c:1646 */ break; case 47: -#line 674 "awkgram.y" /* yacc.c:1646 */ +#line 678 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2459,11 +2463,11 @@ yyreduce: } /* else $1 and $4 are NULLs */ } -#line 2463 "awkgram.c" /* yacc.c:1646 */ +#line 2467 "awkgram.c" /* yacc.c:1646 */ break; case 48: -#line 716 "awkgram.y" /* yacc.c:1646 */ +#line 720 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; char *var_name = (yyvsp[-5])->lextok; @@ -2576,44 +2580,44 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2580 "awkgram.c" /* yacc.c:1646 */ +#line 2584 "awkgram.c" /* yacc.c:1646 */ break; case 49: -#line 829 "awkgram.y" /* yacc.c:1646 */ +#line 833 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2591 "awkgram.c" /* yacc.c:1646 */ +#line 2595 "awkgram.c" /* yacc.c:1646 */ break; case 50: -#line 836 "awkgram.y" /* yacc.c:1646 */ +#line 840 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2602 "awkgram.c" /* yacc.c:1646 */ +#line 2606 "awkgram.c" /* yacc.c:1646 */ break; case 51: -#line 843 "awkgram.y" /* yacc.c:1646 */ +#line 847 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2613 "awkgram.c" /* yacc.c:1646 */ +#line 2617 "awkgram.c" /* yacc.c:1646 */ break; case 52: -#line 853 "awkgram.y" /* yacc.c:1646 */ +#line 857 "awkgram.y" /* yacc.c:1646 */ { if (! break_allowed) error_ln((yyvsp[-1])->source_line, @@ -2622,11 +2626,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2626 "awkgram.c" /* yacc.c:1646 */ +#line 2630 "awkgram.c" /* yacc.c:1646 */ break; case 53: -#line 862 "awkgram.y" /* yacc.c:1646 */ +#line 866 "awkgram.y" /* yacc.c:1646 */ { if (! continue_allowed) error_ln((yyvsp[-1])->source_line, @@ -2635,11 +2639,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2639 "awkgram.c" /* yacc.c:1646 */ +#line 2643 "awkgram.c" /* yacc.c:1646 */ break; case 54: -#line 871 "awkgram.y" /* yacc.c:1646 */ +#line 875 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2648,11 +2652,11 @@ regular_loop: (yyvsp[-1])->target_jmp = ip_rec; (yyval) = list_create((yyvsp[-1])); } -#line 2652 "awkgram.c" /* yacc.c:1646 */ +#line 2656 "awkgram.c" /* yacc.c:1646 */ break; case 55: -#line 880 "awkgram.y" /* yacc.c:1646 */ +#line 884 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2663,11 +2667,11 @@ regular_loop: (yyvsp[-1])->target_endfile = ip_endfile; (yyval) = list_create((yyvsp[-1])); } -#line 2667 "awkgram.c" /* yacc.c:1646 */ +#line 2671 "awkgram.c" /* yacc.c:1646 */ break; case 56: -#line 891 "awkgram.y" /* yacc.c:1646 */ +#line 895 "awkgram.y" /* yacc.c:1646 */ { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2682,20 +2686,20 @@ regular_loop: } else (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); } -#line 2686 "awkgram.c" /* yacc.c:1646 */ +#line 2690 "awkgram.c" /* yacc.c:1646 */ break; case 57: -#line 906 "awkgram.y" /* yacc.c:1646 */ +#line 910 "awkgram.y" /* yacc.c:1646 */ { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2695 "awkgram.c" /* yacc.c:1646 */ +#line 2699 "awkgram.c" /* yacc.c:1646 */ break; case 58: -#line 909 "awkgram.y" /* yacc.c:1646 */ +#line 913 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) { (yyval) = list_create((yyvsp[-3])); @@ -2716,17 +2720,17 @@ regular_loop: (yyval) = list_append((yyvsp[-1]), (yyvsp[-3])); } } -#line 2720 "awkgram.c" /* yacc.c:1646 */ +#line 2724 "awkgram.c" /* yacc.c:1646 */ break; case 60: -#line 941 "awkgram.y" /* yacc.c:1646 */ +#line 945 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } -#line 2726 "awkgram.c" /* yacc.c:1646 */ +#line 2730 "awkgram.c" /* yacc.c:1646 */ break; case 61: -#line 942 "awkgram.y" /* yacc.c:1646 */ +#line 946 "awkgram.y" /* yacc.c:1646 */ { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2823,17 +2827,17 @@ regular_print: } } } -#line 2827 "awkgram.c" /* yacc.c:1646 */ +#line 2831 "awkgram.c" /* yacc.c:1646 */ break; case 62: -#line 1039 "awkgram.y" /* yacc.c:1646 */ +#line 1043 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } -#line 2833 "awkgram.c" /* yacc.c:1646 */ +#line 2837 "awkgram.c" /* yacc.c:1646 */ break; case 63: -#line 1040 "awkgram.y" /* yacc.c:1646 */ +#line 1044 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-2])->lextok; @@ -2866,11 +2870,11 @@ regular_print: (yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3])); } } -#line 2870 "awkgram.c" /* yacc.c:1646 */ +#line 2874 "awkgram.c" /* yacc.c:1646 */ break; case 64: -#line 1077 "awkgram.y" /* yacc.c:1646 */ +#line 1081 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; char *arr = (yyvsp[-1])->lextok; @@ -2896,52 +2900,52 @@ regular_print: fatal(_("`delete' is not allowed with FUNCTAB")); } } -#line 2900 "awkgram.c" /* yacc.c:1646 */ +#line 2904 "awkgram.c" /* yacc.c:1646 */ break; case 65: -#line 1103 "awkgram.y" /* yacc.c:1646 */ +#line 1107 "awkgram.y" /* yacc.c:1646 */ { (yyval) = optimize_assignment((yyvsp[0])); } -#line 2906 "awkgram.c" /* yacc.c:1646 */ +#line 2910 "awkgram.c" /* yacc.c:1646 */ break; case 66: -#line 1108 "awkgram.y" /* yacc.c:1646 */ +#line 1112 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2912 "awkgram.c" /* yacc.c:1646 */ +#line 2916 "awkgram.c" /* yacc.c:1646 */ break; case 67: -#line 1110 "awkgram.y" /* yacc.c:1646 */ +#line 1114 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2918 "awkgram.c" /* yacc.c:1646 */ +#line 2922 "awkgram.c" /* yacc.c:1646 */ break; case 68: -#line 1115 "awkgram.y" /* yacc.c:1646 */ +#line 1119 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2924 "awkgram.c" /* yacc.c:1646 */ +#line 2928 "awkgram.c" /* yacc.c:1646 */ break; case 69: -#line 1117 "awkgram.y" /* yacc.c:1646 */ +#line 1121 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) (yyval) = list_create((yyvsp[0])); else (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } -#line 2935 "awkgram.c" /* yacc.c:1646 */ +#line 2939 "awkgram.c" /* yacc.c:1646 */ break; case 70: -#line 1124 "awkgram.y" /* yacc.c:1646 */ +#line 1128 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2941 "awkgram.c" /* yacc.c:1646 */ +#line 2945 "awkgram.c" /* yacc.c:1646 */ break; case 71: -#line 1129 "awkgram.y" /* yacc.c:1646 */ +#line 1133 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2953,11 +2957,11 @@ regular_print: bcfree((yyvsp[-2])); (yyval) = (yyvsp[-4]); } -#line 2957 "awkgram.c" /* yacc.c:1646 */ +#line 2961 "awkgram.c" /* yacc.c:1646 */ break; case 72: -#line 1141 "awkgram.y" /* yacc.c:1646 */ +#line 1145 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2968,17 +2972,17 @@ regular_print: (yyvsp[-3])->case_stmt = casestmt; (yyval) = (yyvsp[-3]); } -#line 2972 "awkgram.c" /* yacc.c:1646 */ +#line 2976 "awkgram.c" /* yacc.c:1646 */ break; case 73: -#line 1155 "awkgram.y" /* yacc.c:1646 */ +#line 1159 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2978 "awkgram.c" /* yacc.c:1646 */ +#line 2982 "awkgram.c" /* yacc.c:1646 */ break; case 74: -#line 1157 "awkgram.y" /* yacc.c:1646 */ +#line 1161 "awkgram.y" /* yacc.c:1646 */ { NODE *n = (yyvsp[0])->memory; (void) force_number(n); @@ -2986,71 +2990,71 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2990 "awkgram.c" /* yacc.c:1646 */ +#line 2994 "awkgram.c" /* yacc.c:1646 */ break; case 75: -#line 1165 "awkgram.y" /* yacc.c:1646 */ +#line 1169 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2999 "awkgram.c" /* yacc.c:1646 */ +#line 3003 "awkgram.c" /* yacc.c:1646 */ break; case 76: -#line 1170 "awkgram.y" /* yacc.c:1646 */ +#line 1174 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3005 "awkgram.c" /* yacc.c:1646 */ +#line 3009 "awkgram.c" /* yacc.c:1646 */ break; case 77: -#line 1172 "awkgram.y" /* yacc.c:1646 */ +#line 1176 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_push_re; (yyval) = (yyvsp[0]); } -#line 3014 "awkgram.c" /* yacc.c:1646 */ +#line 3018 "awkgram.c" /* yacc.c:1646 */ break; case 78: -#line 1180 "awkgram.y" /* yacc.c:1646 */ +#line 1184 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3020 "awkgram.c" /* yacc.c:1646 */ +#line 3024 "awkgram.c" /* yacc.c:1646 */ break; case 79: -#line 1182 "awkgram.y" /* yacc.c:1646 */ +#line 1186 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3026 "awkgram.c" /* yacc.c:1646 */ +#line 3030 "awkgram.c" /* yacc.c:1646 */ break; case 81: -#line 1192 "awkgram.y" /* yacc.c:1646 */ +#line 1196 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3034 "awkgram.c" /* yacc.c:1646 */ +#line 3038 "awkgram.c" /* yacc.c:1646 */ break; case 82: -#line 1199 "awkgram.y" /* yacc.c:1646 */ +#line 1203 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; (yyval) = NULL; } -#line 3044 "awkgram.c" /* yacc.c:1646 */ +#line 3048 "awkgram.c" /* yacc.c:1646 */ break; case 83: -#line 1204 "awkgram.y" /* yacc.c:1646 */ +#line 1208 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } -#line 3050 "awkgram.c" /* yacc.c:1646 */ +#line 3054 "awkgram.c" /* yacc.c:1646 */ break; case 84: -#line 1205 "awkgram.y" /* yacc.c:1646 */ +#line 1209 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->redir_type == redirect_twoway && (yyvsp[0])->lasti->opcode == Op_K_getline_redir @@ -3058,136 +3062,136 @@ regular_print: yyerror(_("multistage two-way pipelines don't work")); (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } -#line 3062 "awkgram.c" /* yacc.c:1646 */ +#line 3066 "awkgram.c" /* yacc.c:1646 */ break; case 85: -#line 1216 "awkgram.y" /* yacc.c:1646 */ +#line 1220 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } -#line 3070 "awkgram.c" /* yacc.c:1646 */ +#line 3074 "awkgram.c" /* yacc.c:1646 */ break; case 86: -#line 1221 "awkgram.y" /* yacc.c:1646 */ +#line 1225 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } -#line 3078 "awkgram.c" /* yacc.c:1646 */ +#line 3082 "awkgram.c" /* yacc.c:1646 */ break; case 91: -#line 1238 "awkgram.y" /* yacc.c:1646 */ +#line 1242 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3084 "awkgram.c" /* yacc.c:1646 */ +#line 3088 "awkgram.c" /* yacc.c:1646 */ break; case 92: -#line 1240 "awkgram.y" /* yacc.c:1646 */ +#line 1244 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3093 "awkgram.c" /* yacc.c:1646 */ +#line 3097 "awkgram.c" /* yacc.c:1646 */ break; case 93: -#line 1248 "awkgram.y" /* yacc.c:1646 */ +#line 1252 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3099 "awkgram.c" /* yacc.c:1646 */ +#line 3103 "awkgram.c" /* yacc.c:1646 */ break; case 94: -#line 1250 "awkgram.y" /* yacc.c:1646 */ +#line 1254 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3105 "awkgram.c" /* yacc.c:1646 */ +#line 3109 "awkgram.c" /* yacc.c:1646 */ break; case 95: -#line 1255 "awkgram.y" /* yacc.c:1646 */ +#line 1259 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = 0; (yyval) = list_create((yyvsp[0])); } -#line 3114 "awkgram.c" /* yacc.c:1646 */ +#line 3118 "awkgram.c" /* yacc.c:1646 */ break; case 96: -#line 1260 "awkgram.y" /* yacc.c:1646 */ +#line 1264 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; (yyval) = list_append((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3124 "awkgram.c" /* yacc.c:1646 */ +#line 3128 "awkgram.c" /* yacc.c:1646 */ break; case 97: -#line 1266 "awkgram.y" /* yacc.c:1646 */ +#line 1270 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3130 "awkgram.c" /* yacc.c:1646 */ +#line 3134 "awkgram.c" /* yacc.c:1646 */ break; case 98: -#line 1268 "awkgram.y" /* yacc.c:1646 */ +#line 1272 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3136 "awkgram.c" /* yacc.c:1646 */ +#line 3140 "awkgram.c" /* yacc.c:1646 */ break; case 99: -#line 1270 "awkgram.y" /* yacc.c:1646 */ +#line 1274 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } -#line 3142 "awkgram.c" /* yacc.c:1646 */ +#line 3146 "awkgram.c" /* yacc.c:1646 */ break; case 100: -#line 1276 "awkgram.y" /* yacc.c:1646 */ +#line 1280 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3148 "awkgram.c" /* yacc.c:1646 */ +#line 3152 "awkgram.c" /* yacc.c:1646 */ break; case 101: -#line 1278 "awkgram.y" /* yacc.c:1646 */ +#line 1282 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3154 "awkgram.c" /* yacc.c:1646 */ +#line 3158 "awkgram.c" /* yacc.c:1646 */ break; case 102: -#line 1283 "awkgram.y" /* yacc.c:1646 */ +#line 1287 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3160 "awkgram.c" /* yacc.c:1646 */ +#line 3164 "awkgram.c" /* yacc.c:1646 */ break; case 103: -#line 1285 "awkgram.y" /* yacc.c:1646 */ +#line 1289 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3166 "awkgram.c" /* yacc.c:1646 */ +#line 3170 "awkgram.c" /* yacc.c:1646 */ break; case 104: -#line 1290 "awkgram.y" /* yacc.c:1646 */ +#line 1294 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3172 "awkgram.c" /* yacc.c:1646 */ +#line 3176 "awkgram.c" /* yacc.c:1646 */ break; case 105: -#line 1292 "awkgram.y" /* yacc.c:1646 */ +#line 1296 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3181 "awkgram.c" /* yacc.c:1646 */ +#line 3185 "awkgram.c" /* yacc.c:1646 */ break; case 106: -#line 1297 "awkgram.y" /* yacc.c:1646 */ +#line 1301 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3187 "awkgram.c" /* yacc.c:1646 */ +#line 3191 "awkgram.c" /* yacc.c:1646 */ break; case 107: -#line 1299 "awkgram.y" /* yacc.c:1646 */ +#line 1303 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3195,52 +3199,52 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3199 "awkgram.c" /* yacc.c:1646 */ +#line 3203 "awkgram.c" /* yacc.c:1646 */ break; case 108: -#line 1307 "awkgram.y" /* yacc.c:1646 */ +#line 1311 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3208 "awkgram.c" /* yacc.c:1646 */ +#line 3212 "awkgram.c" /* yacc.c:1646 */ break; case 109: -#line 1312 "awkgram.y" /* yacc.c:1646 */ +#line 1316 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3217 "awkgram.c" /* yacc.c:1646 */ +#line 3221 "awkgram.c" /* yacc.c:1646 */ break; case 110: -#line 1321 "awkgram.y" /* yacc.c:1646 */ +#line 1325 "awkgram.y" /* yacc.c:1646 */ { if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec) lintwarn_ln((yyvsp[-1])->source_line, _("regular expression on right of assignment")); (yyval) = mk_assignment((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3228 "awkgram.c" /* yacc.c:1646 */ +#line 3232 "awkgram.c" /* yacc.c:1646 */ break; case 111: -#line 1328 "awkgram.y" /* yacc.c:1646 */ +#line 1332 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3234 "awkgram.c" /* yacc.c:1646 */ +#line 3238 "awkgram.c" /* yacc.c:1646 */ break; case 112: -#line 1330 "awkgram.y" /* yacc.c:1646 */ +#line 1334 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3240 "awkgram.c" /* yacc.c:1646 */ +#line 3244 "awkgram.c" /* yacc.c:1646 */ break; case 113: -#line 1332 "awkgram.y" /* yacc.c:1646 */ +#line 1336 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[-1])->source_line, @@ -3256,11 +3260,11 @@ regular_print: (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } -#line 3260 "awkgram.c" /* yacc.c:1646 */ +#line 3264 "awkgram.c" /* yacc.c:1646 */ break; case 114: -#line 1348 "awkgram.y" /* yacc.c:1646 */ +#line 1352 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) warning_ln((yyvsp[-1])->source_line, @@ -3270,91 +3274,91 @@ regular_print: (yyvsp[-1])->expr_count = 1; (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3274 "awkgram.c" /* yacc.c:1646 */ +#line 3278 "awkgram.c" /* yacc.c:1646 */ break; case 115: -#line 1358 "awkgram.y" /* yacc.c:1646 */ +#line 1362 "awkgram.y" /* yacc.c:1646 */ { if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec) lintwarn_ln((yyvsp[-1])->source_line, _("regular expression on right of comparison")); (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3285 "awkgram.c" /* yacc.c:1646 */ +#line 3289 "awkgram.c" /* yacc.c:1646 */ break; case 116: -#line 1365 "awkgram.y" /* yacc.c:1646 */ +#line 1369 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3291 "awkgram.c" /* yacc.c:1646 */ +#line 3295 "awkgram.c" /* yacc.c:1646 */ break; case 117: -#line 1367 "awkgram.y" /* yacc.c:1646 */ +#line 1371 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3297 "awkgram.c" /* yacc.c:1646 */ +#line 3301 "awkgram.c" /* yacc.c:1646 */ break; case 118: -#line 1372 "awkgram.y" /* yacc.c:1646 */ +#line 1376 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3303 "awkgram.c" /* yacc.c:1646 */ +#line 3307 "awkgram.c" /* yacc.c:1646 */ break; case 119: -#line 1374 "awkgram.y" /* yacc.c:1646 */ +#line 1378 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3309 "awkgram.c" /* yacc.c:1646 */ +#line 3313 "awkgram.c" /* yacc.c:1646 */ break; case 120: -#line 1376 "awkgram.y" /* yacc.c:1646 */ +#line 1380 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_assign_quotient; (yyval) = (yyvsp[0]); } -#line 3318 "awkgram.c" /* yacc.c:1646 */ +#line 3322 "awkgram.c" /* yacc.c:1646 */ break; case 121: -#line 1384 "awkgram.y" /* yacc.c:1646 */ +#line 1388 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3324 "awkgram.c" /* yacc.c:1646 */ +#line 3328 "awkgram.c" /* yacc.c:1646 */ break; case 122: -#line 1386 "awkgram.y" /* yacc.c:1646 */ +#line 1390 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3330 "awkgram.c" /* yacc.c:1646 */ +#line 3334 "awkgram.c" /* yacc.c:1646 */ break; case 123: -#line 1391 "awkgram.y" /* yacc.c:1646 */ +#line 1395 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3336 "awkgram.c" /* yacc.c:1646 */ +#line 3340 "awkgram.c" /* yacc.c:1646 */ break; case 124: -#line 1393 "awkgram.y" /* yacc.c:1646 */ +#line 1397 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3342 "awkgram.c" /* yacc.c:1646 */ +#line 3346 "awkgram.c" /* yacc.c:1646 */ break; case 125: -#line 1398 "awkgram.y" /* yacc.c:1646 */ +#line 1402 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3348 "awkgram.c" /* yacc.c:1646 */ +#line 3352 "awkgram.c" /* yacc.c:1646 */ break; case 126: -#line 1400 "awkgram.y" /* yacc.c:1646 */ +#line 1404 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3354 "awkgram.c" /* yacc.c:1646 */ +#line 3358 "awkgram.c" /* yacc.c:1646 */ break; case 127: -#line 1402 "awkgram.y" /* yacc.c:1646 */ +#line 1406 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; @@ -3401,47 +3405,47 @@ regular_print: max_args = count; } } -#line 3405 "awkgram.c" /* yacc.c:1646 */ +#line 3409 "awkgram.c" /* yacc.c:1646 */ break; case 129: -#line 1454 "awkgram.y" /* yacc.c:1646 */ +#line 1458 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3411 "awkgram.c" /* yacc.c:1646 */ +#line 3415 "awkgram.c" /* yacc.c:1646 */ break; case 130: -#line 1456 "awkgram.y" /* yacc.c:1646 */ +#line 1460 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3417 "awkgram.c" /* yacc.c:1646 */ +#line 3421 "awkgram.c" /* yacc.c:1646 */ break; case 131: -#line 1458 "awkgram.y" /* yacc.c:1646 */ +#line 1462 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3423 "awkgram.c" /* yacc.c:1646 */ +#line 3427 "awkgram.c" /* yacc.c:1646 */ break; case 132: -#line 1460 "awkgram.y" /* yacc.c:1646 */ +#line 1464 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3429 "awkgram.c" /* yacc.c:1646 */ +#line 3433 "awkgram.c" /* yacc.c:1646 */ break; case 133: -#line 1462 "awkgram.y" /* yacc.c:1646 */ +#line 1466 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3435 "awkgram.c" /* yacc.c:1646 */ +#line 3439 "awkgram.c" /* yacc.c:1646 */ break; case 134: -#line 1464 "awkgram.y" /* yacc.c:1646 */ +#line 1468 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3441 "awkgram.c" /* yacc.c:1646 */ +#line 3445 "awkgram.c" /* yacc.c:1646 */ break; case 135: -#line 1466 "awkgram.y" /* yacc.c:1646 */ +#line 1470 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3455,29 +3459,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } -#line 3459 "awkgram.c" /* yacc.c:1646 */ +#line 3463 "awkgram.c" /* yacc.c:1646 */ break; case 136: -#line 1480 "awkgram.y" /* yacc.c:1646 */ +#line 1484 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3468 "awkgram.c" /* yacc.c:1646 */ +#line 3472 "awkgram.c" /* yacc.c:1646 */ break; case 137: -#line 1485 "awkgram.y" /* yacc.c:1646 */ +#line 1489 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3477 "awkgram.c" /* yacc.c:1646 */ +#line 3481 "awkgram.c" /* yacc.c:1646 */ break; case 138: -#line 1490 "awkgram.y" /* yacc.c:1646 */ +#line 1494 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { warning_ln((yyvsp[-1])->source_line, @@ -3497,64 +3501,64 @@ regular_print: (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } -#line 3501 "awkgram.c" /* yacc.c:1646 */ +#line 3505 "awkgram.c" /* yacc.c:1646 */ break; case 139: -#line 1515 "awkgram.y" /* yacc.c:1646 */ +#line 1519 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); bcfree((yyvsp[-2])); } -#line 3510 "awkgram.c" /* yacc.c:1646 */ +#line 3514 "awkgram.c" /* yacc.c:1646 */ break; case 140: -#line 1521 "awkgram.y" /* yacc.c:1646 */ +#line 1525 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3516 "awkgram.c" /* yacc.c:1646 */ +#line 3520 "awkgram.c" /* yacc.c:1646 */ break; case 141: -#line 1523 "awkgram.y" /* yacc.c:1646 */ +#line 1527 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3522 "awkgram.c" /* yacc.c:1646 */ +#line 3526 "awkgram.c" /* yacc.c:1646 */ break; case 142: -#line 1525 "awkgram.y" /* yacc.c:1646 */ +#line 1529 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3528 "awkgram.c" /* yacc.c:1646 */ +#line 3532 "awkgram.c" /* yacc.c:1646 */ break; case 143: -#line 1527 "awkgram.y" /* yacc.c:1646 */ +#line 1531 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3534 "awkgram.c" /* yacc.c:1646 */ +#line 3538 "awkgram.c" /* yacc.c:1646 */ break; case 144: -#line 1529 "awkgram.y" /* yacc.c:1646 */ +#line 1533 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3540 "awkgram.c" /* yacc.c:1646 */ +#line 3544 "awkgram.c" /* yacc.c:1646 */ break; case 145: -#line 1531 "awkgram.y" /* yacc.c:1646 */ +#line 1535 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3546 "awkgram.c" /* yacc.c:1646 */ +#line 3550 "awkgram.c" /* yacc.c:1646 */ break; case 146: -#line 1536 "awkgram.y" /* yacc.c:1646 */ +#line 1540 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3554 "awkgram.c" /* yacc.c:1646 */ +#line 3558 "awkgram.c" /* yacc.c:1646 */ break; case 147: -#line 1540 "awkgram.y" /* yacc.c:1646 */ +#line 1544 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->opcode == Op_match_rec) { (yyvsp[0])->opcode = Op_nomatch; @@ -3586,37 +3590,37 @@ regular_print: } } } -#line 3590 "awkgram.c" /* yacc.c:1646 */ +#line 3594 "awkgram.c" /* yacc.c:1646 */ break; case 148: -#line 1572 "awkgram.y" /* yacc.c:1646 */ +#line 1576 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3596 "awkgram.c" /* yacc.c:1646 */ +#line 3600 "awkgram.c" /* yacc.c:1646 */ break; case 149: -#line 1574 "awkgram.y" /* yacc.c:1646 */ +#line 1578 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3606 "awkgram.c" /* yacc.c:1646 */ +#line 3610 "awkgram.c" /* yacc.c:1646 */ break; case 150: -#line 1580 "awkgram.y" /* yacc.c:1646 */ +#line 1584 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3616 "awkgram.c" /* yacc.c:1646 */ +#line 3620 "awkgram.c" /* yacc.c:1646 */ break; case 151: -#line 1586 "awkgram.y" /* yacc.c:1646 */ +#line 1590 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; @@ -3629,45 +3633,45 @@ regular_print: if ((yyval) == NULL) YYABORT; } -#line 3633 "awkgram.c" /* yacc.c:1646 */ +#line 3637 "awkgram.c" /* yacc.c:1646 */ break; case 154: -#line 1601 "awkgram.y" /* yacc.c:1646 */ +#line 1605 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3642 "awkgram.c" /* yacc.c:1646 */ +#line 3646 "awkgram.c" /* yacc.c:1646 */ break; case 155: -#line 1606 "awkgram.y" /* yacc.c:1646 */ +#line 1610 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3651 "awkgram.c" /* yacc.c:1646 */ +#line 3655 "awkgram.c" /* yacc.c:1646 */ break; case 156: -#line 1611 "awkgram.y" /* yacc.c:1646 */ +#line 1615 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3659 "awkgram.c" /* yacc.c:1646 */ +#line 3663 "awkgram.c" /* yacc.c:1646 */ break; case 157: -#line 1615 "awkgram.y" /* yacc.c:1646 */ +#line 1619 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3667 "awkgram.c" /* yacc.c:1646 */ +#line 3671 "awkgram.c" /* yacc.c:1646 */ break; case 158: -#line 1619 "awkgram.y" /* yacc.c:1646 */ +#line 1623 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0 @@ -3682,11 +3686,11 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3686 "awkgram.c" /* yacc.c:1646 */ +#line 3690 "awkgram.c" /* yacc.c:1646 */ break; case 159: -#line 1634 "awkgram.y" /* yacc.c:1646 */ +#line 1638 "awkgram.y" /* yacc.c:1646 */ { /* * was: $$ = $2 @@ -3696,20 +3700,20 @@ regular_print: (yyvsp[-1])->memory = make_number(0.0); (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } -#line 3700 "awkgram.c" /* yacc.c:1646 */ +#line 3704 "awkgram.c" /* yacc.c:1646 */ break; case 160: -#line 1647 "awkgram.y" /* yacc.c:1646 */ +#line 1651 "awkgram.y" /* yacc.c:1646 */ { func_use((yyvsp[0])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[0]); } -#line 3709 "awkgram.c" /* yacc.c:1646 */ +#line 3713 "awkgram.c" /* yacc.c:1646 */ break; case 161: -#line 1652 "awkgram.y" /* yacc.c:1646 */ +#line 1656 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3742,11 +3746,11 @@ regular_print: (yyval) = list_prepend((yyvsp[0]), t); } -#line 3746 "awkgram.c" /* yacc.c:1646 */ +#line 3750 "awkgram.c" /* yacc.c:1646 */ break; case 162: -#line 1688 "awkgram.y" /* yacc.c:1646 */ +#line 1692 "awkgram.y" /* yacc.c:1646 */ { param_sanity((yyvsp[-1])); (yyvsp[-3])->opcode = Op_func_call; @@ -3760,49 +3764,49 @@ regular_print: (yyval) = list_append(t, (yyvsp[-3])); } } -#line 3764 "awkgram.c" /* yacc.c:1646 */ +#line 3768 "awkgram.c" /* yacc.c:1646 */ break; case 163: -#line 1705 "awkgram.y" /* yacc.c:1646 */ +#line 1709 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3770 "awkgram.c" /* yacc.c:1646 */ +#line 3774 "awkgram.c" /* yacc.c:1646 */ break; case 164: -#line 1707 "awkgram.y" /* yacc.c:1646 */ +#line 1711 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3776 "awkgram.c" /* yacc.c:1646 */ +#line 3780 "awkgram.c" /* yacc.c:1646 */ break; case 165: -#line 1712 "awkgram.y" /* yacc.c:1646 */ +#line 1716 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3782 "awkgram.c" /* yacc.c:1646 */ +#line 3786 "awkgram.c" /* yacc.c:1646 */ break; case 166: -#line 1714 "awkgram.y" /* yacc.c:1646 */ +#line 1718 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3788 "awkgram.c" /* yacc.c:1646 */ +#line 3792 "awkgram.c" /* yacc.c:1646 */ break; case 167: -#line 1719 "awkgram.y" /* yacc.c:1646 */ +#line 1723 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3794 "awkgram.c" /* yacc.c:1646 */ +#line 3798 "awkgram.c" /* yacc.c:1646 */ break; case 168: -#line 1721 "awkgram.y" /* yacc.c:1646 */ +#line 1725 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3802 "awkgram.c" /* yacc.c:1646 */ +#line 3806 "awkgram.c" /* yacc.c:1646 */ break; case 169: -#line 1728 "awkgram.y" /* yacc.c:1646 */ +#line 1732 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3816,11 +3820,11 @@ regular_print: sub_counter++; /* count # of dimensions */ (yyval) = (yyvsp[0]); } -#line 3820 "awkgram.c" /* yacc.c:1646 */ +#line 3824 "awkgram.c" /* yacc.c:1646 */ break; case 170: -#line 1745 "awkgram.y" /* yacc.c:1646 */ +#line 1749 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *t = (yyvsp[-1]); if ((yyvsp[-1]) == NULL) { @@ -3834,31 +3838,31 @@ regular_print: (yyvsp[0])->sub_count = count_expressions(&t, false); (yyval) = list_append(t, (yyvsp[0])); } -#line 3838 "awkgram.c" /* yacc.c:1646 */ +#line 3842 "awkgram.c" /* yacc.c:1646 */ break; case 171: -#line 1762 "awkgram.y" /* yacc.c:1646 */ +#line 1766 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3844 "awkgram.c" /* yacc.c:1646 */ +#line 3848 "awkgram.c" /* yacc.c:1646 */ break; case 172: -#line 1764 "awkgram.y" /* yacc.c:1646 */ +#line 1768 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3852 "awkgram.c" /* yacc.c:1646 */ +#line 3856 "awkgram.c" /* yacc.c:1646 */ break; case 173: -#line 1771 "awkgram.y" /* yacc.c:1646 */ +#line 1775 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3858 "awkgram.c" /* yacc.c:1646 */ +#line 3862 "awkgram.c" /* yacc.c:1646 */ break; case 174: -#line 1776 "awkgram.y" /* yacc.c:1646 */ +#line 1780 "awkgram.y" /* yacc.c:1646 */ { char *var_name = (yyvsp[0])->lextok; @@ -3866,22 +3870,22 @@ regular_print: (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); (yyval) = list_create((yyvsp[0])); } -#line 3870 "awkgram.c" /* yacc.c:1646 */ +#line 3874 "awkgram.c" /* yacc.c:1646 */ break; case 175: -#line 1784 "awkgram.y" /* yacc.c:1646 */ +#line 1788 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-1])->lextok; (yyvsp[-1])->memory = variable((yyvsp[-1])->source_line, arr, Node_var_new); (yyvsp[-1])->opcode = Op_push_array; (yyval) = list_prepend((yyvsp[0]), (yyvsp[-1])); } -#line 3881 "awkgram.c" /* yacc.c:1646 */ +#line 3885 "awkgram.c" /* yacc.c:1646 */ break; case 176: -#line 1794 "awkgram.y" /* yacc.c:1646 */ +#line 1798 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push @@ -3893,73 +3897,73 @@ regular_print: } else (yyval) = (yyvsp[0]); } -#line 3897 "awkgram.c" /* yacc.c:1646 */ +#line 3901 "awkgram.c" /* yacc.c:1646 */ break; case 177: -#line 1806 "awkgram.y" /* yacc.c:1646 */ +#line 1810 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); if ((yyvsp[0]) != NULL) mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3907 "awkgram.c" /* yacc.c:1646 */ +#line 3911 "awkgram.c" /* yacc.c:1646 */ break; case 178: -#line 1815 "awkgram.y" /* yacc.c:1646 */ +#line 1819 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; } -#line 3915 "awkgram.c" /* yacc.c:1646 */ +#line 3919 "awkgram.c" /* yacc.c:1646 */ break; case 179: -#line 1819 "awkgram.y" /* yacc.c:1646 */ +#line 1823 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; } -#line 3923 "awkgram.c" /* yacc.c:1646 */ +#line 3927 "awkgram.c" /* yacc.c:1646 */ break; case 180: -#line 1822 "awkgram.y" /* yacc.c:1646 */ +#line 1826 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3929 "awkgram.c" /* yacc.c:1646 */ +#line 3933 "awkgram.c" /* yacc.c:1646 */ break; case 182: -#line 1830 "awkgram.y" /* yacc.c:1646 */ +#line 1834 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3935 "awkgram.c" /* yacc.c:1646 */ +#line 3939 "awkgram.c" /* yacc.c:1646 */ break; case 183: -#line 1834 "awkgram.y" /* yacc.c:1646 */ +#line 1838 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3941 "awkgram.c" /* yacc.c:1646 */ +#line 3945 "awkgram.c" /* yacc.c:1646 */ break; case 186: -#line 1843 "awkgram.y" /* yacc.c:1646 */ +#line 1847 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3947 "awkgram.c" /* yacc.c:1646 */ +#line 3951 "awkgram.c" /* yacc.c:1646 */ break; case 187: -#line 1847 "awkgram.y" /* yacc.c:1646 */ +#line 1851 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); yyerrok; } -#line 3953 "awkgram.c" /* yacc.c:1646 */ +#line 3957 "awkgram.c" /* yacc.c:1646 */ break; case 188: -#line 1851 "awkgram.y" /* yacc.c:1646 */ +#line 1855 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3959 "awkgram.c" /* yacc.c:1646 */ +#line 3963 "awkgram.c" /* yacc.c:1646 */ break; -#line 3963 "awkgram.c" /* yacc.c:1646 */ +#line 3967 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4187,7 +4191,7 @@ yyreturn: #endif return yyresult; } -#line 1853 "awkgram.y" /* yacc.c:1906 */ +#line 1857 "awkgram.y" /* yacc.c:1906 */ struct token { @@ -5359,7 +5363,7 @@ get_comment(void) tokadd(c); } } while (isspace(c) && c != END_FILE); - if ( c == END_FILE) + if (c == END_FILE) break; else if (c != '#') { pushback(); @@ -5387,7 +5391,7 @@ split_comment(void) p = comment->memory->stptr; l = comment->memory->stlen - 3; - /* have at least two comments so split at last blank line ( \n\n) */ + /* have at least two comments so split at last blank line (\n\n) */ while (l >= 0) { if (p[l] == '\n' && p[l+1] == '\n') { commentf = comment; @@ -5421,7 +5425,7 @@ allow_newline(void) break; } if (c == '#') { - if (do_pretty_print && !do_profile) { + if (do_pretty_print && ! do_profile) { /* collect comment byte code iff doing pretty print but not profiling. */ c = get_comment(); } else { @@ -5633,8 +5637,11 @@ retry: case '#': /* it's a comment */ if (do_pretty_print && ! do_profile) { - /* collect comment byte code iff doing pretty print but not profiling. */ - c = get_comment(); + /* + * Collect comment byte code iff doing pretty print + * but not profiling. + */ + c = get_comment(); if (c == END_FILE) return lasttok = NEWLINE_EOF; @@ -5670,7 +5677,7 @@ retry: lintwarn( _("use of `\\ #...' line continuation is not portable")); } - if (do_pretty_print && !do_profile) + if (do_pretty_print && ! do_profile) c = get_comment(); else { while ((c = nextc(false)) != '\n') -- cgit v1.2.3 From abce1669d0d0e571687b73db8810a9a3a3a3d8e5 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 4 Oct 2014 23:35:58 +0300 Subject: Add updated awkgram.c. --- awkgram.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index 637eb436..3efbd137 100644 --- a/awkgram.c +++ b/awkgram.c @@ -188,8 +188,8 @@ static INSTRUCTION *ip_endfile; static INSTRUCTION *ip_beginfile; static INSTRUCTION *comment = NULL; -static INSTRUCTION *comment0 = NULL; -static INSTRUCTION *commentf = NULL; +static INSTRUCTION *program_comment = NULL; +static INSTRUCTION *function_comment = NULL; static bool func_first = true; @@ -2147,7 +2147,7 @@ yyreduce: split_comment(); /* save any other pre-function comment as function comment */ if (comment != NULL) { - commentf = comment; + function_comment = comment; comment = NULL; } func_first = false; @@ -4659,8 +4659,8 @@ mk_program() if (begin_block != NULL) cp = list_merge(begin_block, cp); - if (comment0 != NULL) { - (void) list_prepend(cp, comment0); + if (program_comment != NULL) { + (void) list_prepend(cp, program_comment); } if (comment != NULL) { (void) list_append(cp, comment); @@ -5394,14 +5394,14 @@ split_comment(void) /* have at least two comments so split at last blank line (\n\n) */ while (l >= 0) { if (p[l] == '\n' && p[l+1] == '\n') { - commentf = comment; - n = commentf->memory; - commentf->memory = make_str_node(p + l + 2, n->stlen - l - 2, 0); + function_comment = comment; + n = function_comment->memory; + function_comment->memory = make_str_node(p + l + 2, n->stlen - l - 2, 0); /* create program comment */ - comment0 = bcalloc(Op_comment, 1, sourceline); - comment0->source_file = comment->source_file; + program_comment = bcalloc(Op_comment, 1, sourceline); + program_comment->source_file = comment->source_file; p[l + 2] = 0; - comment0->memory = make_str_node(p, l + 2, 0); + program_comment->memory = make_str_node(p, l + 2, 0); comment = NULL; freenode(n); break; @@ -6750,10 +6750,10 @@ mk_function(INSTRUCTION *fi, INSTRUCTION *def) /* add any pre-function comment to start of action for profile.c */ - if (commentf != NULL) { - commentf->source_line = 0; - (void) list_prepend(def, commentf); - commentf = NULL; + if (function_comment != NULL) { + function_comment->source_line = 0; + (void) list_prepend(def, function_comment); + function_comment = NULL; } /* add an implicit return at end; -- cgit v1.2.3 From 2f7402ec4b65a2546373403fa701a29d7482cf3f Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 5 Oct 2014 08:22:20 +0300 Subject: Some more minor cleanups. --- awkgram.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'awkgram.c') diff --git a/awkgram.c b/awkgram.c index 3efbd137..a79f9a30 100644 --- a/awkgram.c +++ b/awkgram.c @@ -4625,6 +4625,11 @@ mk_program() cp = end_block; else cp = list_merge(begin_block, end_block); + /* + * We don't need to clear the comment variables + * since they're not used anymore after this + * function is called. + */ if (comment != NULL) (void) list_append(cp, comment); (void) list_append(cp, ip_atexit); -- cgit v1.2.3