diff options
-rw-r--r-- | ChangeLog | 46 | ||||
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | TODO | 4 | ||||
-rw-r--r-- | awk.h | 1 | ||||
-rw-r--r-- | awkgram.c | 815 | ||||
-rw-r--r-- | awkgram.y | 93 | ||||
-rw-r--r-- | builtin.c | 10 | ||||
-rw-r--r-- | command.c | 6 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | dfa.c | 2 | ||||
-rw-r--r-- | dfa.h | 2 | ||||
-rw-r--r-- | doc/ChangeLog | 5 | ||||
-rw-r--r-- | doc/gawk.info | 1161 | ||||
-rw-r--r-- | doc/gawk.texi | 34 | ||||
-rw-r--r-- | doc/gawkinet.info | 6 | ||||
-rw-r--r-- | doc/gawkinet.texi | 2 | ||||
-rw-r--r-- | doc/gawktexi.in | 34 | ||||
-rw-r--r-- | extension/ChangeLog | 4 | ||||
-rw-r--r-- | extension/testext.c | 20 | ||||
-rw-r--r-- | getopt.c | 4 | ||||
-rw-r--r-- | getopt.h | 2 | ||||
-rw-r--r-- | getopt1.c | 2 | ||||
-rw-r--r-- | getopt_int.h | 2 | ||||
-rw-r--r-- | main.c | 6 | ||||
-rw-r--r-- | test/ChangeLog | 30 | ||||
-rw-r--r-- | test/Makefile.am | 23 | ||||
-rw-r--r-- | test/Makefile.in | 33 | ||||
-rw-r--r-- | test/Maketests | 10 | ||||
-rw-r--r-- | test/id.ok | 1 | ||||
-rw-r--r-- | test/printfbad4.awk | 5 | ||||
-rw-r--r-- | test/printfbad4.ok | 2 | ||||
-rw-r--r-- | test/profile8.awk | 9 | ||||
-rw-r--r-- | test/profile8.ok | 14 | ||||
-rw-r--r-- | test/regexpbrack.awk | 2 | ||||
-rw-r--r-- | test/regexpbrack.in | 0 | ||||
-rw-r--r-- | test/regexpbrack.ok | 0 | ||||
-rw-r--r-- | test/testext.ok | 2 |
38 files changed, 1204 insertions, 1197 deletions
@@ -1,3 +1,31 @@ +2015-01-19 Arnold D. Robbins <arnold@skeeve.com> + + * awkgram.c: Update to bison 3.0.3. + * command.c: Ditto. + * NEWS: Note same. + +2015-01-16 Stephen Davies <sdavies@sdc.com.au> + + * awkgram.y (rule): Set first_rule to false. Catches more cases + for gathering comments. Thanks to Hermann Peifer for the test case. + +2015-01-15 Arnold D. Robbins <arnold@skeeve.com> + + * dfa.h, dfa.c: Sync with grep. Mainly copyright updates. + * getopt.c, getopt.h, getopt1.c getopt_int.h: Sync with GLIBC. + Mainly copyright updates, one minor code fix. + +2015-01-14 Arnold D. Robbins <arnold@skeeve.com> + + Remove deferred variables. + + * awk.h (register_deferred_variable): Remove declaration. + * awkgram.y (is_deferred_variable, process_deferred, + symtab_used, extensions_used, deferred_variables, + process_deferred): Remove declarations, bodies, and uses. + * builtin.c (do_length): Update comment. + * main.c (init_vars): Just call load_procinfo() and `load_environ()'. + 2015-01-08 Andrew J. Schorr <aschorr@telemetry-investments.com> Revert changes to API deferred variable creation -- these variables @@ -14,6 +42,24 @@ make_aname. I cannot see what purpose this served. Maybe I am missing something. +2015-01-07 Arnold D. Robbins <arnold@skeeve.com> + + * configure.ac: Update debug flags if developing. + * awkgram.y (yylex): Regex parsing bug fix for bracket expressions. + Thanks to Mike Brennan for the report. + * builtin.c (format_tree): Catch non-use of count$ for dynamic + field width or precision. + + Unrelated: + + Load deferred variables if extensions are used; they might + want to access PROCINFO and/or ENVIRON. Thanks to Andrew Schorr + for pointing out the issue. + + * awkgram.y (extensions_used): New variable. Set it on @load. + (do_add_scrfile): Set it on -l. + (process_deferred): Check it also. + 2015-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com> * gawkapi.c (api_sym_update): If copying a subarray, must update @@ -81,7 +81,8 @@ Changes from 4.1.1 to 4.1.2 AWKPATH setting, be sure to put "." in it somewhere. The documentation has been updated and clarified. -10. Infrastructure upgrades: Automake 1.14.1, Gettext 0.19.3, Libtool 2.4.3. +10. Infrastructure upgrades: Automake 1.14.1, Gettext 0.19.3, Libtool 2.4.3, + Bison 3.0.3. XX. A number of bugs have been fixed. See the ChangeLog. @@ -63,8 +63,6 @@ Major New Features Also needed: - Indirect calls of built-ins - Indirect calls of extension functions Indirect through array elements, not just scalar variables Some way to make regexp constants first class citizens: @@ -127,8 +125,6 @@ Things To Think About That May Never Happen Patch lexer for @include and @load to make quotes optional. (Really needed?) - ? Have strftime() pay attention to the value of ENVIRON["TZ"] - Add a lint check if the return value of a function is used but the function did not supply a value. @@ -1329,7 +1329,6 @@ extern void shadow_funcs(void); extern int check_special(const char *name); extern SRCFILE *add_srcfile(enum srctype stype, char *src, SRCFILE *curr, bool *already_included, int *errcode); extern void free_srcfile(SRCFILE *thisfile); -extern void register_deferred_variable(const char *name, NODE *(*load_func)(void)); extern int files_are_same(char *path, SRCFILE *src); extern void valinfo(NODE *n, Func_print print_func, FILE *fp); extern void negate_num(NODE *n); @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 3.0.3. */ /* 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-2015 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 @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.2" +#define YYBISON_VERSION "3.0.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -97,7 +97,6 @@ static int include_source(INSTRUCTION *file); static int load_library(INSTRUCTION *file); static void next_sourcefile(void); static char *tokexpand(void); -static bool is_deferred_variable(const char *name); #define instruction(t) bcalloc(t, 1, 0) @@ -119,8 +118,6 @@ static int count_expressions(INSTRUCTION **list, bool isarg); static INSTRUCTION *optimize_assignment(INSTRUCTION *exp); static void add_lint(INSTRUCTION *list, LINTTYPE linttype); -static void process_deferred(); - enum defref { FUNC_DEFINE, FUNC_USE, FUNC_EXT }; static void func_use(const char *name, enum defref how); static void check_funcs(void); @@ -133,7 +130,6 @@ static void check_comment(void); static bool want_source = false; static bool want_regexp = false; /* lexical scanning kludge */ static char *in_function; /* parsing kludge */ -static bool symtab_used = false; /* program used SYMTAB */ static int rule = 0; const char *const ruletab[] = { @@ -206,7 +202,7 @@ extern double fmod(double x, double y); #define YYSTYPE INSTRUCTION * -#line 210 "awkgram.c" /* yacc.c:339 */ +#line 206 "awkgram.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -360,7 +356,7 @@ int yyparse (void); /* Copy the second part of user declarations. */ -#line 364 "awkgram.c" /* yacc.c:358 */ +#line 360 "awkgram.c" /* yacc.c:358 */ #ifdef short # undef short @@ -662,25 +658,25 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 209, 209, 211, 216, 217, 223, 235, 239, 250, - 256, 261, 269, 277, 279, 284, 292, 294, 300, 308, - 318, 348, 362, 376, 384, 395, 407, 409, 411, 417, - 422, 423, 427, 462, 461, 495, 497, 502, 508, 536, - 541, 542, 546, 548, 550, 557, 647, 689, 731, 844, - 851, 858, 868, 877, 886, 895, 906, 922, 921, 945, - 957, 957, 1055, 1055, 1088, 1118, 1124, 1125, 1131, 1132, - 1139, 1144, 1156, 1170, 1172, 1180, 1185, 1187, 1195, 1197, - 1206, 1207, 1215, 1220, 1220, 1231, 1235, 1243, 1244, 1247, - 1249, 1254, 1255, 1264, 1265, 1270, 1275, 1281, 1283, 1285, - 1292, 1293, 1299, 1300, 1305, 1307, 1312, 1314, 1322, 1327, - 1336, 1343, 1345, 1347, 1363, 1373, 1380, 1382, 1387, 1389, - 1391, 1399, 1401, 1406, 1408, 1413, 1415, 1417, 1467, 1469, - 1471, 1473, 1475, 1477, 1479, 1481, 1495, 1500, 1505, 1530, - 1536, 1538, 1540, 1542, 1544, 1546, 1551, 1555, 1587, 1589, - 1595, 1601, 1614, 1615, 1616, 1621, 1626, 1630, 1634, 1649, - 1662, 1667, 1703, 1721, 1722, 1728, 1729, 1734, 1736, 1743, - 1760, 1777, 1779, 1786, 1791, 1799, 1809, 1821, 1830, 1834, - 1838, 1842, 1846, 1850, 1853, 1855, 1859, 1863, 1867 + 0, 205, 205, 207, 212, 213, 217, 229, 234, 245, + 251, 256, 264, 272, 274, 279, 287, 289, 295, 303, + 313, 343, 357, 371, 379, 390, 402, 404, 406, 412, + 417, 418, 422, 457, 456, 490, 492, 497, 503, 531, + 536, 537, 541, 543, 545, 552, 642, 684, 726, 839, + 846, 853, 863, 872, 881, 890, 901, 917, 916, 940, + 952, 952, 1050, 1050, 1083, 1113, 1119, 1120, 1126, 1127, + 1134, 1139, 1151, 1165, 1167, 1175, 1180, 1182, 1190, 1192, + 1201, 1202, 1210, 1215, 1215, 1226, 1230, 1238, 1239, 1242, + 1244, 1249, 1250, 1259, 1260, 1265, 1270, 1276, 1278, 1280, + 1287, 1288, 1294, 1295, 1300, 1302, 1307, 1309, 1317, 1322, + 1331, 1338, 1340, 1342, 1358, 1368, 1375, 1377, 1382, 1384, + 1386, 1394, 1396, 1401, 1403, 1408, 1410, 1412, 1462, 1464, + 1466, 1468, 1470, 1472, 1474, 1476, 1490, 1495, 1500, 1525, + 1531, 1533, 1535, 1537, 1539, 1541, 1546, 1550, 1582, 1584, + 1590, 1596, 1609, 1610, 1611, 1616, 1621, 1625, 1629, 1644, + 1657, 1662, 1698, 1716, 1717, 1723, 1724, 1729, 1731, 1738, + 1755, 1772, 1774, 1781, 1786, 1794, 1804, 1816, 1825, 1829, + 1833, 1837, 1841, 1845, 1848, 1850, 1854, 1858, 1862 }; #endif @@ -1853,26 +1849,24 @@ yyreduce: switch (yyn) { case 3: -#line 212 "awkgram.y" /* yacc.c:1646 */ +#line 208 "awkgram.y" /* yacc.c:1646 */ { rule = 0; yyerrok; } -#line 1862 "awkgram.c" /* yacc.c:1646 */ +#line 1858 "awkgram.c" /* yacc.c:1646 */ break; case 5: -#line 218 "awkgram.y" /* yacc.c:1646 */ +#line 214 "awkgram.y" /* yacc.c:1646 */ { next_sourcefile(); - if (sourcefile == srcfiles) - process_deferred(); } -#line 1872 "awkgram.c" /* yacc.c:1646 */ +#line 1866 "awkgram.c" /* yacc.c:1646 */ break; case 6: -#line 224 "awkgram.y" /* yacc.c:1646 */ +#line 218 "awkgram.y" /* yacc.c:1646 */ { rule = 0; /* @@ -1881,19 +1875,20 @@ yyreduce: */ /* yyerrok; */ } -#line 1885 "awkgram.c" /* yacc.c:1646 */ +#line 1879 "awkgram.c" /* yacc.c:1646 */ break; case 7: -#line 236 "awkgram.y" /* yacc.c:1646 */ +#line 230 "awkgram.y" /* yacc.c:1646 */ { (void) append_rule((yyvsp[-1]), (yyvsp[0])); + first_rule = false; } -#line 1893 "awkgram.c" /* yacc.c:1646 */ +#line 1888 "awkgram.c" /* yacc.c:1646 */ break; case 8: -#line 240 "awkgram.y" /* yacc.c:1646 */ +#line 235 "awkgram.y" /* yacc.c:1646 */ { if (rule != Rule) { msg(_("%s blocks must have an action part"), ruletab[rule]); @@ -1904,39 +1899,39 @@ yyreduce: } else /* pattern rule with non-empty pattern */ (void) append_rule((yyvsp[-1]), NULL); } -#line 1908 "awkgram.c" /* yacc.c:1646 */ +#line 1903 "awkgram.c" /* yacc.c:1646 */ break; case 9: -#line 251 "awkgram.y" /* yacc.c:1646 */ +#line 246 "awkgram.y" /* yacc.c:1646 */ { in_function = NULL; (void) mk_function((yyvsp[-1]), (yyvsp[0])); yyerrok; } -#line 1918 "awkgram.c" /* yacc.c:1646 */ +#line 1913 "awkgram.c" /* yacc.c:1646 */ break; case 10: -#line 257 "awkgram.y" /* yacc.c:1646 */ +#line 252 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } -#line 1927 "awkgram.c" /* yacc.c:1646 */ +#line 1922 "awkgram.c" /* yacc.c:1646 */ break; case 11: -#line 262 "awkgram.y" /* yacc.c:1646 */ +#line 257 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } -#line 1936 "awkgram.c" /* yacc.c:1646 */ +#line 1931 "awkgram.c" /* yacc.c:1646 */ break; case 12: -#line 270 "awkgram.y" /* yacc.c:1646 */ +#line 265 "awkgram.y" /* yacc.c:1646 */ { if (include_source((yyvsp[0])) < 0) YYABORT; @@ -1944,23 +1939,23 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1948 "awkgram.c" /* yacc.c:1646 */ +#line 1943 "awkgram.c" /* yacc.c:1646 */ break; case 13: -#line 278 "awkgram.y" /* yacc.c:1646 */ +#line 273 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1954 "awkgram.c" /* yacc.c:1646 */ +#line 1949 "awkgram.c" /* yacc.c:1646 */ break; case 14: -#line 280 "awkgram.y" /* yacc.c:1646 */ +#line 275 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1960 "awkgram.c" /* yacc.c:1646 */ +#line 1955 "awkgram.c" /* yacc.c:1646 */ break; case 15: -#line 285 "awkgram.y" /* yacc.c:1646 */ +#line 280 "awkgram.y" /* yacc.c:1646 */ { if (load_library((yyvsp[0])) < 0) YYABORT; @@ -1968,23 +1963,23 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1972 "awkgram.c" /* yacc.c:1646 */ +#line 1967 "awkgram.c" /* yacc.c:1646 */ break; case 16: -#line 293 "awkgram.y" /* yacc.c:1646 */ +#line 288 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1978 "awkgram.c" /* yacc.c:1646 */ +#line 1973 "awkgram.c" /* yacc.c:1646 */ break; case 17: -#line 295 "awkgram.y" /* yacc.c:1646 */ +#line 290 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1984 "awkgram.c" /* yacc.c:1646 */ +#line 1979 "awkgram.c" /* yacc.c:1646 */ break; case 18: -#line 300 "awkgram.y" /* yacc.c:1646 */ +#line 295 "awkgram.y" /* yacc.c:1646 */ { rule = Rule; if (comment != NULL) { @@ -1993,11 +1988,11 @@ yyreduce: } else (yyval) = NULL; } -#line 1997 "awkgram.c" /* yacc.c:1646 */ +#line 1992 "awkgram.c" /* yacc.c:1646 */ break; case 19: -#line 309 "awkgram.y" /* yacc.c:1646 */ +#line 304 "awkgram.y" /* yacc.c:1646 */ { rule = Rule; if (comment != NULL) { @@ -2006,11 +2001,11 @@ yyreduce: } else (yyval) = (yyvsp[0]); } -#line 2010 "awkgram.c" /* yacc.c:1646 */ +#line 2005 "awkgram.c" /* yacc.c:1646 */ break; case 20: -#line 319 "awkgram.y" /* yacc.c:1646 */ +#line 314 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *tp; @@ -2040,11 +2035,11 @@ yyreduce: (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); rule = Rule; } -#line 2044 "awkgram.c" /* yacc.c:1646 */ +#line 2039 "awkgram.c" /* yacc.c:1646 */ break; case 21: -#line 349 "awkgram.y" /* yacc.c:1646 */ +#line 344 "awkgram.y" /* yacc.c:1646 */ { static int begin_seen = 0; @@ -2058,11 +2053,11 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2062 "awkgram.c" /* yacc.c:1646 */ +#line 2057 "awkgram.c" /* yacc.c:1646 */ break; case 22: -#line 363 "awkgram.y" /* yacc.c:1646 */ +#line 358 "awkgram.y" /* yacc.c:1646 */ { static int end_seen = 0; @@ -2076,11 +2071,11 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2080 "awkgram.c" /* yacc.c:1646 */ +#line 2075 "awkgram.c" /* yacc.c:1646 */ break; case 23: -#line 377 "awkgram.y" /* yacc.c:1646 */ +#line 372 "awkgram.y" /* yacc.c:1646 */ { func_first = false; (yyvsp[0])->in_rule = rule = BEGINFILE; @@ -2088,11 +2083,11 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2092 "awkgram.c" /* yacc.c:1646 */ +#line 2087 "awkgram.c" /* yacc.c:1646 */ break; case 24: -#line 385 "awkgram.y" /* yacc.c:1646 */ +#line 380 "awkgram.y" /* yacc.c:1646 */ { func_first = false; (yyvsp[0])->in_rule = rule = ENDFILE; @@ -2100,11 +2095,11 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2104 "awkgram.c" /* yacc.c:1646 */ +#line 2099 "awkgram.c" /* yacc.c:1646 */ break; case 25: -#line 396 "awkgram.y" /* yacc.c:1646 */ +#line 391 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; if ((yyvsp[-3]) == NULL) @@ -2113,39 +2108,39 @@ yyreduce: ip = (yyvsp[-3]); (yyval) = ip; } -#line 2117 "awkgram.c" /* yacc.c:1646 */ +#line 2112 "awkgram.c" /* yacc.c:1646 */ break; case 26: -#line 408 "awkgram.y" /* yacc.c:1646 */ +#line 403 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2123 "awkgram.c" /* yacc.c:1646 */ +#line 2118 "awkgram.c" /* yacc.c:1646 */ break; case 27: -#line 410 "awkgram.y" /* yacc.c:1646 */ +#line 405 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2129 "awkgram.c" /* yacc.c:1646 */ +#line 2124 "awkgram.c" /* yacc.c:1646 */ break; case 28: -#line 412 "awkgram.y" /* yacc.c:1646 */ +#line 407 "awkgram.y" /* yacc.c:1646 */ { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); YYABORT; } -#line 2139 "awkgram.c" /* yacc.c:1646 */ +#line 2134 "awkgram.c" /* yacc.c:1646 */ break; case 29: -#line 418 "awkgram.y" /* yacc.c:1646 */ +#line 413 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2145 "awkgram.c" /* yacc.c:1646 */ +#line 2140 "awkgram.c" /* yacc.c:1646 */ break; case 32: -#line 428 "awkgram.y" /* yacc.c:1646 */ +#line 423 "awkgram.y" /* yacc.c:1646 */ { /* * treat any comments between BOF and the first function @@ -2172,17 +2167,17 @@ yyreduce: /* $4 already free'd in install_function */ (yyval) = (yyvsp[-5]); } -#line 2176 "awkgram.c" /* yacc.c:1646 */ +#line 2171 "awkgram.c" /* yacc.c:1646 */ break; case 33: -#line 462 "awkgram.y" /* yacc.c:1646 */ +#line 457 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } -#line 2182 "awkgram.c" /* yacc.c:1646 */ +#line 2177 "awkgram.c" /* yacc.c:1646 */ break; case 34: -#line 464 "awkgram.y" /* yacc.c:1646 */ +#line 459 "awkgram.y" /* yacc.c:1646 */ { NODE *n, *exp; char *re; @@ -2211,28 +2206,28 @@ yyreduce: (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2215 "awkgram.c" /* yacc.c:1646 */ +#line 2210 "awkgram.c" /* yacc.c:1646 */ break; case 35: -#line 496 "awkgram.y" /* yacc.c:1646 */ +#line 491 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[0])); } -#line 2221 "awkgram.c" /* yacc.c:1646 */ +#line 2216 "awkgram.c" /* yacc.c:1646 */ break; case 37: -#line 502 "awkgram.y" /* yacc.c:1646 */ +#line 497 "awkgram.y" /* yacc.c:1646 */ { if (comment != NULL) { (yyval) = list_create(comment); comment = NULL; } else (yyval) = NULL; } -#line 2232 "awkgram.c" /* yacc.c:1646 */ +#line 2227 "awkgram.c" /* yacc.c:1646 */ break; case 38: -#line 509 "awkgram.y" /* yacc.c:1646 */ +#line 504 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0]) == NULL) { if (comment == NULL) @@ -2260,40 +2255,40 @@ yyreduce: } yyerrok; } -#line 2264 "awkgram.c" /* yacc.c:1646 */ +#line 2259 "awkgram.c" /* yacc.c:1646 */ break; case 39: -#line 537 "awkgram.y" /* yacc.c:1646 */ +#line 532 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2270 "awkgram.c" /* yacc.c:1646 */ +#line 2265 "awkgram.c" /* yacc.c:1646 */ break; case 42: -#line 547 "awkgram.y" /* yacc.c:1646 */ +#line 542 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2276 "awkgram.c" /* yacc.c:1646 */ +#line 2271 "awkgram.c" /* yacc.c:1646 */ break; case 43: -#line 549 "awkgram.y" /* yacc.c:1646 */ +#line 544 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2282 "awkgram.c" /* yacc.c:1646 */ +#line 2277 "awkgram.c" /* yacc.c:1646 */ break; case 44: -#line 551 "awkgram.y" /* yacc.c:1646 */ +#line 546 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2293 "awkgram.c" /* yacc.c:1646 */ +#line 2288 "awkgram.c" /* yacc.c:1646 */ break; case 45: -#line 558 "awkgram.y" /* yacc.c:1646 */ +#line 553 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2383,11 +2378,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2387 "awkgram.c" /* yacc.c:1646 */ +#line 2382 "awkgram.c" /* yacc.c:1646 */ break; case 46: -#line 648 "awkgram.y" /* yacc.c:1646 */ +#line 643 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2429,11 +2424,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2433 "awkgram.c" /* yacc.c:1646 */ +#line 2428 "awkgram.c" /* yacc.c:1646 */ break; case 47: -#line 690 "awkgram.y" /* yacc.c:1646 */ +#line 685 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2475,11 +2470,11 @@ yyreduce: } /* else $1 and $4 are NULLs */ } -#line 2479 "awkgram.c" /* yacc.c:1646 */ +#line 2474 "awkgram.c" /* yacc.c:1646 */ break; case 48: -#line 732 "awkgram.y" /* yacc.c:1646 */ +#line 727 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; char *var_name = (yyvsp[-5])->lextok; @@ -2592,44 +2587,44 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2596 "awkgram.c" /* yacc.c:1646 */ +#line 2591 "awkgram.c" /* yacc.c:1646 */ break; case 49: -#line 845 "awkgram.y" /* yacc.c:1646 */ +#line 840 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2607 "awkgram.c" /* yacc.c:1646 */ +#line 2602 "awkgram.c" /* yacc.c:1646 */ break; case 50: -#line 852 "awkgram.y" /* yacc.c:1646 */ +#line 847 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2618 "awkgram.c" /* yacc.c:1646 */ +#line 2613 "awkgram.c" /* yacc.c:1646 */ break; case 51: -#line 859 "awkgram.y" /* yacc.c:1646 */ +#line 854 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2629 "awkgram.c" /* yacc.c:1646 */ +#line 2624 "awkgram.c" /* yacc.c:1646 */ break; case 52: -#line 869 "awkgram.y" /* yacc.c:1646 */ +#line 864 "awkgram.y" /* yacc.c:1646 */ { if (! break_allowed) error_ln((yyvsp[-1])->source_line, @@ -2638,11 +2633,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2642 "awkgram.c" /* yacc.c:1646 */ +#line 2637 "awkgram.c" /* yacc.c:1646 */ break; case 53: -#line 878 "awkgram.y" /* yacc.c:1646 */ +#line 873 "awkgram.y" /* yacc.c:1646 */ { if (! continue_allowed) error_ln((yyvsp[-1])->source_line, @@ -2651,11 +2646,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2655 "awkgram.c" /* yacc.c:1646 */ +#line 2650 "awkgram.c" /* yacc.c:1646 */ break; case 54: -#line 887 "awkgram.y" /* yacc.c:1646 */ +#line 882 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2664,11 +2659,11 @@ regular_loop: (yyvsp[-1])->target_jmp = ip_rec; (yyval) = list_create((yyvsp[-1])); } -#line 2668 "awkgram.c" /* yacc.c:1646 */ +#line 2663 "awkgram.c" /* yacc.c:1646 */ break; case 55: -#line 896 "awkgram.y" /* yacc.c:1646 */ +#line 891 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2679,11 +2674,11 @@ regular_loop: (yyvsp[-1])->target_endfile = ip_endfile; (yyval) = list_create((yyvsp[-1])); } -#line 2683 "awkgram.c" /* yacc.c:1646 */ +#line 2678 "awkgram.c" /* yacc.c:1646 */ break; case 56: -#line 907 "awkgram.y" /* yacc.c:1646 */ +#line 902 "awkgram.y" /* yacc.c:1646 */ { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2698,20 +2693,20 @@ regular_loop: } else (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); } -#line 2702 "awkgram.c" /* yacc.c:1646 */ +#line 2697 "awkgram.c" /* yacc.c:1646 */ break; case 57: -#line 922 "awkgram.y" /* yacc.c:1646 */ +#line 917 "awkgram.y" /* yacc.c:1646 */ { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2711 "awkgram.c" /* yacc.c:1646 */ +#line 2706 "awkgram.c" /* yacc.c:1646 */ break; case 58: -#line 925 "awkgram.y" /* yacc.c:1646 */ +#line 920 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) { (yyval) = list_create((yyvsp[-3])); @@ -2732,17 +2727,17 @@ regular_loop: (yyval) = list_append((yyvsp[-1]), (yyvsp[-3])); } } -#line 2736 "awkgram.c" /* yacc.c:1646 */ +#line 2731 "awkgram.c" /* yacc.c:1646 */ break; case 60: -#line 957 "awkgram.y" /* yacc.c:1646 */ +#line 952 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } -#line 2742 "awkgram.c" /* yacc.c:1646 */ +#line 2737 "awkgram.c" /* yacc.c:1646 */ break; case 61: -#line 958 "awkgram.y" /* yacc.c:1646 */ +#line 953 "awkgram.y" /* yacc.c:1646 */ { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2839,17 +2834,17 @@ regular_print: } } } -#line 2843 "awkgram.c" /* yacc.c:1646 */ +#line 2838 "awkgram.c" /* yacc.c:1646 */ break; case 62: -#line 1055 "awkgram.y" /* yacc.c:1646 */ +#line 1050 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } -#line 2849 "awkgram.c" /* yacc.c:1646 */ +#line 2844 "awkgram.c" /* yacc.c:1646 */ break; case 63: -#line 1056 "awkgram.y" /* yacc.c:1646 */ +#line 1051 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-2])->lextok; @@ -2882,11 +2877,11 @@ regular_print: (yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3])); } } -#line 2886 "awkgram.c" /* yacc.c:1646 */ +#line 2881 "awkgram.c" /* yacc.c:1646 */ break; case 64: -#line 1093 "awkgram.y" /* yacc.c:1646 */ +#line 1088 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; char *arr = (yyvsp[-1])->lextok; @@ -2912,52 +2907,52 @@ regular_print: fatal(_("`delete' is not allowed with FUNCTAB")); } } -#line 2916 "awkgram.c" /* yacc.c:1646 */ +#line 2911 "awkgram.c" /* yacc.c:1646 */ break; case 65: -#line 1119 "awkgram.y" /* yacc.c:1646 */ +#line 1114 "awkgram.y" /* yacc.c:1646 */ { (yyval) = optimize_assignment((yyvsp[0])); } -#line 2922 "awkgram.c" /* yacc.c:1646 */ +#line 2917 "awkgram.c" /* yacc.c:1646 */ break; case 66: -#line 1124 "awkgram.y" /* yacc.c:1646 */ +#line 1119 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2928 "awkgram.c" /* yacc.c:1646 */ +#line 2923 "awkgram.c" /* yacc.c:1646 */ break; case 67: -#line 1126 "awkgram.y" /* yacc.c:1646 */ +#line 1121 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2934 "awkgram.c" /* yacc.c:1646 */ +#line 2929 "awkgram.c" /* yacc.c:1646 */ break; case 68: -#line 1131 "awkgram.y" /* yacc.c:1646 */ +#line 1126 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2940 "awkgram.c" /* yacc.c:1646 */ +#line 2935 "awkgram.c" /* yacc.c:1646 */ break; case 69: -#line 1133 "awkgram.y" /* yacc.c:1646 */ +#line 1128 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) (yyval) = list_create((yyvsp[0])); else (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } -#line 2951 "awkgram.c" /* yacc.c:1646 */ +#line 2946 "awkgram.c" /* yacc.c:1646 */ break; case 70: -#line 1140 "awkgram.y" /* yacc.c:1646 */ +#line 1135 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2957 "awkgram.c" /* yacc.c:1646 */ +#line 2952 "awkgram.c" /* yacc.c:1646 */ break; case 71: -#line 1145 "awkgram.y" /* yacc.c:1646 */ +#line 1140 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2969,11 +2964,11 @@ regular_print: bcfree((yyvsp[-2])); (yyval) = (yyvsp[-4]); } -#line 2973 "awkgram.c" /* yacc.c:1646 */ +#line 2968 "awkgram.c" /* yacc.c:1646 */ break; case 72: -#line 1157 "awkgram.y" /* yacc.c:1646 */ +#line 1152 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2984,17 +2979,17 @@ regular_print: (yyvsp[-3])->case_stmt = casestmt; (yyval) = (yyvsp[-3]); } -#line 2988 "awkgram.c" /* yacc.c:1646 */ +#line 2983 "awkgram.c" /* yacc.c:1646 */ break; case 73: -#line 1171 "awkgram.y" /* yacc.c:1646 */ +#line 1166 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2994 "awkgram.c" /* yacc.c:1646 */ +#line 2989 "awkgram.c" /* yacc.c:1646 */ break; case 74: -#line 1173 "awkgram.y" /* yacc.c:1646 */ +#line 1168 "awkgram.y" /* yacc.c:1646 */ { NODE *n = (yyvsp[0])->memory; (void) force_number(n); @@ -3002,71 +2997,71 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3006 "awkgram.c" /* yacc.c:1646 */ +#line 3001 "awkgram.c" /* yacc.c:1646 */ break; case 75: -#line 1181 "awkgram.y" /* yacc.c:1646 */ +#line 1176 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3015 "awkgram.c" /* yacc.c:1646 */ +#line 3010 "awkgram.c" /* yacc.c:1646 */ break; case 76: -#line 1186 "awkgram.y" /* yacc.c:1646 */ +#line 1181 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3021 "awkgram.c" /* yacc.c:1646 */ +#line 3016 "awkgram.c" /* yacc.c:1646 */ break; case 77: -#line 1188 "awkgram.y" /* yacc.c:1646 */ +#line 1183 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_push_re; (yyval) = (yyvsp[0]); } -#line 3030 "awkgram.c" /* yacc.c:1646 */ +#line 3025 "awkgram.c" /* yacc.c:1646 */ break; case 78: -#line 1196 "awkgram.y" /* yacc.c:1646 */ +#line 1191 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3036 "awkgram.c" /* yacc.c:1646 */ +#line 3031 "awkgram.c" /* yacc.c:1646 */ break; case 79: -#line 1198 "awkgram.y" /* yacc.c:1646 */ +#line 1193 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3042 "awkgram.c" /* yacc.c:1646 */ +#line 3037 "awkgram.c" /* yacc.c:1646 */ break; case 81: -#line 1208 "awkgram.y" /* yacc.c:1646 */ +#line 1203 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3050 "awkgram.c" /* yacc.c:1646 */ +#line 3045 "awkgram.c" /* yacc.c:1646 */ break; case 82: -#line 1215 "awkgram.y" /* yacc.c:1646 */ +#line 1210 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; (yyval) = NULL; } -#line 3060 "awkgram.c" /* yacc.c:1646 */ +#line 3055 "awkgram.c" /* yacc.c:1646 */ break; case 83: -#line 1220 "awkgram.y" /* yacc.c:1646 */ +#line 1215 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } -#line 3066 "awkgram.c" /* yacc.c:1646 */ +#line 3061 "awkgram.c" /* yacc.c:1646 */ break; case 84: -#line 1221 "awkgram.y" /* yacc.c:1646 */ +#line 1216 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->redir_type == redirect_twoway && (yyvsp[0])->lasti->opcode == Op_K_getline_redir @@ -3074,136 +3069,136 @@ regular_print: yyerror(_("multistage two-way pipelines don't work")); (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } -#line 3078 "awkgram.c" /* yacc.c:1646 */ +#line 3073 "awkgram.c" /* yacc.c:1646 */ break; case 85: -#line 1232 "awkgram.y" /* yacc.c:1646 */ +#line 1227 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } -#line 3086 "awkgram.c" /* yacc.c:1646 */ +#line 3081 "awkgram.c" /* yacc.c:1646 */ break; case 86: -#line 1237 "awkgram.y" /* yacc.c:1646 */ +#line 1232 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } -#line 3094 "awkgram.c" /* yacc.c:1646 */ +#line 3089 "awkgram.c" /* yacc.c:1646 */ break; case 91: -#line 1254 "awkgram.y" /* yacc.c:1646 */ +#line 1249 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3100 "awkgram.c" /* yacc.c:1646 */ +#line 3095 "awkgram.c" /* yacc.c:1646 */ break; case 92: -#line 1256 "awkgram.y" /* yacc.c:1646 */ +#line 1251 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3109 "awkgram.c" /* yacc.c:1646 */ +#line 3104 "awkgram.c" /* yacc.c:1646 */ break; case 93: -#line 1264 "awkgram.y" /* yacc.c:1646 */ +#line 1259 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3115 "awkgram.c" /* yacc.c:1646 */ +#line 3110 "awkgram.c" /* yacc.c:1646 */ break; case 94: -#line 1266 "awkgram.y" /* yacc.c:1646 */ +#line 1261 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3121 "awkgram.c" /* yacc.c:1646 */ +#line 3116 "awkgram.c" /* yacc.c:1646 */ break; case 95: -#line 1271 "awkgram.y" /* yacc.c:1646 */ +#line 1266 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = 0; (yyval) = list_create((yyvsp[0])); } -#line 3130 "awkgram.c" /* yacc.c:1646 */ +#line 3125 "awkgram.c" /* yacc.c:1646 */ break; case 96: -#line 1276 "awkgram.y" /* yacc.c:1646 */ +#line 1271 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; (yyval) = list_append((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3140 "awkgram.c" /* yacc.c:1646 */ +#line 3135 "awkgram.c" /* yacc.c:1646 */ break; case 97: -#line 1282 "awkgram.y" /* yacc.c:1646 */ +#line 1277 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3146 "awkgram.c" /* yacc.c:1646 */ +#line 3141 "awkgram.c" /* yacc.c:1646 */ break; case 98: -#line 1284 "awkgram.y" /* yacc.c:1646 */ +#line 1279 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3152 "awkgram.c" /* yacc.c:1646 */ +#line 3147 "awkgram.c" /* yacc.c:1646 */ break; case 99: -#line 1286 "awkgram.y" /* yacc.c:1646 */ +#line 1281 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } -#line 3158 "awkgram.c" /* yacc.c:1646 */ +#line 3153 "awkgram.c" /* yacc.c:1646 */ break; case 100: -#line 1292 "awkgram.y" /* yacc.c:1646 */ +#line 1287 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3164 "awkgram.c" /* yacc.c:1646 */ +#line 3159 "awkgram.c" /* yacc.c:1646 */ break; case 101: -#line 1294 "awkgram.y" /* yacc.c:1646 */ +#line 1289 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3170 "awkgram.c" /* yacc.c:1646 */ +#line 3165 "awkgram.c" /* yacc.c:1646 */ break; case 102: -#line 1299 "awkgram.y" /* yacc.c:1646 */ +#line 1294 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3176 "awkgram.c" /* yacc.c:1646 */ +#line 3171 "awkgram.c" /* yacc.c:1646 */ break; case 103: -#line 1301 "awkgram.y" /* yacc.c:1646 */ +#line 1296 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3182 "awkgram.c" /* yacc.c:1646 */ +#line 3177 "awkgram.c" /* yacc.c:1646 */ break; case 104: -#line 1306 "awkgram.y" /* yacc.c:1646 */ +#line 1301 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3188 "awkgram.c" /* yacc.c:1646 */ +#line 3183 "awkgram.c" /* yacc.c:1646 */ break; case 105: -#line 1308 "awkgram.y" /* yacc.c:1646 */ +#line 1303 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3197 "awkgram.c" /* yacc.c:1646 */ +#line 3192 "awkgram.c" /* yacc.c:1646 */ break; case 106: -#line 1313 "awkgram.y" /* yacc.c:1646 */ +#line 1308 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3203 "awkgram.c" /* yacc.c:1646 */ +#line 3198 "awkgram.c" /* yacc.c:1646 */ break; case 107: -#line 1315 "awkgram.y" /* yacc.c:1646 */ +#line 1310 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3211,52 +3206,52 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3215 "awkgram.c" /* yacc.c:1646 */ +#line 3210 "awkgram.c" /* yacc.c:1646 */ break; case 108: -#line 1323 "awkgram.y" /* yacc.c:1646 */ +#line 1318 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3224 "awkgram.c" /* yacc.c:1646 */ +#line 3219 "awkgram.c" /* yacc.c:1646 */ break; case 109: -#line 1328 "awkgram.y" /* yacc.c:1646 */ +#line 1323 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3233 "awkgram.c" /* yacc.c:1646 */ +#line 3228 "awkgram.c" /* yacc.c:1646 */ break; case 110: -#line 1337 "awkgram.y" /* yacc.c:1646 */ +#line 1332 "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 3244 "awkgram.c" /* yacc.c:1646 */ +#line 3239 "awkgram.c" /* yacc.c:1646 */ break; case 111: -#line 1344 "awkgram.y" /* yacc.c:1646 */ +#line 1339 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3250 "awkgram.c" /* yacc.c:1646 */ +#line 3245 "awkgram.c" /* yacc.c:1646 */ break; case 112: -#line 1346 "awkgram.y" /* yacc.c:1646 */ +#line 1341 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3256 "awkgram.c" /* yacc.c:1646 */ +#line 3251 "awkgram.c" /* yacc.c:1646 */ break; case 113: -#line 1348 "awkgram.y" /* yacc.c:1646 */ +#line 1343 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[-1])->source_line, @@ -3272,11 +3267,11 @@ regular_print: (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } -#line 3276 "awkgram.c" /* yacc.c:1646 */ +#line 3271 "awkgram.c" /* yacc.c:1646 */ break; case 114: -#line 1364 "awkgram.y" /* yacc.c:1646 */ +#line 1359 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) warning_ln((yyvsp[-1])->source_line, @@ -3286,91 +3281,91 @@ regular_print: (yyvsp[-1])->expr_count = 1; (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3290 "awkgram.c" /* yacc.c:1646 */ +#line 3285 "awkgram.c" /* yacc.c:1646 */ break; case 115: -#line 1374 "awkgram.y" /* yacc.c:1646 */ +#line 1369 "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 3301 "awkgram.c" /* yacc.c:1646 */ +#line 3296 "awkgram.c" /* yacc.c:1646 */ break; case 116: -#line 1381 "awkgram.y" /* yacc.c:1646 */ +#line 1376 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3307 "awkgram.c" /* yacc.c:1646 */ +#line 3302 "awkgram.c" /* yacc.c:1646 */ break; case 117: -#line 1383 "awkgram.y" /* yacc.c:1646 */ +#line 1378 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3313 "awkgram.c" /* yacc.c:1646 */ +#line 3308 "awkgram.c" /* yacc.c:1646 */ break; case 118: -#line 1388 "awkgram.y" /* yacc.c:1646 */ +#line 1383 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3319 "awkgram.c" /* yacc.c:1646 */ +#line 3314 "awkgram.c" /* yacc.c:1646 */ break; case 119: -#line 1390 "awkgram.y" /* yacc.c:1646 */ +#line 1385 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3325 "awkgram.c" /* yacc.c:1646 */ +#line 3320 "awkgram.c" /* yacc.c:1646 */ break; case 120: -#line 1392 "awkgram.y" /* yacc.c:1646 */ +#line 1387 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_assign_quotient; (yyval) = (yyvsp[0]); } -#line 3334 "awkgram.c" /* yacc.c:1646 */ +#line 3329 "awkgram.c" /* yacc.c:1646 */ break; case 121: -#line 1400 "awkgram.y" /* yacc.c:1646 */ +#line 1395 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3340 "awkgram.c" /* yacc.c:1646 */ +#line 3335 "awkgram.c" /* yacc.c:1646 */ break; case 122: -#line 1402 "awkgram.y" /* yacc.c:1646 */ +#line 1397 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3346 "awkgram.c" /* yacc.c:1646 */ +#line 3341 "awkgram.c" /* yacc.c:1646 */ break; case 123: -#line 1407 "awkgram.y" /* yacc.c:1646 */ +#line 1402 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3352 "awkgram.c" /* yacc.c:1646 */ +#line 3347 "awkgram.c" /* yacc.c:1646 */ break; case 124: -#line 1409 "awkgram.y" /* yacc.c:1646 */ +#line 1404 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3358 "awkgram.c" /* yacc.c:1646 */ +#line 3353 "awkgram.c" /* yacc.c:1646 */ break; case 125: -#line 1414 "awkgram.y" /* yacc.c:1646 */ +#line 1409 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3364 "awkgram.c" /* yacc.c:1646 */ +#line 3359 "awkgram.c" /* yacc.c:1646 */ break; case 126: -#line 1416 "awkgram.y" /* yacc.c:1646 */ +#line 1411 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3370 "awkgram.c" /* yacc.c:1646 */ +#line 3365 "awkgram.c" /* yacc.c:1646 */ break; case 127: -#line 1418 "awkgram.y" /* yacc.c:1646 */ +#line 1413 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; @@ -3417,47 +3412,47 @@ regular_print: max_args = count; } } -#line 3421 "awkgram.c" /* yacc.c:1646 */ +#line 3416 "awkgram.c" /* yacc.c:1646 */ break; case 129: -#line 1470 "awkgram.y" /* yacc.c:1646 */ +#line 1465 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3427 "awkgram.c" /* yacc.c:1646 */ +#line 3422 "awkgram.c" /* yacc.c:1646 */ break; case 130: -#line 1472 "awkgram.y" /* yacc.c:1646 */ +#line 1467 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3433 "awkgram.c" /* yacc.c:1646 */ +#line 3428 "awkgram.c" /* yacc.c:1646 */ break; case 131: -#line 1474 "awkgram.y" /* yacc.c:1646 */ +#line 1469 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3439 "awkgram.c" /* yacc.c:1646 */ +#line 3434 "awkgram.c" /* yacc.c:1646 */ break; case 132: -#line 1476 "awkgram.y" /* yacc.c:1646 */ +#line 1471 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3445 "awkgram.c" /* yacc.c:1646 */ +#line 3440 "awkgram.c" /* yacc.c:1646 */ break; case 133: -#line 1478 "awkgram.y" /* yacc.c:1646 */ +#line 1473 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3451 "awkgram.c" /* yacc.c:1646 */ +#line 3446 "awkgram.c" /* yacc.c:1646 */ break; case 134: -#line 1480 "awkgram.y" /* yacc.c:1646 */ +#line 1475 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3457 "awkgram.c" /* yacc.c:1646 */ +#line 3452 "awkgram.c" /* yacc.c:1646 */ break; case 135: -#line 1482 "awkgram.y" /* yacc.c:1646 */ +#line 1477 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3471,29 +3466,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } -#line 3475 "awkgram.c" /* yacc.c:1646 */ +#line 3470 "awkgram.c" /* yacc.c:1646 */ break; case 136: -#line 1496 "awkgram.y" /* yacc.c:1646 */ +#line 1491 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3484 "awkgram.c" /* yacc.c:1646 */ +#line 3479 "awkgram.c" /* yacc.c:1646 */ break; case 137: -#line 1501 "awkgram.y" /* yacc.c:1646 */ +#line 1496 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3493 "awkgram.c" /* yacc.c:1646 */ +#line 3488 "awkgram.c" /* yacc.c:1646 */ break; case 138: -#line 1506 "awkgram.y" /* yacc.c:1646 */ +#line 1501 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { warning_ln((yyvsp[-1])->source_line, @@ -3513,64 +3508,64 @@ regular_print: (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } -#line 3517 "awkgram.c" /* yacc.c:1646 */ +#line 3512 "awkgram.c" /* yacc.c:1646 */ break; case 139: -#line 1531 "awkgram.y" /* yacc.c:1646 */ +#line 1526 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); bcfree((yyvsp[-2])); } -#line 3526 "awkgram.c" /* yacc.c:1646 */ +#line 3521 "awkgram.c" /* yacc.c:1646 */ break; case 140: -#line 1537 "awkgram.y" /* yacc.c:1646 */ +#line 1532 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3532 "awkgram.c" /* yacc.c:1646 */ +#line 3527 "awkgram.c" /* yacc.c:1646 */ break; case 141: -#line 1539 "awkgram.y" /* yacc.c:1646 */ +#line 1534 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3538 "awkgram.c" /* yacc.c:1646 */ +#line 3533 "awkgram.c" /* yacc.c:1646 */ break; case 142: -#line 1541 "awkgram.y" /* yacc.c:1646 */ +#line 1536 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3544 "awkgram.c" /* yacc.c:1646 */ +#line 3539 "awkgram.c" /* yacc.c:1646 */ break; case 143: -#line 1543 "awkgram.y" /* yacc.c:1646 */ +#line 1538 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3550 "awkgram.c" /* yacc.c:1646 */ +#line 3545 "awkgram.c" /* yacc.c:1646 */ break; case 144: -#line 1545 "awkgram.y" /* yacc.c:1646 */ +#line 1540 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3556 "awkgram.c" /* yacc.c:1646 */ +#line 3551 "awkgram.c" /* yacc.c:1646 */ break; case 145: -#line 1547 "awkgram.y" /* yacc.c:1646 */ +#line 1542 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3562 "awkgram.c" /* yacc.c:1646 */ +#line 3557 "awkgram.c" /* yacc.c:1646 */ break; case 146: -#line 1552 "awkgram.y" /* yacc.c:1646 */ +#line 1547 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3570 "awkgram.c" /* yacc.c:1646 */ +#line 3565 "awkgram.c" /* yacc.c:1646 */ break; case 147: -#line 1556 "awkgram.y" /* yacc.c:1646 */ +#line 1551 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->opcode == Op_match_rec) { (yyvsp[0])->opcode = Op_nomatch; @@ -3602,37 +3597,37 @@ regular_print: } } } -#line 3606 "awkgram.c" /* yacc.c:1646 */ +#line 3601 "awkgram.c" /* yacc.c:1646 */ break; case 148: -#line 1588 "awkgram.y" /* yacc.c:1646 */ +#line 1583 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3612 "awkgram.c" /* yacc.c:1646 */ +#line 3607 "awkgram.c" /* yacc.c:1646 */ break; case 149: -#line 1590 "awkgram.y" /* yacc.c:1646 */ +#line 1585 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3622 "awkgram.c" /* yacc.c:1646 */ +#line 3617 "awkgram.c" /* yacc.c:1646 */ break; case 150: -#line 1596 "awkgram.y" /* yacc.c:1646 */ +#line 1591 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3632 "awkgram.c" /* yacc.c:1646 */ +#line 3627 "awkgram.c" /* yacc.c:1646 */ break; case 151: -#line 1602 "awkgram.y" /* yacc.c:1646 */ +#line 1597 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; @@ -3645,45 +3640,45 @@ regular_print: if ((yyval) == NULL) YYABORT; } -#line 3649 "awkgram.c" /* yacc.c:1646 */ +#line 3644 "awkgram.c" /* yacc.c:1646 */ break; case 154: -#line 1617 "awkgram.y" /* yacc.c:1646 */ +#line 1612 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3658 "awkgram.c" /* yacc.c:1646 */ +#line 3653 "awkgram.c" /* yacc.c:1646 */ break; case 155: -#line 1622 "awkgram.y" /* yacc.c:1646 */ +#line 1617 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3667 "awkgram.c" /* yacc.c:1646 */ +#line 3662 "awkgram.c" /* yacc.c:1646 */ break; case 156: -#line 1627 "awkgram.y" /* yacc.c:1646 */ +#line 1622 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3675 "awkgram.c" /* yacc.c:1646 */ +#line 3670 "awkgram.c" /* yacc.c:1646 */ break; case 157: -#line 1631 "awkgram.y" /* yacc.c:1646 */ +#line 1626 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3683 "awkgram.c" /* yacc.c:1646 */ +#line 3678 "awkgram.c" /* yacc.c:1646 */ break; case 158: -#line 1635 "awkgram.y" /* yacc.c:1646 */ +#line 1630 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0 @@ -3698,11 +3693,11 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3702 "awkgram.c" /* yacc.c:1646 */ +#line 3697 "awkgram.c" /* yacc.c:1646 */ break; case 159: -#line 1650 "awkgram.y" /* yacc.c:1646 */ +#line 1645 "awkgram.y" /* yacc.c:1646 */ { /* * was: $$ = $2 @@ -3712,20 +3707,20 @@ regular_print: (yyvsp[-1])->memory = make_number(0.0); (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } -#line 3716 "awkgram.c" /* yacc.c:1646 */ +#line 3711 "awkgram.c" /* yacc.c:1646 */ break; case 160: -#line 1663 "awkgram.y" /* yacc.c:1646 */ +#line 1658 "awkgram.y" /* yacc.c:1646 */ { func_use((yyvsp[0])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[0]); } -#line 3725 "awkgram.c" /* yacc.c:1646 */ +#line 3720 "awkgram.c" /* yacc.c:1646 */ break; case 161: -#line 1668 "awkgram.y" /* yacc.c:1646 */ +#line 1663 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3758,11 +3753,11 @@ regular_print: (yyval) = list_prepend((yyvsp[0]), t); } -#line 3762 "awkgram.c" /* yacc.c:1646 */ +#line 3757 "awkgram.c" /* yacc.c:1646 */ break; case 162: -#line 1704 "awkgram.y" /* yacc.c:1646 */ +#line 1699 "awkgram.y" /* yacc.c:1646 */ { param_sanity((yyvsp[-1])); (yyvsp[-3])->opcode = Op_func_call; @@ -3776,49 +3771,49 @@ regular_print: (yyval) = list_append(t, (yyvsp[-3])); } } -#line 3780 "awkgram.c" /* yacc.c:1646 */ +#line 3775 "awkgram.c" /* yacc.c:1646 */ break; case 163: -#line 1721 "awkgram.y" /* yacc.c:1646 */ +#line 1716 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3786 "awkgram.c" /* yacc.c:1646 */ +#line 3781 "awkgram.c" /* yacc.c:1646 */ break; case 164: -#line 1723 "awkgram.y" /* yacc.c:1646 */ +#line 1718 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3792 "awkgram.c" /* yacc.c:1646 */ +#line 3787 "awkgram.c" /* yacc.c:1646 */ break; case 165: -#line 1728 "awkgram.y" /* yacc.c:1646 */ +#line 1723 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3798 "awkgram.c" /* yacc.c:1646 */ +#line 3793 "awkgram.c" /* yacc.c:1646 */ break; case 166: -#line 1730 "awkgram.y" /* yacc.c:1646 */ +#line 1725 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3804 "awkgram.c" /* yacc.c:1646 */ +#line 3799 "awkgram.c" /* yacc.c:1646 */ break; case 167: -#line 1735 "awkgram.y" /* yacc.c:1646 */ +#line 1730 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3810 "awkgram.c" /* yacc.c:1646 */ +#line 3805 "awkgram.c" /* yacc.c:1646 */ break; case 168: -#line 1737 "awkgram.y" /* yacc.c:1646 */ +#line 1732 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3818 "awkgram.c" /* yacc.c:1646 */ +#line 3813 "awkgram.c" /* yacc.c:1646 */ break; case 169: -#line 1744 "awkgram.y" /* yacc.c:1646 */ +#line 1739 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3832,11 +3827,11 @@ regular_print: sub_counter++; /* count # of dimensions */ (yyval) = (yyvsp[0]); } -#line 3836 "awkgram.c" /* yacc.c:1646 */ +#line 3831 "awkgram.c" /* yacc.c:1646 */ break; case 170: -#line 1761 "awkgram.y" /* yacc.c:1646 */ +#line 1756 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *t = (yyvsp[-1]); if ((yyvsp[-1]) == NULL) { @@ -3850,31 +3845,31 @@ regular_print: (yyvsp[0])->sub_count = count_expressions(&t, false); (yyval) = list_append(t, (yyvsp[0])); } -#line 3854 "awkgram.c" /* yacc.c:1646 */ +#line 3849 "awkgram.c" /* yacc.c:1646 */ break; case 171: -#line 1778 "awkgram.y" /* yacc.c:1646 */ +#line 1773 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3860 "awkgram.c" /* yacc.c:1646 */ +#line 3855 "awkgram.c" /* yacc.c:1646 */ break; case 172: -#line 1780 "awkgram.y" /* yacc.c:1646 */ +#line 1775 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3868 "awkgram.c" /* yacc.c:1646 */ +#line 3863 "awkgram.c" /* yacc.c:1646 */ break; case 173: -#line 1787 "awkgram.y" /* yacc.c:1646 */ +#line 1782 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3874 "awkgram.c" /* yacc.c:1646 */ +#line 3869 "awkgram.c" /* yacc.c:1646 */ break; case 174: -#line 1792 "awkgram.y" /* yacc.c:1646 */ +#line 1787 "awkgram.y" /* yacc.c:1646 */ { char *var_name = (yyvsp[0])->lextok; @@ -3882,22 +3877,22 @@ regular_print: (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); (yyval) = list_create((yyvsp[0])); } -#line 3886 "awkgram.c" /* yacc.c:1646 */ +#line 3881 "awkgram.c" /* yacc.c:1646 */ break; case 175: -#line 1800 "awkgram.y" /* yacc.c:1646 */ +#line 1795 "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 3897 "awkgram.c" /* yacc.c:1646 */ +#line 3892 "awkgram.c" /* yacc.c:1646 */ break; case 176: -#line 1810 "awkgram.y" /* yacc.c:1646 */ +#line 1805 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push @@ -3909,73 +3904,73 @@ regular_print: } else (yyval) = (yyvsp[0]); } -#line 3913 "awkgram.c" /* yacc.c:1646 */ +#line 3908 "awkgram.c" /* yacc.c:1646 */ break; case 177: -#line 1822 "awkgram.y" /* yacc.c:1646 */ +#line 1817 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); if ((yyvsp[0]) != NULL) mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3923 "awkgram.c" /* yacc.c:1646 */ +#line 3918 "awkgram.c" /* yacc.c:1646 */ break; case 178: -#line 1831 "awkgram.y" /* yacc.c:1646 */ +#line 1826 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; } -#line 3931 "awkgram.c" /* yacc.c:1646 */ +#line 3926 "awkgram.c" /* yacc.c:1646 */ break; case 179: -#line 1835 "awkgram.y" /* yacc.c:1646 */ +#line 1830 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; } -#line 3939 "awkgram.c" /* yacc.c:1646 */ +#line 3934 "awkgram.c" /* yacc.c:1646 */ break; case 180: -#line 1838 "awkgram.y" /* yacc.c:1646 */ +#line 1833 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3945 "awkgram.c" /* yacc.c:1646 */ +#line 3940 "awkgram.c" /* yacc.c:1646 */ break; case 182: -#line 1846 "awkgram.y" /* yacc.c:1646 */ +#line 1841 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3951 "awkgram.c" /* yacc.c:1646 */ +#line 3946 "awkgram.c" /* yacc.c:1646 */ break; case 183: -#line 1850 "awkgram.y" /* yacc.c:1646 */ +#line 1845 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3957 "awkgram.c" /* yacc.c:1646 */ +#line 3952 "awkgram.c" /* yacc.c:1646 */ break; case 186: -#line 1859 "awkgram.y" /* yacc.c:1646 */ +#line 1854 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3963 "awkgram.c" /* yacc.c:1646 */ +#line 3958 "awkgram.c" /* yacc.c:1646 */ break; case 187: -#line 1863 "awkgram.y" /* yacc.c:1646 */ +#line 1858 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); yyerrok; } -#line 3969 "awkgram.c" /* yacc.c:1646 */ +#line 3964 "awkgram.c" /* yacc.c:1646 */ break; case 188: -#line 1867 "awkgram.y" /* yacc.c:1646 */ +#line 1862 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3975 "awkgram.c" /* yacc.c:1646 */ +#line 3970 "awkgram.c" /* yacc.c:1646 */ break; -#line 3979 "awkgram.c" /* yacc.c:1646 */ +#line 3974 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4203,7 +4198,7 @@ yyreturn: #endif return yyresult; } -#line 1869 "awkgram.y" /* yacc.c:1906 */ +#line 1864 "awkgram.y" /* yacc.c:1906 */ struct token { @@ -5572,10 +5567,8 @@ yylex(void) pushback(); break; case ']': - if (tokstart[0] == '[' - && (tok == tokstart + 1 - || (tok == tokstart + 2 - && tokstart[1] == '^'))) + if (tok[-1] == '[' + || (tok[-2] == '[' && tok[-1] == '^')) /* do nothing */; else in_brack--; @@ -6816,7 +6809,7 @@ install_function(char *fname, INSTRUCTION *fi, INSTRUCTION *plist) int pcount = 0; r = lookup(fname); - if (r != NULL || is_deferred_variable(fname)) { + if (r != NULL) { error_ln(fi->source_line, _("function name `%s' previously defined"), fname); return -1; } @@ -7009,50 +7002,6 @@ param_sanity(INSTRUCTION *arglist) } } -/* deferred variables --- those that are only defined if needed. */ - -/* - * Is there any reason to use a hash table for deferred variables? At the - * moment, there are only 1 to 3 such variables, so it may not be worth - * the overhead. If more modules start using this facility, it should - * probably be converted into a hash table. - */ - -static struct deferred_variable { - NODE *(*load_func)(void); - struct deferred_variable *next; - char name[1]; /* variable-length array */ -} *deferred_variables; - -/* register_deferred_variable --- add a var name and loading function to the list */ - -void -register_deferred_variable(const char *name, NODE *(*load_func)(void)) -{ - struct deferred_variable *dv; - size_t sl = strlen(name); - - emalloc(dv, struct deferred_variable *, sizeof(*dv)+sl, - "register_deferred_variable"); - dv->load_func = load_func; - dv->next = deferred_variables; - memcpy(dv->name, name, sl+1); - deferred_variables = dv; -} - -/* is_deferred_variable --- check if NAME is a deferred variable */ - -static bool -is_deferred_variable(const char *name) -{ - struct deferred_variable *dv; - for (dv = deferred_variables; dv != NULL; dv = dv->next) - if (strcmp(name, dv->name) == 0) - return true; - return false; -} - - /* variable --- make sure NAME is in the symbol table */ NODE * @@ -7064,44 +7013,14 @@ variable(int location, char *name, NODETYPE type) if (r->type == Node_func || r->type == Node_ext_func ) error_ln(location, _("function `%s' called with space between name and `(',\nor used as a variable or an array"), r->vname); - if (r == symbol_table) - symtab_used = true; } else { /* not found */ - struct deferred_variable *dv; - - for (dv = deferred_variables; true; dv = dv->next) { - if (dv == NULL) { - /* - * This is the only case in which we may not free the string. - */ - return install_symbol(name, type); - } - if (strcmp(name, dv->name) == 0) { - r = (*dv->load_func)(); - break; - } - } + return install_symbol(name, type); } efree(name); return r; } -/* process_deferred --- if the program uses SYMTAB, load deferred variables */ - -static void -process_deferred() -{ - struct deferred_variable *dv; - - if (! symtab_used) - return; - - for (dv = deferred_variables; dv != NULL; dv = dv->next) { - (void) dv->load_func(); - } -} - /* make_regnode --- make a regular expression node */ static NODE * @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2014 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -57,7 +57,6 @@ static int include_source(INSTRUCTION *file); static int load_library(INSTRUCTION *file); static void next_sourcefile(void); static char *tokexpand(void); -static bool is_deferred_variable(const char *name); #define instruction(t) bcalloc(t, 1, 0) @@ -79,8 +78,6 @@ static int count_expressions(INSTRUCTION **list, bool isarg); static INSTRUCTION *optimize_assignment(INSTRUCTION *exp); static void add_lint(INSTRUCTION *list, LINTTYPE linttype); -static void process_deferred(); - enum defref { FUNC_DEFINE, FUNC_USE, FUNC_EXT }; static void func_use(const char *name, enum defref how); static void check_funcs(void); @@ -93,7 +90,6 @@ static void check_comment(void); static bool want_source = false; static bool want_regexp = false; /* lexical scanning kludge */ static char *in_function; /* parsing kludge */ -static bool symtab_used = false; /* program used SYMTAB */ static int rule = 0; const char *const ruletab[] = { @@ -217,8 +213,6 @@ program | program LEX_EOF { next_sourcefile(); - if (sourcefile == srcfiles) - process_deferred(); } | program error { @@ -235,6 +229,7 @@ rule : pattern action { (void) append_rule($1, $2); + first_rule = false; } | pattern statement_term { @@ -3234,10 +3229,8 @@ yylex(void) pushback(); break; case ']': - if (tokstart[0] == '[' - && (tok == tokstart + 1 - || (tok == tokstart + 2 - && tokstart[1] == '^'))) + if (tok[-1] == '[' + || (tok[-2] == '[' && tok[-1] == '^')) /* do nothing */; else in_brack--; @@ -4478,7 +4471,7 @@ install_function(char *fname, INSTRUCTION *fi, INSTRUCTION *plist) int pcount = 0; r = lookup(fname); - if (r != NULL || is_deferred_variable(fname)) { + if (r != NULL) { error_ln(fi->source_line, _("function name `%s' previously defined"), fname); return -1; } @@ -4671,50 +4664,6 @@ param_sanity(INSTRUCTION *arglist) } } -/* deferred variables --- those that are only defined if needed. */ - -/* - * Is there any reason to use a hash table for deferred variables? At the - * moment, there are only 1 to 3 such variables, so it may not be worth - * the overhead. If more modules start using this facility, it should - * probably be converted into a hash table. - */ - -static struct deferred_variable { - NODE *(*load_func)(void); - struct deferred_variable *next; - char name[1]; /* variable-length array */ -} *deferred_variables; - -/* register_deferred_variable --- add a var name and loading function to the list */ - -void -register_deferred_variable(const char *name, NODE *(*load_func)(void)) -{ - struct deferred_variable *dv; - size_t sl = strlen(name); - - emalloc(dv, struct deferred_variable *, sizeof(*dv)+sl, - "register_deferred_variable"); - dv->load_func = load_func; - dv->next = deferred_variables; - memcpy(dv->name, name, sl+1); - deferred_variables = dv; -} - -/* is_deferred_variable --- check if NAME is a deferred variable */ - -static bool -is_deferred_variable(const char *name) -{ - struct deferred_variable *dv; - for (dv = deferred_variables; dv != NULL; dv = dv->next) - if (strcmp(name, dv->name) == 0) - return true; - return false; -} - - /* variable --- make sure NAME is in the symbol table */ NODE * @@ -4726,44 +4675,14 @@ variable(int location, char *name, NODETYPE type) if (r->type == Node_func || r->type == Node_ext_func ) error_ln(location, _("function `%s' called with space between name and `(',\nor used as a variable or an array"), r->vname); - if (r == symbol_table) - symtab_used = true; } else { /* not found */ - struct deferred_variable *dv; - - for (dv = deferred_variables; true; dv = dv->next) { - if (dv == NULL) { - /* - * This is the only case in which we may not free the string. - */ - return install_symbol(name, type); - } - if (strcmp(name, dv->name) == 0) { - r = (*dv->load_func)(); - break; - } - } + return install_symbol(name, type); } efree(name); return r; } -/* process_deferred --- if the program uses SYMTAB, load deferred variables */ - -static void -process_deferred() -{ - struct deferred_variable *dv; - - if (! symtab_used) - return; - - for (dv = deferred_variables; dv != NULL; dv = dv->next) { - (void) dv->load_func(); - } -} - /* make_regnode --- make a regular expression node */ static NODE * @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 1988, 1989, 1991-2014 the Free Software Foundation, Inc. + * Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -510,6 +510,9 @@ do_length(int nargs) * Support for deferred loading of array elements requires that * we use the array length interface even though it isn't * necessary for the built-in array types. + * + * 1/2015: The deferred arrays are gone, but this is probably + * still a good idea. */ size = assoc_length(tmp); @@ -904,7 +907,10 @@ check_pos: case '*': if (cur == NULL) break; - if (! do_traditional && isdigit((unsigned char) *s1)) { + if (! do_traditional && used_dollar && ! isdigit((unsigned char) *s1)) { + fatal(_("fatal: must use `count$' on all formats or none")); + break; /* silence warnings */ + } else if (! do_traditional && isdigit((unsigned char) *s1)) { int val = 0; for (; n0 > 0 && *s1 && isdigit((unsigned char) *s1); s1++, n0--) { @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 3.0.3. */ /* 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-2015 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 @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.2" +#define YYBISON_VERSION "3.0.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -5845,7 +5845,7 @@ then # enable debugging using macros also if test "$GCC" = yes then - CFLAGS="$CFLAGS -Wall -fno-builtin -g3 -gdwarf-2" + CFLAGS="$CFLAGS -Wall -fno-builtin -g3" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } diff --git a/configure.ac b/configure.ac index 7e5f69c3..c6b4dd76 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl dnl configure.ac --- autoconf input file for gawk dnl -dnl Copyright (C) 1995-2014 the Free Software Foundation, Inc. +dnl Copyright (C) 1995-2015 the Free Software Foundation, Inc. dnl dnl This file is part of GAWK, the GNU implementation of the dnl AWK Programming Language. @@ -97,7 +97,7 @@ then # enable debugging using macros also if test "$GCC" = yes then - CFLAGS="$CFLAGS -Wall -fno-builtin -g3 -gdwarf-2" + CFLAGS="$CFLAGS -Wall -fno-builtin -g3" fi AC_MSG_RESULT([yes]) else @@ -1,5 +1,5 @@ /* dfa.c - deterministic extended regexp routines for GNU - Copyright (C) 1988, 1998, 2000, 2002, 2004-2005, 2007-2014 Free Software + Copyright (C) 1988, 1998, 2000, 2002, 2004-2005, 2007-2015 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -1,5 +1,5 @@ /* dfa.h - declarations for GNU deterministic regexp compiler - Copyright (C) 1988, 1998, 2007, 2009-2014 Free Software Foundation, Inc. + Copyright (C) 1988, 1998, 2007, 2009-2015 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 diff --git a/doc/ChangeLog b/doc/ChangeLog index 4a6fa085..1e2d7af3 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-01-19 Arnold D. Robbins <arnold@skeeve.com> + + * gawkinet.texi: Fix capitalization in document title. + * gawktexi.in: Here we again: Starting on more O'Reilly fixes. + 2015-01-05 Andrew J. Schorr <aschorr@telemetry-investments.com> * gawktexi.in: Improve get_file documentation. diff --git a/doc/gawk.info b/doc/gawk.info index f0a9d84d..ba5dbdf5 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -9,7 +9,7 @@ START-INFO-DIR-ENTRY * awk: (gawk)Invoking gawk. Text scanning and processing. END-INFO-DIR-ENTRY - Copyright (C) 1989, 1991, 1992, 1993, 1996-2005, 2007, 2009-2014 + Copyright (C) 1989, 1991, 1992, 1993, 1996-2005, 2007, 2009-2015 Free Software Foundation, Inc. @@ -37,7 +37,7 @@ General Introduction This file documents `awk', a program that you can use to select particular records in a file and perform operations upon them. - Copyright (C) 1989, 1991, 1992, 1993, 1996-2005, 2007, 2009-2014 + Copyright (C) 1989, 1991, 1992, 1993, 1996-2005, 2007, 2009-2015 Free Software Foundation, Inc. @@ -750,10 +750,10 @@ and associative arrays. Those looking for something new can try out The programs in this book make clear that an AWK program is typically much smaller and faster to develop than a counterpart written -in C. Consequently, there is often a payoff to prototype an algorithm -or design in AWK to get it running quickly and expose problems early. -Often, the interpreted performance is adequate and the AWK prototype -becomes the product. +in C. Consequently, there is often a payoff to prototyping an +algorithm or design in AWK to get it running quickly and expose +problems early. Often, the interpreted performance is adequate and the +AWK prototype becomes the product. The new `pgawk' (profiling `gawk'), produces program execution counts. I recently experimented with an algorithm that for n lines of @@ -777,16 +777,16 @@ Foreword to the Fourth Edition ****************************** Some things don't change. Thirteen years ago I wrote: "If you use AWK -or want to learn how, then read this book." True then and still true +or want to learn how, then read this book." True then, and still true today. - Learning to use a programming language is more than mastering the -syntax. One needs to acquire an understanding of how to use the + Learning to use a programming language is about more than mastering +the syntax. One needs to acquire an understanding of how to use the features of the language to solve practical programming problems. A focus of this book is many examples that show how to use AWK. Some things do change. Our computers are much faster and have more -memory. Consequently, speed and storage inefficiencies of a high level +memory. Consequently, speed and storage inefficiencies of a high-level language matter less. Prototyping in AWK and then rewriting in C for performance reasons happens less, because more often the prototype is fast enough. @@ -795,9 +795,9 @@ fast enough. C++. With `gawk' 4.1 and later, you do not have to choose between writing your program in AWK or in C/C++. You can write most of your program in AWK and the aspects that require C/C++ capabilities can be -written in C/C++ and then the pieces glued together when the `gawk' +written in C/C++, and then the pieces glued together when the `gawk' module loads the C/C++ module as a dynamic plug-in. *note Dynamic -Extensions::, has all the details, and as expected, many examples to +Extensions::, has all the details, and, as expected, many examples to help you learn the ins and outs. I enjoy programming in AWK and had fun (re)reading this book. I @@ -836,7 +836,7 @@ So most of the time, we don't distinguish between `gawk' and other * Validate data - * Produce indexes and perform other document preparation tasks + * Produce indexes and perform other document-preparation tasks * Experiment with algorithms that you can adapt later to other computer languages @@ -928,7 +928,7 @@ advice from Richard Stallman. John Woods contributed parts of the code as well. In 1988 and 1989, David Trueman, with help from me, thoroughly reworked `gawk' for compatibility with the newer `awk'. Circa 1994, I became the primary maintainer. Current development -focuses on bug fixes, performance improvements, standards compliance +focuses on bug fixes, performance improvements, standards compliance, and, occasionally, new features. In May 1997, Ju"rgen Kahrs felt the need for network access from @@ -940,10 +940,10 @@ the `gawk' distribution). His code finally became part of the main John Haque rewrote the `gawk' internals, in the process providing an `awk'-level debugger. This version became available as `gawk' version -4.0, in 2011. +4.0 in 2011. - *Note Contributors::, for a full list of those who made important -contributions to `gawk'. + *Note Contributors::, for a full list of those who have made +important contributions to `gawk'. File: gawk.info, Node: Names, Next: This Manual, Prev: History, Up: Preface @@ -956,7 +956,7 @@ provided in *note Language History::. The language described in this Info file is often referred to as "new `awk'." By analogy, the original version of `awk' is referred to as "old `awk'." - Today, on most systems, when you run the `awk' utility, you get some + Today, on most systems, when you run the `awk' utility you get some version of new `awk'.(1) If your system's standard `awk' is the old one, you will see something like this if you try the test program: @@ -1016,9 +1016,9 @@ in *note Sample Programs::, should be of interest. This Info file is split into several parts, as follows: - * Part I describes the `awk' language and `gawk' program in detail. - It starts with the basics, and continues through all of the - features of `awk'. It contains the following chapters: + * Part I describes the `awk' language and the `gawk' program in + detail. It starts with the basics, and continues through all of + the features of `awk'. It contains the following chapters: - *note Getting Started::, provides the essentials you need to know to begin using `awk'. @@ -1049,9 +1049,10 @@ in *note Sample Programs::, should be of interest. `gawk' use. - *note Arrays::, covers `awk''s one-and-only data structure: - associative arrays. Deleting array elements and whole arrays - is also described, as well as sorting arrays in `gawk'. It - also describes how `gawk' provides arrays of arrays. + the associative array. Deleting array elements and whole + arrays is also described, as well as sorting arrays in + `gawk'. It also describes how `gawk' provides arrays of + arrays. - *note Functions::, describes the built-in functions `awk' and `gawk' provide, as well as how to define your own functions. @@ -34572,561 +34573,561 @@ Index Tag Table: Node: Top1204 Node: Foreword342385 -Node: Foreword446827 -Node: Preface48349 -Ref: Preface-Footnote-151220 -Ref: Preface-Footnote-251327 -Ref: Preface-Footnote-351560 -Node: History51702 -Node: Names54048 -Ref: Names-Footnote-155142 -Node: This Manual55288 -Ref: This Manual-Footnote-161775 -Node: Conventions61875 -Node: Manual History64213 -Ref: Manual History-Footnote-167195 -Ref: Manual History-Footnote-267236 -Node: How To Contribute67310 -Node: Acknowledgments68439 -Node: Getting Started73244 -Node: Running gawk75677 -Node: One-shot76867 -Node: Read Terminal78115 -Node: Long80142 -Node: Executable Scripts81658 -Ref: Executable Scripts-Footnote-184447 -Node: Comments84550 -Node: Quoting87032 -Node: DOS Quoting92556 -Node: Sample Data Files93231 -Node: Very Simple95826 -Node: Two Rules100724 -Node: More Complex102610 -Node: Statements/Lines105472 -Ref: Statements/Lines-Footnote-1109927 -Node: Other Features110192 -Node: When111123 -Ref: When-Footnote-1112877 -Node: Intro Summary112942 -Node: Invoking Gawk113825 -Node: Command Line115339 -Node: Options116137 -Ref: Options-Footnote-1131941 -Ref: Options-Footnote-2132170 -Node: Other Arguments132195 -Node: Naming Standard Input135143 -Node: Environment Variables136236 -Node: AWKPATH Variable136794 -Ref: AWKPATH Variable-Footnote-1140207 -Ref: AWKPATH Variable-Footnote-2140252 -Node: AWKLIBPATH Variable140512 -Node: Other Environment Variables141768 -Node: Exit Status145256 -Node: Include Files145932 -Node: Loading Shared Libraries149529 -Node: Obsolete150956 -Node: Undocumented151653 -Node: Invoking Summary151920 -Node: Regexp153584 -Node: Regexp Usage155038 -Node: Escape Sequences157075 -Node: Regexp Operators163316 -Ref: Regexp Operators-Footnote-1170742 -Ref: Regexp Operators-Footnote-2170889 -Node: Bracket Expressions170987 -Ref: table-char-classes173002 -Node: Leftmost Longest175926 -Node: Computed Regexps177228 -Node: GNU Regexp Operators180625 -Node: Case-sensitivity184298 -Ref: Case-sensitivity-Footnote-1187183 -Ref: Case-sensitivity-Footnote-2187418 -Node: Regexp Summary187526 -Node: Reading Files188993 -Node: Records191156 -Node: awk split records191889 -Node: gawk split records196804 -Ref: gawk split records-Footnote-1201348 -Node: Fields201385 -Ref: Fields-Footnote-1204161 -Node: Nonconstant Fields204247 -Ref: Nonconstant Fields-Footnote-1206490 -Node: Changing Fields206694 -Node: Field Separators212623 -Node: Default Field Splitting215328 -Node: Regexp Field Splitting216445 -Node: Single Character Fields219795 -Node: Command Line Field Separator220854 -Node: Full Line Fields224066 -Ref: Full Line Fields-Footnote-1225583 -Ref: Full Line Fields-Footnote-2225629 -Node: Field Splitting Summary225730 -Node: Constant Size227804 -Node: Splitting By Content232393 -Ref: Splitting By Content-Footnote-1236387 -Node: Multiple Line236550 -Ref: Multiple Line-Footnote-1242436 -Node: Getline242615 -Node: Plain Getline245099 -Node: Getline/Variable247739 -Node: Getline/File248887 -Node: Getline/Variable/File250271 -Ref: Getline/Variable/File-Footnote-1251874 -Node: Getline/Pipe251961 -Node: Getline/Variable/Pipe254644 -Node: Getline/Coprocess255775 -Node: Getline/Variable/Coprocess257027 -Node: Getline Notes257766 -Node: Getline Summary260558 -Ref: table-getline-variants260970 -Node: Read Timeout261799 -Ref: Read Timeout-Footnote-1265690 -Node: Retrying Input265748 -Node: Command-line directories266943 -Node: Input Summary267850 -Node: Input Exercises271151 -Node: Printing271879 -Node: Print273656 -Node: Print Examples275113 -Node: Output Separators277892 -Node: OFMT279910 -Node: Printf281264 -Node: Basic Printf282049 -Node: Control Letters283619 -Node: Format Modifiers287602 -Node: Printf Examples293611 -Node: Redirection296097 -Node: Special FD302938 -Ref: Special FD-Footnote-1306098 -Node: Special Files306172 -Node: Other Inherited Files306789 -Node: Special Network307789 -Node: Special Caveats308651 -Node: Close Files And Pipes309602 -Ref: Close Files And Pipes-Footnote-1316784 -Ref: Close Files And Pipes-Footnote-2316932 -Node: Output Summary317082 -Node: Output Exercises318080 -Node: Expressions318760 -Node: Values319945 -Node: Constants320623 -Node: Scalar Constants321314 -Ref: Scalar Constants-Footnote-1322173 -Node: Nondecimal-numbers322423 -Node: Regexp Constants325441 -Node: Using Constant Regexps325966 -Node: Variables329109 -Node: Using Variables329764 -Node: Assignment Options331675 -Node: Conversion333550 -Node: Strings And Numbers334074 -Ref: Strings And Numbers-Footnote-1337139 -Node: Locale influences conversions337248 -Ref: table-locale-affects339995 -Node: All Operators340583 -Node: Arithmetic Ops341213 -Node: Concatenation343718 -Ref: Concatenation-Footnote-1346537 -Node: Assignment Ops346643 -Ref: table-assign-ops351622 -Node: Increment Ops352894 -Node: Truth Values and Conditions356332 -Node: Truth Values357417 -Node: Typing and Comparison358466 -Node: Variable Typing359276 -Node: Comparison Operators362929 -Ref: table-relational-ops363339 -Node: POSIX String Comparison366834 -Ref: POSIX String Comparison-Footnote-1367906 -Node: Boolean Ops368044 -Ref: Boolean Ops-Footnote-1372523 -Node: Conditional Exp372614 -Node: Function Calls374341 -Node: Precedence378221 -Node: Locales381882 -Node: Expressions Summary383514 -Node: Patterns and Actions386074 -Node: Pattern Overview387194 -Node: Regexp Patterns388873 -Node: Expression Patterns389416 -Node: Ranges393126 -Node: BEGIN/END396232 -Node: Using BEGIN/END396993 -Ref: Using BEGIN/END-Footnote-1399727 -Node: I/O And BEGIN/END399833 -Node: BEGINFILE/ENDFILE402147 -Node: Empty405048 -Node: Using Shell Variables405365 -Node: Action Overview407638 -Node: Statements409964 -Node: If Statement411812 -Node: While Statement413307 -Node: Do Statement415336 -Node: For Statement416480 -Node: Switch Statement419637 -Node: Break Statement422019 -Node: Continue Statement424060 -Node: Next Statement425887 -Node: Nextfile Statement428268 -Node: Exit Statement430898 -Node: Built-in Variables433301 -Node: User-modified434434 -Ref: User-modified-Footnote-1442115 -Node: Auto-set442177 -Ref: Auto-set-Footnote-1456393 -Ref: Auto-set-Footnote-2456598 -Node: ARGC and ARGV456654 -Node: Pattern Action Summary460872 -Node: Arrays463299 -Node: Array Basics464628 -Node: Array Intro465472 -Ref: figure-array-elements467436 -Ref: Array Intro-Footnote-1469962 -Node: Reference to Elements470090 -Node: Assigning Elements472542 -Node: Array Example473033 -Node: Scanning an Array474791 -Node: Controlling Scanning477807 -Ref: Controlling Scanning-Footnote-1483003 -Node: Numeric Array Subscripts483319 -Node: Uninitialized Subscripts485504 -Node: Delete487121 -Ref: Delete-Footnote-1489864 -Node: Multidimensional489921 -Node: Multiscanning493018 -Node: Arrays of Arrays494607 -Node: Arrays Summary499366 -Node: Functions501458 -Node: Built-in502357 -Node: Calling Built-in503435 -Node: Numeric Functions505426 -Ref: Numeric Functions-Footnote-1510245 -Ref: Numeric Functions-Footnote-2510602 -Ref: Numeric Functions-Footnote-3510650 -Node: String Functions510922 -Ref: String Functions-Footnote-1534397 -Ref: String Functions-Footnote-2534526 -Ref: String Functions-Footnote-3534774 -Node: Gory Details534861 -Ref: table-sub-escapes536642 -Ref: table-sub-proposed538162 -Ref: table-posix-sub539526 -Ref: table-gensub-escapes541062 -Ref: Gory Details-Footnote-1541894 -Node: I/O Functions542045 -Ref: I/O Functions-Footnote-1549263 -Node: Time Functions549410 -Ref: Time Functions-Footnote-1559898 -Ref: Time Functions-Footnote-2559966 -Ref: Time Functions-Footnote-3560124 -Ref: Time Functions-Footnote-4560235 -Ref: Time Functions-Footnote-5560347 -Ref: Time Functions-Footnote-6560574 -Node: Bitwise Functions560840 -Ref: table-bitwise-ops561402 -Ref: Bitwise Functions-Footnote-1565711 -Node: Type Functions565880 -Node: I18N Functions567031 -Node: User-defined568676 -Node: Definition Syntax569481 -Ref: Definition Syntax-Footnote-1574888 -Node: Function Example574959 -Ref: Function Example-Footnote-1577878 -Node: Function Caveats577900 -Node: Calling A Function578418 -Node: Variable Scope579376 -Node: Pass By Value/Reference582364 -Node: Return Statement585859 -Node: Dynamic Typing588840 -Node: Indirect Calls589769 -Ref: Indirect Calls-Footnote-1601071 -Node: Functions Summary601199 -Node: Library Functions603901 -Ref: Library Functions-Footnote-1607510 -Ref: Library Functions-Footnote-2607653 -Node: Library Names607824 -Ref: Library Names-Footnote-1611278 -Ref: Library Names-Footnote-2611501 -Node: General Functions611587 -Node: Strtonum Function612690 -Node: Assert Function615712 -Node: Round Function619036 -Node: Cliff Random Function620577 -Node: Ordinal Functions621593 -Ref: Ordinal Functions-Footnote-1624656 -Ref: Ordinal Functions-Footnote-2624908 -Node: Join Function625119 -Ref: Join Function-Footnote-1626888 -Node: Getlocaltime Function627088 -Node: Readfile Function630832 -Node: Shell Quoting632802 -Node: Data File Management634203 -Node: Filetrans Function634835 -Node: Rewind Function638891 -Node: File Checking640278 -Ref: File Checking-Footnote-1641610 -Node: Empty Files641811 -Node: Ignoring Assigns643790 -Node: Getopt Function645341 -Ref: Getopt Function-Footnote-1656803 -Node: Passwd Functions657003 -Ref: Passwd Functions-Footnote-1665840 -Node: Group Functions665928 -Ref: Group Functions-Footnote-1673822 -Node: Walking Arrays674035 -Node: Library Functions Summary675638 -Node: Library Exercises677039 -Node: Sample Programs678319 -Node: Running Examples679089 -Node: Clones679817 -Node: Cut Program681041 -Node: Egrep Program690760 -Ref: Egrep Program-Footnote-1698258 -Node: Id Program698368 -Node: Split Program702013 -Ref: Split Program-Footnote-1705461 -Node: Tee Program705589 -Node: Uniq Program708378 -Node: Wc Program715797 -Ref: Wc Program-Footnote-1720047 -Node: Miscellaneous Programs720141 -Node: Dupword Program721354 -Node: Alarm Program723385 -Node: Translate Program728189 -Ref: Translate Program-Footnote-1732754 -Node: Labels Program733024 -Ref: Labels Program-Footnote-1736375 -Node: Word Sorting736459 -Node: History Sorting740530 -Node: Extract Program742366 -Node: Simple Sed749891 -Node: Igawk Program752959 -Ref: Igawk Program-Footnote-1767283 -Ref: Igawk Program-Footnote-2767484 -Ref: Igawk Program-Footnote-3767606 -Node: Anagram Program767721 -Node: Signature Program770778 -Node: Programs Summary772025 -Node: Programs Exercises773218 -Ref: Programs Exercises-Footnote-1777349 -Node: Advanced Features777440 -Node: Nondecimal Data779388 -Node: Array Sorting780978 -Node: Controlling Array Traversal781675 -Ref: Controlling Array Traversal-Footnote-1790008 -Node: Array Sorting Functions790126 -Ref: Array Sorting Functions-Footnote-1794015 -Node: Two-way I/O794211 -Ref: Two-way I/O-Footnote-1799156 -Ref: Two-way I/O-Footnote-2799342 -Node: TCP/IP Networking799424 -Node: Profiling802297 -Node: Advanced Features Summary810574 -Node: Internationalization812507 -Node: I18N and L10N813987 -Node: Explaining gettext814673 -Ref: Explaining gettext-Footnote-1819698 -Ref: Explaining gettext-Footnote-2819882 -Node: Programmer i18n820047 -Ref: Programmer i18n-Footnote-1824913 -Node: Translator i18n824962 -Node: String Extraction825756 -Ref: String Extraction-Footnote-1826887 -Node: Printf Ordering826973 -Ref: Printf Ordering-Footnote-1829759 -Node: I18N Portability829823 -Ref: I18N Portability-Footnote-1832278 -Node: I18N Example832341 -Ref: I18N Example-Footnote-1835144 -Node: Gawk I18N835216 -Node: I18N Summary835854 -Node: Debugger837193 -Node: Debugging838215 -Node: Debugging Concepts838656 -Node: Debugging Terms840509 -Node: Awk Debugging843081 -Node: Sample Debugging Session843975 -Node: Debugger Invocation844495 -Node: Finding The Bug845879 -Node: List of Debugger Commands852354 -Node: Breakpoint Control853687 -Node: Debugger Execution Control857383 -Node: Viewing And Changing Data860747 -Node: Execution Stack864125 -Node: Debugger Info865762 -Node: Miscellaneous Debugger Commands869779 -Node: Readline Support874808 -Node: Limitations875700 -Node: Debugging Summary877814 -Node: Arbitrary Precision Arithmetic878982 -Node: Computer Arithmetic880398 -Ref: table-numeric-ranges883996 -Ref: Computer Arithmetic-Footnote-1884855 -Node: Math Definitions884912 -Ref: table-ieee-formats888200 -Ref: Math Definitions-Footnote-1888804 -Node: MPFR features888909 -Node: FP Math Caution890580 -Ref: FP Math Caution-Footnote-1891630 -Node: Inexactness of computations891999 -Node: Inexact representation892958 -Node: Comparing FP Values894315 -Node: Errors accumulate895397 -Node: Getting Accuracy896830 -Node: Try To Round899492 -Node: Setting precision900391 -Ref: table-predefined-precision-strings901075 -Node: Setting the rounding mode902864 -Ref: table-gawk-rounding-modes903228 -Ref: Setting the rounding mode-Footnote-1906683 -Node: Arbitrary Precision Integers906862 -Ref: Arbitrary Precision Integers-Footnote-1911761 -Node: POSIX Floating Point Problems911910 -Ref: POSIX Floating Point Problems-Footnote-1915783 -Node: Floating point summary915821 -Node: Dynamic Extensions918015 -Node: Extension Intro919567 -Node: Plugin License920833 -Node: Extension Mechanism Outline921630 -Ref: figure-load-extension922058 -Ref: figure-register-new-function923538 -Ref: figure-call-new-function924542 -Node: Extension API Description926528 -Node: Extension API Functions Introduction928062 -Node: General Data Types932934 -Ref: General Data Types-Footnote-1938673 -Node: Memory Allocation Functions938972 -Ref: Memory Allocation Functions-Footnote-1941811 -Node: Constructor Functions941907 -Node: Registration Functions943641 -Node: Extension Functions944326 -Node: Exit Callback Functions946623 -Node: Extension Version String947871 -Node: Input Parsers948536 -Node: Output Wrappers958415 -Node: Two-way processors962930 -Node: Printing Messages965134 -Ref: Printing Messages-Footnote-1966210 -Node: Updating `ERRNO'966362 -Node: Requesting Values967102 -Ref: table-value-types-returned967830 -Node: Accessing Parameters968787 -Node: Symbol Table Access970018 -Node: Symbol table by name970532 -Node: Symbol table by cookie972513 -Ref: Symbol table by cookie-Footnote-1976657 -Node: Cached values976720 -Ref: Cached values-Footnote-1980219 -Node: Array Manipulation980310 -Ref: Array Manipulation-Footnote-1981400 -Node: Array Data Types981437 -Ref: Array Data Types-Footnote-1984092 -Node: Array Functions984184 -Node: Flattening Arrays988038 -Node: Creating Arrays994930 -Node: Redirection API999701 -Node: Extension API Variables1002472 -Node: Extension Versioning1003105 -Node: Extension API Informational Variables1005006 -Node: Extension API Boilerplate1006071 -Node: Finding Extensions1009880 -Node: Extension Example1010440 -Node: Internal File Description1011212 -Node: Internal File Ops1015279 -Ref: Internal File Ops-Footnote-11026949 -Node: Using Internal File Ops1027089 -Ref: Using Internal File Ops-Footnote-11029472 -Node: Extension Samples1029745 -Node: Extension Sample File Functions1031271 -Node: Extension Sample Fnmatch1038909 -Node: Extension Sample Fork1040400 -Node: Extension Sample Inplace1041615 -Node: Extension Sample Ord1043290 -Node: Extension Sample Readdir1044126 -Ref: table-readdir-file-types1045002 -Node: Extension Sample Revout1045813 -Node: Extension Sample Rev2way1046403 -Node: Extension Sample Read write array1047143 -Node: Extension Sample Readfile1049083 -Node: Extension Sample Time1050178 -Node: Extension Sample API Tests1051527 -Node: gawkextlib1052018 -Node: Extension summary1054676 -Node: Extension Exercises1058365 -Node: Language History1059087 -Node: V7/SVR3.11060743 -Node: SVR41062924 -Node: POSIX1064369 -Node: BTL1065758 -Node: POSIX/GNU1066492 -Node: Feature History1072116 -Node: Common Extensions1085214 -Node: Ranges and Locales1086538 -Ref: Ranges and Locales-Footnote-11091156 -Ref: Ranges and Locales-Footnote-21091183 -Ref: Ranges and Locales-Footnote-31091417 -Node: Contributors1091638 -Node: History summary1097179 -Node: Installation1098549 -Node: Gawk Distribution1099495 -Node: Getting1099979 -Node: Extracting1100802 -Node: Distribution contents1102437 -Node: Unix Installation1108502 -Node: Quick Installation1109185 -Node: Shell Startup Files1111596 -Node: Additional Configuration Options1112675 -Node: Configuration Philosophy1114414 -Node: Non-Unix Installation1116783 -Node: PC Installation1117241 -Node: PC Binary Installation1118560 -Node: PC Compiling1120408 -Ref: PC Compiling-Footnote-11123429 -Node: PC Testing1123538 -Node: PC Using1124714 -Node: Cygwin1128829 -Node: MSYS1129652 -Node: VMS Installation1130152 -Node: VMS Compilation1130944 -Ref: VMS Compilation-Footnote-11132166 -Node: VMS Dynamic Extensions1132224 -Node: VMS Installation Details1133908 -Node: VMS Running1136160 -Node: VMS GNV1138996 -Node: VMS Old Gawk1139730 -Node: Bugs1140200 -Node: Other Versions1144083 -Node: Installation summary1150511 -Node: Notes1151567 -Node: Compatibility Mode1152432 -Node: Additions1153214 -Node: Accessing The Source1154139 -Node: Adding Code1155575 -Node: New Ports1161740 -Node: Derived Files1166222 -Ref: Derived Files-Footnote-11171697 -Ref: Derived Files-Footnote-21171731 -Ref: Derived Files-Footnote-31172327 -Node: Future Extensions1172441 -Node: Implementation Limitations1173047 -Node: Extension Design1174295 -Node: Old Extension Problems1175449 -Ref: Old Extension Problems-Footnote-11176966 -Node: Extension New Mechanism Goals1177023 -Ref: Extension New Mechanism Goals-Footnote-11180383 -Node: Extension Other Design Decisions1180572 -Node: Extension Future Growth1182680 -Node: Old Extension Mechanism1183516 -Node: Notes summary1185278 -Node: Basic Concepts1186464 -Node: Basic High Level1187145 -Ref: figure-general-flow1187417 -Ref: figure-process-flow1188016 -Ref: Basic High Level-Footnote-11191245 -Node: Basic Data Typing1191430 -Node: Glossary1194758 -Node: Copying1219916 -Node: GNU Free Documentation License1257472 -Node: Index1282608 +Node: Foreword446829 +Node: Preface48360 +Ref: Preface-Footnote-151231 +Ref: Preface-Footnote-251338 +Ref: Preface-Footnote-351571 +Node: History51713 +Node: Names54064 +Ref: Names-Footnote-155157 +Node: This Manual55303 +Ref: This Manual-Footnote-161808 +Node: Conventions61908 +Node: Manual History64246 +Ref: Manual History-Footnote-167228 +Ref: Manual History-Footnote-267269 +Node: How To Contribute67343 +Node: Acknowledgments68472 +Node: Getting Started73277 +Node: Running gawk75710 +Node: One-shot76900 +Node: Read Terminal78148 +Node: Long80175 +Node: Executable Scripts81691 +Ref: Executable Scripts-Footnote-184480 +Node: Comments84583 +Node: Quoting87065 +Node: DOS Quoting92589 +Node: Sample Data Files93264 +Node: Very Simple95859 +Node: Two Rules100757 +Node: More Complex102643 +Node: Statements/Lines105505 +Ref: Statements/Lines-Footnote-1109960 +Node: Other Features110225 +Node: When111156 +Ref: When-Footnote-1112910 +Node: Intro Summary112975 +Node: Invoking Gawk113858 +Node: Command Line115372 +Node: Options116170 +Ref: Options-Footnote-1131974 +Ref: Options-Footnote-2132203 +Node: Other Arguments132228 +Node: Naming Standard Input135176 +Node: Environment Variables136269 +Node: AWKPATH Variable136827 +Ref: AWKPATH Variable-Footnote-1140240 +Ref: AWKPATH Variable-Footnote-2140285 +Node: AWKLIBPATH Variable140545 +Node: Other Environment Variables141801 +Node: Exit Status145289 +Node: Include Files145965 +Node: Loading Shared Libraries149562 +Node: Obsolete150989 +Node: Undocumented151686 +Node: Invoking Summary151953 +Node: Regexp153617 +Node: Regexp Usage155071 +Node: Escape Sequences157108 +Node: Regexp Operators163349 +Ref: Regexp Operators-Footnote-1170775 +Ref: Regexp Operators-Footnote-2170922 +Node: Bracket Expressions171020 +Ref: table-char-classes173035 +Node: Leftmost Longest175959 +Node: Computed Regexps177261 +Node: GNU Regexp Operators180658 +Node: Case-sensitivity184331 +Ref: Case-sensitivity-Footnote-1187216 +Ref: Case-sensitivity-Footnote-2187451 +Node: Regexp Summary187559 +Node: Reading Files189026 +Node: Records191189 +Node: awk split records191922 +Node: gawk split records196837 +Ref: gawk split records-Footnote-1201381 +Node: Fields201418 +Ref: Fields-Footnote-1204194 +Node: Nonconstant Fields204280 +Ref: Nonconstant Fields-Footnote-1206523 +Node: Changing Fields206727 +Node: Field Separators212656 +Node: Default Field Splitting215361 +Node: Regexp Field Splitting216478 +Node: Single Character Fields219828 +Node: Command Line Field Separator220887 +Node: Full Line Fields224099 +Ref: Full Line Fields-Footnote-1225616 +Ref: Full Line Fields-Footnote-2225662 +Node: Field Splitting Summary225763 +Node: Constant Size227837 +Node: Splitting By Content232426 +Ref: Splitting By Content-Footnote-1236420 +Node: Multiple Line236583 +Ref: Multiple Line-Footnote-1242469 +Node: Getline242648 +Node: Plain Getline245132 +Node: Getline/Variable247772 +Node: Getline/File248920 +Node: Getline/Variable/File250304 +Ref: Getline/Variable/File-Footnote-1251907 +Node: Getline/Pipe251994 +Node: Getline/Variable/Pipe254677 +Node: Getline/Coprocess255808 +Node: Getline/Variable/Coprocess257060 +Node: Getline Notes257799 +Node: Getline Summary260591 +Ref: table-getline-variants261003 +Node: Read Timeout261832 +Ref: Read Timeout-Footnote-1265723 +Node: Retrying Input265781 +Node: Command-line directories266976 +Node: Input Summary267883 +Node: Input Exercises271184 +Node: Printing271912 +Node: Print273689 +Node: Print Examples275146 +Node: Output Separators277925 +Node: OFMT279943 +Node: Printf281297 +Node: Basic Printf282082 +Node: Control Letters283652 +Node: Format Modifiers287635 +Node: Printf Examples293644 +Node: Redirection296130 +Node: Special FD302971 +Ref: Special FD-Footnote-1306131 +Node: Special Files306205 +Node: Other Inherited Files306822 +Node: Special Network307822 +Node: Special Caveats308684 +Node: Close Files And Pipes309635 +Ref: Close Files And Pipes-Footnote-1316817 +Ref: Close Files And Pipes-Footnote-2316965 +Node: Output Summary317115 +Node: Output Exercises318113 +Node: Expressions318793 +Node: Values319978 +Node: Constants320656 +Node: Scalar Constants321347 +Ref: Scalar Constants-Footnote-1322206 +Node: Nondecimal-numbers322456 +Node: Regexp Constants325474 +Node: Using Constant Regexps325999 +Node: Variables329142 +Node: Using Variables329797 +Node: Assignment Options331708 +Node: Conversion333583 +Node: Strings And Numbers334107 +Ref: Strings And Numbers-Footnote-1337172 +Node: Locale influences conversions337281 +Ref: table-locale-affects340028 +Node: All Operators340616 +Node: Arithmetic Ops341246 +Node: Concatenation343751 +Ref: Concatenation-Footnote-1346570 +Node: Assignment Ops346676 +Ref: table-assign-ops351655 +Node: Increment Ops352927 +Node: Truth Values and Conditions356365 +Node: Truth Values357450 +Node: Typing and Comparison358499 +Node: Variable Typing359309 +Node: Comparison Operators362962 +Ref: table-relational-ops363372 +Node: POSIX String Comparison366867 +Ref: POSIX String Comparison-Footnote-1367939 +Node: Boolean Ops368077 +Ref: Boolean Ops-Footnote-1372556 +Node: Conditional Exp372647 +Node: Function Calls374374 +Node: Precedence378254 +Node: Locales381915 +Node: Expressions Summary383547 +Node: Patterns and Actions386107 +Node: Pattern Overview387227 +Node: Regexp Patterns388906 +Node: Expression Patterns389449 +Node: Ranges393159 +Node: BEGIN/END396265 +Node: Using BEGIN/END397026 +Ref: Using BEGIN/END-Footnote-1399760 +Node: I/O And BEGIN/END399866 +Node: BEGINFILE/ENDFILE402180 +Node: Empty405081 +Node: Using Shell Variables405398 +Node: Action Overview407671 +Node: Statements409997 +Node: If Statement411845 +Node: While Statement413340 +Node: Do Statement415369 +Node: For Statement416513 +Node: Switch Statement419670 +Node: Break Statement422052 +Node: Continue Statement424093 +Node: Next Statement425920 +Node: Nextfile Statement428301 +Node: Exit Statement430931 +Node: Built-in Variables433334 +Node: User-modified434467 +Ref: User-modified-Footnote-1442148 +Node: Auto-set442210 +Ref: Auto-set-Footnote-1456426 +Ref: Auto-set-Footnote-2456631 +Node: ARGC and ARGV456687 +Node: Pattern Action Summary460905 +Node: Arrays463332 +Node: Array Basics464661 +Node: Array Intro465505 +Ref: figure-array-elements467469 +Ref: Array Intro-Footnote-1469995 +Node: Reference to Elements470123 +Node: Assigning Elements472575 +Node: Array Example473066 +Node: Scanning an Array474824 +Node: Controlling Scanning477840 +Ref: Controlling Scanning-Footnote-1483036 +Node: Numeric Array Subscripts483352 +Node: Uninitialized Subscripts485537 +Node: Delete487154 +Ref: Delete-Footnote-1489897 +Node: Multidimensional489954 +Node: Multiscanning493051 +Node: Arrays of Arrays494640 +Node: Arrays Summary499399 +Node: Functions501491 +Node: Built-in502390 +Node: Calling Built-in503468 +Node: Numeric Functions505459 +Ref: Numeric Functions-Footnote-1510278 +Ref: Numeric Functions-Footnote-2510635 +Ref: Numeric Functions-Footnote-3510683 +Node: String Functions510955 +Ref: String Functions-Footnote-1534430 +Ref: String Functions-Footnote-2534559 +Ref: String Functions-Footnote-3534807 +Node: Gory Details534894 +Ref: table-sub-escapes536675 +Ref: table-sub-proposed538195 +Ref: table-posix-sub539559 +Ref: table-gensub-escapes541095 +Ref: Gory Details-Footnote-1541927 +Node: I/O Functions542078 +Ref: I/O Functions-Footnote-1549296 +Node: Time Functions549443 +Ref: Time Functions-Footnote-1559931 +Ref: Time Functions-Footnote-2559999 +Ref: Time Functions-Footnote-3560157 +Ref: Time Functions-Footnote-4560268 +Ref: Time Functions-Footnote-5560380 +Ref: Time Functions-Footnote-6560607 +Node: Bitwise Functions560873 +Ref: table-bitwise-ops561435 +Ref: Bitwise Functions-Footnote-1565744 +Node: Type Functions565913 +Node: I18N Functions567064 +Node: User-defined568709 +Node: Definition Syntax569514 +Ref: Definition Syntax-Footnote-1574921 +Node: Function Example574992 +Ref: Function Example-Footnote-1577911 +Node: Function Caveats577933 +Node: Calling A Function578451 +Node: Variable Scope579409 +Node: Pass By Value/Reference582397 +Node: Return Statement585892 +Node: Dynamic Typing588873 +Node: Indirect Calls589802 +Ref: Indirect Calls-Footnote-1601104 +Node: Functions Summary601232 +Node: Library Functions603934 +Ref: Library Functions-Footnote-1607543 +Ref: Library Functions-Footnote-2607686 +Node: Library Names607857 +Ref: Library Names-Footnote-1611311 +Ref: Library Names-Footnote-2611534 +Node: General Functions611620 +Node: Strtonum Function612723 +Node: Assert Function615745 +Node: Round Function619069 +Node: Cliff Random Function620610 +Node: Ordinal Functions621626 +Ref: Ordinal Functions-Footnote-1624689 +Ref: Ordinal Functions-Footnote-2624941 +Node: Join Function625152 +Ref: Join Function-Footnote-1626921 +Node: Getlocaltime Function627121 +Node: Readfile Function630865 +Node: Shell Quoting632835 +Node: Data File Management634236 +Node: Filetrans Function634868 +Node: Rewind Function638924 +Node: File Checking640311 +Ref: File Checking-Footnote-1641643 +Node: Empty Files641844 +Node: Ignoring Assigns643823 +Node: Getopt Function645374 +Ref: Getopt Function-Footnote-1656836 +Node: Passwd Functions657036 +Ref: Passwd Functions-Footnote-1665873 +Node: Group Functions665961 +Ref: Group Functions-Footnote-1673855 +Node: Walking Arrays674068 +Node: Library Functions Summary675671 +Node: Library Exercises677072 +Node: Sample Programs678352 +Node: Running Examples679122 +Node: Clones679850 +Node: Cut Program681074 +Node: Egrep Program690793 +Ref: Egrep Program-Footnote-1698291 +Node: Id Program698401 +Node: Split Program702046 +Ref: Split Program-Footnote-1705494 +Node: Tee Program705622 +Node: Uniq Program708411 +Node: Wc Program715830 +Ref: Wc Program-Footnote-1720080 +Node: Miscellaneous Programs720174 +Node: Dupword Program721387 +Node: Alarm Program723418 +Node: Translate Program728222 +Ref: Translate Program-Footnote-1732787 +Node: Labels Program733057 +Ref: Labels Program-Footnote-1736408 +Node: Word Sorting736492 +Node: History Sorting740563 +Node: Extract Program742399 +Node: Simple Sed749924 +Node: Igawk Program752992 +Ref: Igawk Program-Footnote-1767316 +Ref: Igawk Program-Footnote-2767517 +Ref: Igawk Program-Footnote-3767639 +Node: Anagram Program767754 +Node: Signature Program770811 +Node: Programs Summary772058 +Node: Programs Exercises773251 +Ref: Programs Exercises-Footnote-1777382 +Node: Advanced Features777473 +Node: Nondecimal Data779421 +Node: Array Sorting781011 +Node: Controlling Array Traversal781708 +Ref: Controlling Array Traversal-Footnote-1790041 +Node: Array Sorting Functions790159 +Ref: Array Sorting Functions-Footnote-1794048 +Node: Two-way I/O794244 +Ref: Two-way I/O-Footnote-1799189 +Ref: Two-way I/O-Footnote-2799375 +Node: TCP/IP Networking799457 +Node: Profiling802330 +Node: Advanced Features Summary810607 +Node: Internationalization812540 +Node: I18N and L10N814020 +Node: Explaining gettext814706 +Ref: Explaining gettext-Footnote-1819731 +Ref: Explaining gettext-Footnote-2819915 +Node: Programmer i18n820080 +Ref: Programmer i18n-Footnote-1824946 +Node: Translator i18n824995 +Node: String Extraction825789 +Ref: String Extraction-Footnote-1826920 +Node: Printf Ordering827006 +Ref: Printf Ordering-Footnote-1829792 +Node: I18N Portability829856 +Ref: I18N Portability-Footnote-1832311 +Node: I18N Example832374 +Ref: I18N Example-Footnote-1835177 +Node: Gawk I18N835249 +Node: I18N Summary835887 +Node: Debugger837226 +Node: Debugging838248 +Node: Debugging Concepts838689 +Node: Debugging Terms840542 +Node: Awk Debugging843114 +Node: Sample Debugging Session844008 +Node: Debugger Invocation844528 +Node: Finding The Bug845912 +Node: List of Debugger Commands852387 +Node: Breakpoint Control853720 +Node: Debugger Execution Control857416 +Node: Viewing And Changing Data860780 +Node: Execution Stack864158 +Node: Debugger Info865795 +Node: Miscellaneous Debugger Commands869812 +Node: Readline Support874841 +Node: Limitations875733 +Node: Debugging Summary877847 +Node: Arbitrary Precision Arithmetic879015 +Node: Computer Arithmetic880431 +Ref: table-numeric-ranges884029 +Ref: Computer Arithmetic-Footnote-1884888 +Node: Math Definitions884945 +Ref: table-ieee-formats888233 +Ref: Math Definitions-Footnote-1888837 +Node: MPFR features888942 +Node: FP Math Caution890613 +Ref: FP Math Caution-Footnote-1891663 +Node: Inexactness of computations892032 +Node: Inexact representation892991 +Node: Comparing FP Values894348 +Node: Errors accumulate895430 +Node: Getting Accuracy896863 +Node: Try To Round899525 +Node: Setting precision900424 +Ref: table-predefined-precision-strings901108 +Node: Setting the rounding mode902897 +Ref: table-gawk-rounding-modes903261 +Ref: Setting the rounding mode-Footnote-1906716 +Node: Arbitrary Precision Integers906895 +Ref: Arbitrary Precision Integers-Footnote-1911794 +Node: POSIX Floating Point Problems911943 +Ref: POSIX Floating Point Problems-Footnote-1915816 +Node: Floating point summary915854 +Node: Dynamic Extensions918048 +Node: Extension Intro919600 +Node: Plugin License920866 +Node: Extension Mechanism Outline921663 +Ref: figure-load-extension922091 +Ref: figure-register-new-function923571 +Ref: figure-call-new-function924575 +Node: Extension API Description926561 +Node: Extension API Functions Introduction928095 +Node: General Data Types932967 +Ref: General Data Types-Footnote-1938706 +Node: Memory Allocation Functions939005 +Ref: Memory Allocation Functions-Footnote-1941844 +Node: Constructor Functions941940 +Node: Registration Functions943674 +Node: Extension Functions944359 +Node: Exit Callback Functions946656 +Node: Extension Version String947904 +Node: Input Parsers948569 +Node: Output Wrappers958448 +Node: Two-way processors962963 +Node: Printing Messages965167 +Ref: Printing Messages-Footnote-1966243 +Node: Updating `ERRNO'966395 +Node: Requesting Values967135 +Ref: table-value-types-returned967863 +Node: Accessing Parameters968820 +Node: Symbol Table Access970051 +Node: Symbol table by name970565 +Node: Symbol table by cookie972546 +Ref: Symbol table by cookie-Footnote-1976690 +Node: Cached values976753 +Ref: Cached values-Footnote-1980252 +Node: Array Manipulation980343 +Ref: Array Manipulation-Footnote-1981433 +Node: Array Data Types981470 +Ref: Array Data Types-Footnote-1984125 +Node: Array Functions984217 +Node: Flattening Arrays988071 +Node: Creating Arrays994963 +Node: Redirection API999734 +Node: Extension API Variables1002505 +Node: Extension Versioning1003138 +Node: Extension API Informational Variables1005039 +Node: Extension API Boilerplate1006104 +Node: Finding Extensions1009913 +Node: Extension Example1010473 +Node: Internal File Description1011245 +Node: Internal File Ops1015312 +Ref: Internal File Ops-Footnote-11026982 +Node: Using Internal File Ops1027122 +Ref: Using Internal File Ops-Footnote-11029505 +Node: Extension Samples1029778 +Node: Extension Sample File Functions1031304 +Node: Extension Sample Fnmatch1038942 +Node: Extension Sample Fork1040433 +Node: Extension Sample Inplace1041648 +Node: Extension Sample Ord1043323 +Node: Extension Sample Readdir1044159 +Ref: table-readdir-file-types1045035 +Node: Extension Sample Revout1045846 +Node: Extension Sample Rev2way1046436 +Node: Extension Sample Read write array1047176 +Node: Extension Sample Readfile1049116 +Node: Extension Sample Time1050211 +Node: Extension Sample API Tests1051560 +Node: gawkextlib1052051 +Node: Extension summary1054709 +Node: Extension Exercises1058398 +Node: Language History1059120 +Node: V7/SVR3.11060776 +Node: SVR41062957 +Node: POSIX1064402 +Node: BTL1065791 +Node: POSIX/GNU1066525 +Node: Feature History1072149 +Node: Common Extensions1085247 +Node: Ranges and Locales1086571 +Ref: Ranges and Locales-Footnote-11091189 +Ref: Ranges and Locales-Footnote-21091216 +Ref: Ranges and Locales-Footnote-31091450 +Node: Contributors1091671 +Node: History summary1097212 +Node: Installation1098582 +Node: Gawk Distribution1099528 +Node: Getting1100012 +Node: Extracting1100835 +Node: Distribution contents1102470 +Node: Unix Installation1108535 +Node: Quick Installation1109218 +Node: Shell Startup Files1111629 +Node: Additional Configuration Options1112708 +Node: Configuration Philosophy1114447 +Node: Non-Unix Installation1116816 +Node: PC Installation1117274 +Node: PC Binary Installation1118593 +Node: PC Compiling1120441 +Ref: PC Compiling-Footnote-11123462 +Node: PC Testing1123571 +Node: PC Using1124747 +Node: Cygwin1128862 +Node: MSYS1129685 +Node: VMS Installation1130185 +Node: VMS Compilation1130977 +Ref: VMS Compilation-Footnote-11132199 +Node: VMS Dynamic Extensions1132257 +Node: VMS Installation Details1133941 +Node: VMS Running1136193 +Node: VMS GNV1139029 +Node: VMS Old Gawk1139763 +Node: Bugs1140233 +Node: Other Versions1144116 +Node: Installation summary1150544 +Node: Notes1151600 +Node: Compatibility Mode1152465 +Node: Additions1153247 +Node: Accessing The Source1154172 +Node: Adding Code1155608 +Node: New Ports1161773 +Node: Derived Files1166255 +Ref: Derived Files-Footnote-11171730 +Ref: Derived Files-Footnote-21171764 +Ref: Derived Files-Footnote-31172360 +Node: Future Extensions1172474 +Node: Implementation Limitations1173080 +Node: Extension Design1174328 +Node: Old Extension Problems1175482 +Ref: Old Extension Problems-Footnote-11176999 +Node: Extension New Mechanism Goals1177056 +Ref: Extension New Mechanism Goals-Footnote-11180416 +Node: Extension Other Design Decisions1180605 +Node: Extension Future Growth1182713 +Node: Old Extension Mechanism1183549 +Node: Notes summary1185311 +Node: Basic Concepts1186497 +Node: Basic High Level1187178 +Ref: figure-general-flow1187450 +Ref: figure-process-flow1188049 +Ref: Basic High Level-Footnote-11191278 +Node: Basic Data Typing1191463 +Node: Glossary1194791 +Node: Copying1219949 +Node: GNU Free Documentation License1257505 +Node: Index1282641 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 7c346a3a..cbc0bd04 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -207,7 +207,7 @@ @set FFN Filename @set DF datafile @set DDF Datafile -@set PVERSION Version +@set PVERSION version @end ifset @c For HTML, spell out email addresses, to avoid problems with @@ -304,7 +304,7 @@ All Rights Reserved.</literallayout> @end docbook @ifnotdocbook -Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2014 @* +Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2015 @* Free Software Foundation, Inc. @end ifnotdocbook @sp 2 @@ -1172,7 +1172,7 @@ interface to network protocols via special @file{/inet} files. The programs in this book make clear that an AWK program is typically much smaller and faster to develop than a counterpart written in C. -Consequently, there is often a payoff to prototype an +Consequently, there is often a payoff to prototyping an algorithm or design in AWK to get it running quickly and expose problems early. Often, the interpreted performance is adequate and the AWK prototype becomes the product. @@ -1249,15 +1249,15 @@ March 2001 Some things don't change. Thirteen years ago I wrote: ``If you use AWK or want to learn how, then read this book.'' -True then and still true today. +True then, and still true today. -Learning to use a programming language is more than mastering the +Learning to use a programming language is about more than mastering the syntax. One needs to acquire an understanding of how to use the features of the language to solve practical programming problems. A focus of this book is many examples that show how to use AWK. Some things do change. Our computers are much faster and have more memory. -Consequently, speed and storage inefficiencies of a high level language +Consequently, speed and storage inefficiencies of a high-level language matter less. Prototyping in AWK and then rewriting in C for performance reasons happens less, because more often the prototype is fast enough. @@ -1265,12 +1265,12 @@ Of course, there are computing operations that are best done in C or C++. With @command{gawk} 4.1 and later, you do not have to choose between writing your program in AWK or in C/C++. You can write most of your program in AWK and the aspects that require C/C++ capabilities can be written -in C/C++ and then the pieces glued together when the @command{gawk} module loads +in C/C++, and then the pieces glued together when the @command{gawk} module loads the C/C++ module as a dynamic plug-in. @c Chapter 16 @ref{Dynamic Extensions}, has all the -details, and as expected, many examples to help you learn the ins and outs. +details, and, as expected, many examples to help you learn the ins and outs. I enjoy programming in AWK and had fun (re)reading this book. I think you will too. @@ -1345,7 +1345,7 @@ Generate reports Validate data @item -Produce indexes and perform other document preparation tasks +Produce indexes and perform other document-preparation tasks @item Experiment with algorithms that you can adapt later to other computer @@ -1492,7 +1492,7 @@ help from me, thoroughly reworked @command{gawk} for compatibility with the newer @command{awk}. Circa 1994, I became the primary maintainer. Current development focuses on bug fixes, -performance improvements, standards compliance and, occasionally, new features. +performance improvements, standards compliance, and, occasionally, new features. In May 1997, J@"urgen Kahrs felt the need for network access from @command{awk}, and with a little help from me, set about adding @@ -1505,10 +1505,10 @@ with @command{gawk} @value{PVERSION} 3.1. John Haque rewrote the @command{gawk} internals, in the process providing an @command{awk}-level debugger. This version became available as -@command{gawk} @value{PVERSION} 4.0, in 2011. +@command{gawk} @value{PVERSION} 4.0 in 2011. @DBXREF{Contributors} -for a full list of those who made important contributions to @command{gawk}. +for a full list of those who have made important contributions to @command{gawk}. @node Names @unnumberedsec A Rose by Any Other Name @@ -1521,7 +1521,7 @@ is often referred to as ``new @command{awk}.'' By analogy, the original version of @command{awk} is referred to as ``old @command{awk}.'' -Today, on most systems, when you run the @command{awk} utility, +Today, on most systems, when you run the @command{awk} utility you get some version of new @command{awk}.@footnote{Only Solaris systems still use an old @command{awk} for the default @command{awk} utility. A more modern @command{awk} lives in @@ -1581,7 +1581,9 @@ the POSIX standard for @command{awk}. This @value{DOCUMENT} has the difficult task of being both a tutorial and a reference. If you are a novice, feel free to skip over details that seem too complex. You should also ignore the many cross-references; they are for the -expert user and for the online Info and HTML versions of the @value{DOCUMENT}. +expert user and for the Info and +@ulink{http://www.gnu.org/software/gawk/manual/, HTML} +versions of the @value{DOCUMENT}. @end ifnotinfo There are sidebars @@ -1614,7 +1616,7 @@ This @value{DOCUMENT} is split into several parts, as follows: @itemize @value{BULLET} @item -Part I describes the @command{awk} language and @command{gawk} program in detail. +Part I describes the @command{awk} language and the @command{gawk} program in detail. It starts with the basics, and continues through all of the features of @command{awk}. It contains the following chapters: @@ -1661,7 +1663,7 @@ doing something when a record is matched, and the predefined variables @item @ref{Arrays}, -covers @command{awk}'s one-and-only data structure: associative arrays. +covers @command{awk}'s one-and-only data structure: the associative array. Deleting array elements and whole arrays is also described, as well as sorting arrays in @command{gawk}. It also describes how @command{gawk} provides arrays of arrays. diff --git a/doc/gawkinet.info b/doc/gawkinet.info index 0a0d69d8..d726be0b 100644 --- a/doc/gawkinet.info +++ b/doc/gawkinet.info @@ -6,7 +6,7 @@ START-INFO-DIR-ENTRY * Gawkinet: (gawkinet). TCP/IP Internetworking With `gawk'. END-INFO-DIR-ENTRY - This is Edition 1.3 of `TCP/IP Internetworking With `gawk'', for the + This is Edition 1.3 of `TCP/IP Internetworking with `gawk'', for the 4.0.0 (or later) version of the GNU implementation of AWK. @@ -30,7 +30,7 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) This file documents the networking features in GNU `awk'. - This is Edition 1.3 of `TCP/IP Internetworking With `gawk'', for the + This is Edition 1.3 of `TCP/IP Internetworking with `gawk'', for the 4.0.0 (or later) version of the GNU implementation of AWK. @@ -61,7 +61,7 @@ General Introduction This file documents the networking features in GNU Awk (`gawk') version 4.0 and later. - This is Edition 1.3 of `TCP/IP Internetworking With `gawk'', for the + This is Edition 1.3 of `TCP/IP Internetworking with `gawk'', for the 4.0.0 (or later) version of the GNU implementation of AWK. diff --git a/doc/gawkinet.texi b/doc/gawkinet.texi index 40198e1d..10223239 100644 --- a/doc/gawkinet.texi +++ b/doc/gawkinet.texi @@ -60,7 +60,7 @@ @c fit into that chapter, thus this separate document. At over 50 @c pages, I think this is the right decision. ADR. -@set TITLE TCP/IP Internetworking With @command{gawk} +@set TITLE TCP/IP Internetworking with @command{gawk} @set EDITION 1.3 @set UPDATE-MONTH December, 2010 @c gawk versions: diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 385874a7..95ed8586 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -202,7 +202,7 @@ @set FFN Filename @set DF datafile @set DDF Datafile -@set PVERSION Version +@set PVERSION version @end ifset @c For HTML, spell out email addresses, to avoid problems with @@ -299,7 +299,7 @@ All Rights Reserved.</literallayout> @end docbook @ifnotdocbook -Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2014 @* +Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2015 @* Free Software Foundation, Inc. @end ifnotdocbook @sp 2 @@ -1167,7 +1167,7 @@ interface to network protocols via special @file{/inet} files. The programs in this book make clear that an AWK program is typically much smaller and faster to develop than a counterpart written in C. -Consequently, there is often a payoff to prototype an +Consequently, there is often a payoff to prototyping an algorithm or design in AWK to get it running quickly and expose problems early. Often, the interpreted performance is adequate and the AWK prototype becomes the product. @@ -1244,15 +1244,15 @@ March 2001 Some things don't change. Thirteen years ago I wrote: ``If you use AWK or want to learn how, then read this book.'' -True then and still true today. +True then, and still true today. -Learning to use a programming language is more than mastering the +Learning to use a programming language is about more than mastering the syntax. One needs to acquire an understanding of how to use the features of the language to solve practical programming problems. A focus of this book is many examples that show how to use AWK. Some things do change. Our computers are much faster and have more memory. -Consequently, speed and storage inefficiencies of a high level language +Consequently, speed and storage inefficiencies of a high-level language matter less. Prototyping in AWK and then rewriting in C for performance reasons happens less, because more often the prototype is fast enough. @@ -1260,12 +1260,12 @@ Of course, there are computing operations that are best done in C or C++. With @command{gawk} 4.1 and later, you do not have to choose between writing your program in AWK or in C/C++. You can write most of your program in AWK and the aspects that require C/C++ capabilities can be written -in C/C++ and then the pieces glued together when the @command{gawk} module loads +in C/C++, and then the pieces glued together when the @command{gawk} module loads the C/C++ module as a dynamic plug-in. @c Chapter 16 @ref{Dynamic Extensions}, has all the -details, and as expected, many examples to help you learn the ins and outs. +details, and, as expected, many examples to help you learn the ins and outs. I enjoy programming in AWK and had fun (re)reading this book. I think you will too. @@ -1340,7 +1340,7 @@ Generate reports Validate data @item -Produce indexes and perform other document preparation tasks +Produce indexes and perform other document-preparation tasks @item Experiment with algorithms that you can adapt later to other computer @@ -1459,7 +1459,7 @@ help from me, thoroughly reworked @command{gawk} for compatibility with the newer @command{awk}. Circa 1994, I became the primary maintainer. Current development focuses on bug fixes, -performance improvements, standards compliance and, occasionally, new features. +performance improvements, standards compliance, and, occasionally, new features. In May 1997, J@"urgen Kahrs felt the need for network access from @command{awk}, and with a little help from me, set about adding @@ -1472,10 +1472,10 @@ with @command{gawk} @value{PVERSION} 3.1. John Haque rewrote the @command{gawk} internals, in the process providing an @command{awk}-level debugger. This version became available as -@command{gawk} @value{PVERSION} 4.0, in 2011. +@command{gawk} @value{PVERSION} 4.0 in 2011. @DBXREF{Contributors} -for a full list of those who made important contributions to @command{gawk}. +for a full list of those who have made important contributions to @command{gawk}. @node Names @unnumberedsec A Rose by Any Other Name @@ -1488,7 +1488,7 @@ is often referred to as ``new @command{awk}.'' By analogy, the original version of @command{awk} is referred to as ``old @command{awk}.'' -Today, on most systems, when you run the @command{awk} utility, +Today, on most systems, when you run the @command{awk} utility you get some version of new @command{awk}.@footnote{Only Solaris systems still use an old @command{awk} for the default @command{awk} utility. A more modern @command{awk} lives in @@ -1548,7 +1548,9 @@ the POSIX standard for @command{awk}. This @value{DOCUMENT} has the difficult task of being both a tutorial and a reference. If you are a novice, feel free to skip over details that seem too complex. You should also ignore the many cross-references; they are for the -expert user and for the online Info and HTML versions of the @value{DOCUMENT}. +expert user and for the Info and +@ulink{http://www.gnu.org/software/gawk/manual/, HTML} +versions of the @value{DOCUMENT}. @end ifnotinfo There are sidebars @@ -1581,7 +1583,7 @@ This @value{DOCUMENT} is split into several parts, as follows: @itemize @value{BULLET} @item -Part I describes the @command{awk} language and @command{gawk} program in detail. +Part I describes the @command{awk} language and the @command{gawk} program in detail. It starts with the basics, and continues through all of the features of @command{awk}. It contains the following chapters: @@ -1628,7 +1630,7 @@ doing something when a record is matched, and the predefined variables @item @ref{Arrays}, -covers @command{awk}'s one-and-only data structure: associative arrays. +covers @command{awk}'s one-and-only data structure: the associative array. Deleting array elements and whole arrays is also described, as well as sorting arrays in @command{gawk}. It also describes how @command{gawk} provides arrays of arrays. diff --git a/extension/ChangeLog b/extension/ChangeLog index c8f77042..8a6dfd93 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,7 @@ +2015-01-07 Arnold D. Robbins <arnold@skeeve.com> + + * testext.c (var_test): Adjust for PROCINFO now being there. + 2015-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com> * testext.c (test_deferred): New function to help with testing diff --git a/extension/testext.c b/extension/testext.c index 7c61bb0d..8a906c67 100644 --- a/extension/testext.c +++ b/extension/testext.c @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 2012, 2013, 2014 + * Copyright (C) 2012, 2013, 2014, 2015 * the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the @@ -303,11 +303,11 @@ var_test(int nargs, awk_value_t *result) goto out; } - /* look up PROCINFO - should fail */ + /* look up PROCINFO - should succeed fail */ if (sym_lookup("PROCINFO", AWK_ARRAY, & value)) - printf("var_test: sym_lookup of PROCINFO failed - got a value!\n"); + printf("var_test: sym_lookup of PROCINFO passed - got a value!\n"); else - printf("var_test: sym_lookup of PROCINFO passed - did not get a value\n"); + printf("var_test: sym_lookup of PROCINFO failed - did not get a value\n"); /* look up a reserved variable - should pass */ if (sym_lookup("ARGC", AWK_NUMBER, & value)) @@ -399,8 +399,11 @@ test_deferred(int nargs, awk_value_t *result) printf("test_deferred: nargs not right (%d should be 0)\n", nargs); goto out; } - arr.val_type = AWK_ARRAY; - arr.array_cookie = create_array(); + + if (! sym_lookup("PROCINFO", AWK_ARRAY, & arr)) { + printf("test_deferred: %d: sym_lookup failed\n", __LINE__); + goto out; + } for (i = 0; i < sizeof(seed)/sizeof(seed[0]); i++) { make_const_string(seed[i].name, strlen(seed[i].name), & index); @@ -411,11 +414,6 @@ test_deferred(int nargs, awk_value_t *result) } } - if (! sym_update("PROCINFO", & arr)) { - printf("test_deferred: %d: sym_update failed\n", __LINE__); - goto out; - } - /* test that it still contains the values we loaded */ for (i = 0; i < sizeof(seed)/sizeof(seed[0]); i++) { make_const_string(seed[i].name, strlen(seed[i].name), & index); @@ -2,7 +2,7 @@ NOTE: getopt is part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! - Copyright (C) 1987-2014 Free Software Foundation, Inc. + Copyright (C) 1987-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -613,7 +613,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring, fputc_unlocked ('\n', fp); - if (__builtin_expect (fclose (fp) != EOF, 1)) + if (__glibc_likely (fclose (fp) != EOF)) { _IO_flockfile (stderr); @@ -1,5 +1,5 @@ /* Declarations for getopt. - Copyright (C) 1989-2014 Free Software Foundation, Inc. + Copyright (C) 1989-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -1,5 +1,5 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987-2014 Free Software Foundation, Inc. + Copyright (C) 1987-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/getopt_int.h b/getopt_int.h index d255c8ee..03d62277 100644 --- a/getopt_int.h +++ b/getopt_int.h @@ -1,5 +1,5 @@ /* Internal declarations for getopt. - Copyright (C) 1989-2014 Free Software Foundation, Inc. + Copyright (C) 1989-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -794,10 +794,10 @@ init_vars() (*(vp->assign))(); } - /* Set up deferred variables (loaded only when accessed). */ + /* Load PROCINFO and ENVIRON */ if (! do_traditional) - register_deferred_variable("PROCINFO", load_procinfo); - register_deferred_variable("ENVIRON", load_environ); + load_procinfo(); + load_environ(); } /* path_environ --- put path variable into environment if not already there */ diff --git a/test/ChangeLog b/test/ChangeLog index 7522f7aa..c859a7bb 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,33 @@ +2015-01-19 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (profile8): Actually add the test and the files. + Thanks to Hermann Peifer for the report. + +2015-01-16 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (profile8): New test. + * profile8.awk, profile8.ok: New files. + +2015-01-14 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (dumpvars): Grep out ENVIRON and PROCINFO since + those can be different depending on who runs the test. + * dumpvars.ok, id.ok: Updated after code changes. + +2015-01-07 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (regexpbrack): New test. + * regexpbrack.awk, regexpbrack.in, regexpbrack.ok: New files. + + Unrelated: + + * Makefile.am (printfbad4): New test. + * printfbad4.awk, printfbad4.ok: New files. + + Unrelated: + + * testext.ok: Adjust for code changes. + 2015-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com> * Makefile.am (EXTRA_DIST): Add defvar.awk and defvar.ok. diff --git a/test/Makefile.am b/test/Makefile.am index 3d95f4cc..438efd93 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,7 +1,7 @@ # # test/Makefile.am --- automake input file for gawk # -# Copyright (C) 1988-2014 the Free Software Foundation, Inc. +# Copyright (C) 1988-2015 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -699,6 +699,8 @@ EXTRA_DIST = \ printfbad2.ok \ printfbad3.awk \ printfbad3.ok \ + printfbad4.awk \ + printfbad4.ok \ printfloat.awk \ printhuge.awk \ printhuge.ok \ @@ -720,6 +722,8 @@ EXTRA_DIST = \ profile6.ok \ profile7.awk \ profile7.ok \ + profile8.awk \ + profile8.ok \ prt1eval.awk \ prt1eval.ok \ prtoeval.awk \ @@ -751,6 +755,9 @@ EXTRA_DIST = \ regeq.awk \ regeq.in \ regeq.ok \ + regexpbrack.awk \ + regexpbrack.in \ + regexpbrack.ok \ regexprange.awk \ regexprange.ok \ reginttrad.awk \ @@ -1010,7 +1017,7 @@ BASIC_TESTS = \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ prt1eval prtoeval \ - rand randtest range1 rebt8b1 redfilnm regeq regexprange regrange reindops \ + rand randtest range1 rebt8b1 redfilnm regeq regexpbrack regexprange regrange reindops \ reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \ @@ -1037,8 +1044,9 @@ GAWK_EXT_TESTS = \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ - patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ + patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ + profile1 profile2 profile3 profile4 profile5 profile6 profile7 \ + profile8 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ @@ -1691,7 +1699,7 @@ beginfile2: dumpvars:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --dump-variables 1 < "$(srcdir)"/$@.in >/dev/null 2>&1 || echo EXIT CODE: $$? >>_$@ - @mv awkvars.out _$@ + @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ profile1: @@ -1737,6 +1745,11 @@ profile7: @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile8: + @echo $@ + @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + posix2008sub: @echo $@ @$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1 diff --git a/test/Makefile.in b/test/Makefile.in index d2492d32..e6abf971 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -17,7 +17,7 @@ # # test/Makefile.am --- automake input file for gawk # -# Copyright (C) 1988-2014 the Free Software Foundation, Inc. +# Copyright (C) 1988-2015 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -946,6 +946,8 @@ EXTRA_DIST = \ printfbad2.ok \ printfbad3.awk \ printfbad3.ok \ + printfbad4.awk \ + printfbad4.ok \ printfloat.awk \ printhuge.awk \ printhuge.ok \ @@ -967,6 +969,8 @@ EXTRA_DIST = \ profile6.ok \ profile7.awk \ profile7.ok \ + profile8.awk \ + profile8.ok \ prt1eval.awk \ prt1eval.ok \ prtoeval.awk \ @@ -998,6 +1002,9 @@ EXTRA_DIST = \ regeq.awk \ regeq.in \ regeq.ok \ + regexpbrack.awk \ + regexpbrack.in \ + regexpbrack.ok \ regexprange.awk \ regexprange.ok \ reginttrad.awk \ @@ -1256,7 +1263,7 @@ BASIC_TESTS = \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ prt1eval prtoeval \ - rand randtest range1 rebt8b1 redfilnm regeq regexprange regrange reindops \ + rand randtest range1 rebt8b1 redfilnm regeq regexpbrack regexprange regrange reindops \ reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \ @@ -1283,8 +1290,9 @@ GAWK_EXT_TESTS = \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ - patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ + patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ + profile1 profile2 profile3 profile4 profile5 profile6 profile7 \ + profile8 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ @@ -2117,7 +2125,7 @@ beginfile2: dumpvars:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --dump-variables 1 < "$(srcdir)"/$@.in >/dev/null 2>&1 || echo EXIT CODE: $$? >>_$@ - @mv awkvars.out _$@ + @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ profile1: @@ -2162,6 +2170,11 @@ profile7: @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile8: + @echo $@ + @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + posix2008sub: @echo $@ @$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1 @@ -3153,6 +3166,11 @@ regeq: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +regexpbrack: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + regexprange: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3613,6 +3631,11 @@ printfbad3: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +printfbad4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + procinfs: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 97f2ed52..be10addd 100644 --- a/test/Maketests +++ b/test/Maketests @@ -697,6 +697,11 @@ regeq: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +regexpbrack: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + regexprange: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1157,6 +1162,11 @@ printfbad3: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +printfbad4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + procinfs: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -71,3 +71,4 @@ lshift -> builtin SYMTAB -> array strtonum -> builtin toupper -> builtin +ENVIRON -> array diff --git a/test/printfbad4.awk b/test/printfbad4.awk new file mode 100644 index 00000000..dd9220ae --- /dev/null +++ b/test/printfbad4.awk @@ -0,0 +1,5 @@ +BEGIN { + for (i = 1; i <= 10; i++) { + printf "%03$*d %2$d \n", 4, 5, i + } +} diff --git a/test/printfbad4.ok b/test/printfbad4.ok new file mode 100644 index 00000000..71eed3d6 --- /dev/null +++ b/test/printfbad4.ok @@ -0,0 +1,2 @@ +gawk: printfbad4.awk:3: fatal: fatal: must use `count$' on all formats or none +EXIT CODE: 2 diff --git a/test/profile8.awk b/test/profile8.awk new file mode 100644 index 00000000..16252cea --- /dev/null +++ b/test/profile8.awk @@ -0,0 +1,9 @@ +# Some +# header +# comments + +# Add up +{ sum += $1 } + +# Print sum +END { print sum } diff --git a/test/profile8.ok b/test/profile8.ok new file mode 100644 index 00000000..34f7a96b --- /dev/null +++ b/test/profile8.ok @@ -0,0 +1,14 @@ +# Some +# header +# comments + +# Add up +{ + sum += $1 +} + +# Print sum +END { + print sum +} + diff --git a/test/regexpbrack.awk b/test/regexpbrack.awk new file mode 100644 index 00000000..136cd194 --- /dev/null +++ b/test/regexpbrack.awk @@ -0,0 +1,2 @@ +/[]+()0-9.,$%/'"-]*$/ +/^[]+()0-9.,$%/'"-]*$/ diff --git a/test/regexpbrack.in b/test/regexpbrack.in new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/regexpbrack.in diff --git a/test/regexpbrack.ok b/test/regexpbrack.ok new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/regexpbrack.ok diff --git a/test/testext.ok b/test/testext.ok index 5a78c159..9dae010f 100644 --- a/test/testext.ok +++ b/test/testext.ok @@ -15,7 +15,7 @@ try_modify_environ: set_array_element of ENVIRON failed try_modify_environ: marking element "testext" for deletion try_del_environ() could not delete element - pass try_del_environ() could not add an element - pass -var_test: sym_lookup of PROCINFO passed - did not get a value +var_test: sym_lookup of PROCINFO passed - got a value! var_test: sym_lookup of ARGC passed - got a value! var_test: sym_update of ARGC failed - correctly var_test: sym_update("testvar") succeeded |