diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2021-09-10 14:04:04 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2021-09-10 14:04:04 +0300 |
commit | dab291a6bd1b7a202758747da70fa125ffeb75ed (patch) | |
tree | 24e64720d4ae3cf0dcfa138fa62712549fb788d7 | |
parent | 3f87dfdb1fa3a54d4ca453a2cf00ec9ad42fc178 (diff) | |
download | egawk-dab291a6bd1b7a202758747da70fa125ffeb75ed.tar.gz egawk-dab291a6bd1b7a202758747da70fa125ffeb75ed.tar.bz2 egawk-dab291a6bd1b7a202758747da70fa125ffeb75ed.zip |
Update to Bison 3.8.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | awkgram.c | 991 | ||||
-rw-r--r-- | awkgram.y | 1 | ||||
-rw-r--r-- | command.c | 477 | ||||
-rw-r--r-- | command.y | 1 |
6 files changed, 751 insertions, 727 deletions
@@ -9,6 +9,12 @@ * aclocal.m4: Regenerated: Automake 1.16.4. * NEWS: Updated. + Unrelated: + + * awkgram.y (YYERROR_IS_DECLARED): Added for Bison 3.8. + * command.y (YYERROR_IS_DECLARED): Ditto. + * NEWS: Updated. + 2021-09-09 Arnold D. Robbins <arnold@skeeve.com> Move to Autoconf 2.71 (finally!) @@ -7,7 +7,7 @@ Changes from 5.1.0 to 5.1.1 --------------------------- -1. Infrastructure upgrades: Bison 3.7.1, Gettext 0.20.2, Automake 1.16.4, +1. Infrastructure upgrades: Bison 3.8, Gettext 0.20.2, Automake 1.16.4, and (will wonders never cease) Autoconf 2.71. 2. asort and asorti now allow FUNCTAB and SYMTAB as the first argument if a @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.7.1. */ +/* A Bison parser, made by GNU Bison 3.8. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -45,11 +45,11 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Identify Bison output. */ -#define YYBISON 1 +/* Identify Bison output, and Bison version. */ +#define YYBISON 30800 -/* Bison version. */ -#define YYBISON_VERSION "3.7.1" +/* Bison version string. */ +#define YYBISON_VERSION "3.8" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -80,6 +80,7 @@ #endif static void yyerror(const char *m, ...) ATTRIBUTE_PRINTF_1; +#define YYERROR_IS_DECLARED 1 /* for bison 3.8. sigh. */ static void error_ln(int line, const char *m, ...) ATTRIBUTE_PRINTF_2; static void lintwarn_ln(int line, const char *m, ...) ATTRIBUTE_PRINTF_2; static void warning_ln(int line, const char *m, ...) ATTRIBUTE_PRINTF_2; @@ -232,7 +233,7 @@ extern double fmod(double x, double y); #define YYSTYPE INSTRUCTION * -#line 236 "awkgram.c" +#line 237 "awkgram.c" # ifndef YY_CAST # ifdef __cplusplus @@ -330,6 +331,7 @@ extern int yydebug; typedef enum yytokentype yytoken_kind_t; #endif /* Token kinds. */ +#define YYEMPTY -2 #define YYEOF 0 #define YYerror 256 #define YYUNDEF 257 @@ -397,9 +399,17 @@ typedef int YYSTYPE; extern YYSTYPE yylval; +#if !defined yyerror && !defined YYERROR_IS_DECLARED +void yyerror (const char *msg); +#endif +#if !defined yylex && !defined YYLEX_IS_DECLARED +int yylex (void); +#endif + int yyparse (void); + /* Symbol kind. */ enum yysymbol_kind_t { @@ -596,6 +606,18 @@ typedef int_least16_t yytype_int16; typedef short yytype_int16; #endif +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ @@ -693,17 +715,23 @@ typedef int yy_state_fast_t; /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -923,30 +951,30 @@ static const yytype_int8 yytranslate[] = }; #if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 232, 232, 233, 238, 248, 252, 264, 272, 286, - 297, 307, 317, 330, 340, 342, 347, 357, 359, 364, - 366, 368, 374, 378, 383, 413, 425, 437, 443, 452, - 470, 471, 482, 488, 496, 497, 501, 501, 535, 534, - 568, 583, 585, 590, 591, 611, 616, 617, 621, 632, - 637, 644, 752, 803, 853, 979, 1001, 1022, 1032, 1042, - 1052, 1063, 1076, 1094, 1093, 1110, 1128, 1128, 1230, 1230, - 1263, 1293, 1301, 1302, 1308, 1309, 1316, 1321, 1334, 1349, - 1351, 1359, 1366, 1368, 1376, 1385, 1387, 1396, 1397, 1405, - 1410, 1410, 1423, 1430, 1443, 1447, 1469, 1470, 1476, 1477, - 1486, 1487, 1492, 1497, 1514, 1516, 1518, 1525, 1526, 1532, - 1533, 1538, 1540, 1547, 1549, 1557, 1562, 1573, 1574, 1579, - 1581, 1588, 1590, 1598, 1603, 1613, 1614, 1619, 1620, 1625, - 1632, 1636, 1638, 1640, 1653, 1670, 1680, 1687, 1689, 1694, - 1696, 1698, 1706, 1708, 1713, 1715, 1720, 1722, 1724, 1781, - 1783, 1785, 1787, 1789, 1791, 1793, 1795, 1809, 1814, 1819, - 1845, 1851, 1853, 1855, 1857, 1859, 1861, 1866, 1870, 1902, - 1910, 1916, 1922, 1935, 1936, 1937, 1942, 1947, 1951, 1955, - 1970, 1991, 1996, 2033, 2070, 2071, 2077, 2078, 2083, 2085, - 2092, 2109, 2126, 2128, 2135, 2140, 2146, 2157, 2169, 2178, - 2182, 2187, 2191, 2195, 2199, 2204, 2205, 2209, 2213, 2217 + 0, 233, 233, 234, 239, 249, 253, 265, 273, 287, + 298, 308, 318, 331, 341, 343, 348, 358, 360, 365, + 367, 369, 375, 379, 384, 414, 426, 438, 444, 453, + 471, 472, 483, 489, 497, 498, 502, 502, 536, 535, + 569, 584, 586, 591, 592, 612, 617, 618, 622, 633, + 638, 645, 753, 804, 854, 980, 1002, 1023, 1033, 1043, + 1053, 1064, 1077, 1095, 1094, 1111, 1129, 1129, 1231, 1231, + 1264, 1294, 1302, 1303, 1309, 1310, 1317, 1322, 1335, 1350, + 1352, 1360, 1367, 1369, 1377, 1386, 1388, 1397, 1398, 1406, + 1411, 1411, 1424, 1431, 1444, 1448, 1470, 1471, 1477, 1478, + 1487, 1488, 1493, 1498, 1515, 1517, 1519, 1526, 1527, 1533, + 1534, 1539, 1541, 1548, 1550, 1558, 1563, 1574, 1575, 1580, + 1582, 1589, 1591, 1599, 1604, 1614, 1615, 1620, 1621, 1626, + 1633, 1637, 1639, 1641, 1654, 1671, 1681, 1688, 1690, 1695, + 1697, 1699, 1707, 1709, 1714, 1716, 1721, 1723, 1725, 1782, + 1784, 1786, 1788, 1790, 1792, 1794, 1796, 1810, 1815, 1820, + 1846, 1852, 1854, 1856, 1858, 1860, 1862, 1867, 1871, 1903, + 1911, 1917, 1923, 1936, 1937, 1938, 1943, 1948, 1952, 1956, + 1971, 1992, 1997, 2034, 2071, 2072, 2078, 2079, 2084, 2086, + 2093, 2110, 2127, 2129, 2136, 2141, 2147, 2158, 2170, 2179, + 2183, 2188, 2192, 2196, 2200, 2205, 2206, 2210, 2214, 2218 }; #endif @@ -999,22 +1027,6 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_int16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 63, 58, 44, 60, 62, - 43, 45, 42, 47, 37, 33, 310, 94, 36, 40, - 41, 64, 91, 93, 123, 125, 59 -}; -#endif - #define YYPACT_NINF (-276) #define yypact_value_is_default(Yyn) \ @@ -1025,8 +1037,8 @@ static const yytype_int16 yytoknum[] = #define yytable_value_is_error(Yyn) \ ((Yyn) == YYTABLE_NINF) - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { -276, 315, -276, -276, -45, -41, -276, -276, -276, -276, @@ -1067,9 +1079,9 @@ static const yytype_int16 yypact[] = -276, 389, 659, -276, 465, -276 }; - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_uint8 yydefact[] = { 2, 0, 1, 6, 0, 195, 177, 178, 25, 26, @@ -1110,7 +1122,7 @@ static const yytype_uint8 yydefact[] = 43, 0, 0, 56, 0, 55 }; - /* YYPGOTO[NTERM-NUM]. */ +/* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -276, -276, -276, -276, -276, -276, -276, 253, -276, -276, @@ -1123,10 +1135,10 @@ static const yytype_int16 yypgoto[] = -30, -29 }; - /* YYDEFGOTO[NTERM-NUM]. */ +/* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 1, 28, 146, 149, 152, 29, 78, 53, 54, + 0, 1, 28, 146, 149, 152, 29, 78, 53, 54, 30, 187, 31, 84, 120, 32, 155, 79, 217, 218, 237, 219, 252, 264, 271, 316, 325, 338, 220, 274, 296, 306, 221, 153, 154, 132, 233, 234, 247, 275, @@ -1136,9 +1148,9 @@ static const yytype_int16 yydefgoto[] = 340, 142 }; - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 34, 125, 81, 81, 141, 97, 270, 160, 128, 195, @@ -1389,8 +1401,8 @@ static const yytype_int16 yycheck[] = 59 }; - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 78, 0, 1, 3, 4, 7, 8, 18, 19, @@ -1431,7 +1443,7 @@ static const yytype_uint8 yystos[] = 111, 93, 111, 95, 93, 95 }; - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_uint8 yyr1[] = { 0, 77, 78, 78, 78, 78, 78, 79, 79, 79, @@ -1457,7 +1469,7 @@ static const yytype_uint8 yyr1[] = 141, 141, 142, 143, 144, 145, 145, 146, 147, 148 }; - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, @@ -1492,6 +1504,7 @@ enum { YYENOMEM = -2 }; #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) @@ -1532,10 +1545,7 @@ do { \ YYFPRINTF Args; \ } while (0) -/* This macro is provided for backward compatibility. */ -# ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif + # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ @@ -1559,15 +1569,11 @@ yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; - YYUSE (yyoutput); + YY_USE (yyoutput); if (!yyvaluep) return; -# ifdef YYPRINT - if (yykind < YYNTOKENS) - YYPRINT (yyo, yytoknum[yykind], *yyvaluep); -# endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yykind); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1681,13 +1687,13 @@ static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep) { - YYUSE (yyvaluep); + YY_USE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yykind); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1750,6 +1756,7 @@ yyparse (void) YYDPRINTF ((stderr, "Starting parse\n")); yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; @@ -1775,7 +1782,7 @@ yysetstate: if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; + YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ @@ -1803,7 +1810,7 @@ yysetstate: # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; @@ -1814,7 +1821,7 @@ yysetstate: YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) - goto yyexhaustedlab; + YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE @@ -1836,6 +1843,7 @@ yysetstate: } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + if (yystate == YYFINAL) YYACCEPT; @@ -1948,22 +1956,22 @@ yyreduce: switch (yyn) { case 2: /* program: %empty */ -#line 232 "awkgram.y" +#line 233 "awkgram.y" { yyval = NULL; } -#line 1954 "awkgram.c" +#line 1962 "awkgram.c" break; case 3: /* program: program rule */ -#line 234 "awkgram.y" +#line 235 "awkgram.y" { rule = 0; yyerrok; } -#line 1963 "awkgram.c" +#line 1971 "awkgram.c" break; case 4: /* program: program nls */ -#line 239 "awkgram.y" +#line 240 "awkgram.y" { if (yyvsp[0] != NULL) { if (yyvsp[-1] == NULL) @@ -1973,19 +1981,19 @@ yyreduce: } yyval = yyvsp[-1]; } -#line 1977 "awkgram.c" +#line 1985 "awkgram.c" break; case 5: /* program: program LEX_EOF */ -#line 249 "awkgram.y" +#line 250 "awkgram.y" { next_sourcefile(); } -#line 1985 "awkgram.c" +#line 1993 "awkgram.c" break; case 6: /* program: program error */ -#line 253 "awkgram.y" +#line 254 "awkgram.y" { rule = 0; /* @@ -1994,11 +2002,11 @@ yyreduce: */ /* yyerrok; */ } -#line 1998 "awkgram.c" +#line 2006 "awkgram.c" break; case 7: /* rule: pattern action */ -#line 265 "awkgram.y" +#line 266 "awkgram.y" { (void) append_rule(yyvsp[-1], yyvsp[0]); if (pending_comment != NULL) { @@ -2006,11 +2014,11 @@ yyreduce: pending_comment = NULL; } } -#line 2010 "awkgram.c" +#line 2018 "awkgram.c" break; case 8: /* rule: pattern statement_term */ -#line 273 "awkgram.y" +#line 274 "awkgram.y" { if (rule != Rule) { msg(_("%s blocks must have an action part"), ruletab[rule]); @@ -2024,11 +2032,11 @@ yyreduce: (void) append_rule(yyvsp[-1], NULL); } } -#line 2028 "awkgram.c" +#line 2036 "awkgram.c" break; case 9: /* rule: function_prologue action */ -#line 287 "awkgram.y" +#line 288 "awkgram.y" { in_function = false; (void) mk_function(yyvsp[-1], yyvsp[0]); @@ -2039,11 +2047,11 @@ yyreduce: } yyerrok; } -#line 2043 "awkgram.c" +#line 2051 "awkgram.c" break; case 10: /* rule: '@' LEX_INCLUDE source statement_term */ -#line 298 "awkgram.y" +#line 299 "awkgram.y" { want_source = false; at_seen = false; @@ -2053,11 +2061,11 @@ yyreduce: } yyerrok; } -#line 2057 "awkgram.c" +#line 2065 "awkgram.c" break; case 11: /* rule: '@' LEX_LOAD library statement_term */ -#line 308 "awkgram.y" +#line 309 "awkgram.y" { want_source = false; at_seen = false; @@ -2067,11 +2075,11 @@ yyreduce: } yyerrok; } -#line 2071 "awkgram.c" +#line 2079 "awkgram.c" break; case 12: /* rule: '@' LEX_NAMESPACE namespace statement_term */ -#line 318 "awkgram.y" +#line 319 "awkgram.y" { want_source = false; at_seen = false; @@ -2081,11 +2089,11 @@ yyreduce: yyerrok; } -#line 2085 "awkgram.c" +#line 2093 "awkgram.c" break; case 13: /* source: FILENAME */ -#line 331 "awkgram.y" +#line 332 "awkgram.y" { void *srcfile = NULL; @@ -2095,23 +2103,23 @@ yyreduce: bcfree(yyvsp[0]); yyval = (INSTRUCTION *) srcfile; } -#line 2099 "awkgram.c" +#line 2107 "awkgram.c" break; case 14: /* source: FILENAME error */ -#line 341 "awkgram.y" +#line 342 "awkgram.y" { yyval = NULL; } -#line 2105 "awkgram.c" +#line 2113 "awkgram.c" break; case 15: /* source: error */ -#line 343 "awkgram.y" +#line 344 "awkgram.y" { yyval = NULL; } -#line 2111 "awkgram.c" +#line 2119 "awkgram.c" break; case 16: /* library: FILENAME */ -#line 348 "awkgram.y" +#line 349 "awkgram.y" { void *srcfile; @@ -2121,58 +2129,58 @@ yyreduce: bcfree(yyvsp[0]); yyval = (INSTRUCTION *) srcfile; } -#line 2125 "awkgram.c" +#line 2133 "awkgram.c" break; case 17: /* library: FILENAME error */ -#line 358 "awkgram.y" +#line 359 "awkgram.y" { yyval = NULL; } -#line 2131 "awkgram.c" +#line 2139 "awkgram.c" break; case 18: /* library: error */ -#line 360 "awkgram.y" +#line 361 "awkgram.y" { yyval = NULL; } -#line 2137 "awkgram.c" +#line 2145 "awkgram.c" break; case 19: /* namespace: FILENAME */ -#line 365 "awkgram.y" +#line 366 "awkgram.y" { yyval = yyvsp[0]; } -#line 2143 "awkgram.c" +#line 2151 "awkgram.c" break; case 20: /* namespace: FILENAME error */ -#line 367 "awkgram.y" +#line 368 "awkgram.y" { yyval = NULL; } -#line 2149 "awkgram.c" +#line 2157 "awkgram.c" break; case 21: /* namespace: error */ -#line 369 "awkgram.y" +#line 370 "awkgram.y" { yyval = NULL; } -#line 2155 "awkgram.c" +#line 2163 "awkgram.c" break; case 22: /* pattern: %empty */ -#line 374 "awkgram.y" +#line 375 "awkgram.y" { rule = Rule; yyval = NULL; } -#line 2164 "awkgram.c" +#line 2172 "awkgram.c" break; case 23: /* pattern: exp */ -#line 379 "awkgram.y" +#line 380 "awkgram.y" { rule = Rule; } -#line 2172 "awkgram.c" +#line 2180 "awkgram.c" break; case 24: /* pattern: exp comma exp */ -#line 384 "awkgram.y" +#line 385 "awkgram.y" { INSTRUCTION *tp; @@ -2202,11 +2210,11 @@ yyreduce: yyval = list_append(list_merge(yyvsp[-2], yyvsp[0]), tp); rule = Rule; } -#line 2206 "awkgram.c" +#line 2214 "awkgram.c" break; case 25: /* pattern: LEX_BEGIN */ -#line 414 "awkgram.y" +#line 415 "awkgram.y" { static int begin_seen = 0; @@ -2218,11 +2226,11 @@ yyreduce: yyvsp[0]->source_file = source; yyval = yyvsp[0]; } -#line 2222 "awkgram.c" +#line 2230 "awkgram.c" break; case 26: /* pattern: LEX_END */ -#line 426 "awkgram.y" +#line 427 "awkgram.y" { static int end_seen = 0; @@ -2234,31 +2242,31 @@ yyreduce: yyvsp[0]->source_file = source; yyval = yyvsp[0]; } -#line 2238 "awkgram.c" +#line 2246 "awkgram.c" break; case 27: /* pattern: LEX_BEGINFILE */ -#line 438 "awkgram.y" +#line 439 "awkgram.y" { yyvsp[0]->in_rule = rule = BEGINFILE; yyvsp[0]->source_file = source; yyval = yyvsp[0]; } -#line 2248 "awkgram.c" +#line 2256 "awkgram.c" break; case 28: /* pattern: LEX_ENDFILE */ -#line 444 "awkgram.y" +#line 445 "awkgram.y" { yyvsp[0]->in_rule = rule = ENDFILE; yyvsp[0]->source_file = source; yyval = yyvsp[0]; } -#line 2258 "awkgram.c" +#line 2266 "awkgram.c" break; case 29: /* action: l_brace statements r_brace opt_semi opt_nls */ -#line 453 "awkgram.y" +#line 454 "awkgram.y" { INSTRUCTION *ip = make_braced_statements(yyvsp[-4], yyvsp[-3], yyvsp[-2]); @@ -2273,11 +2281,11 @@ yyreduce: yyval = ip; } -#line 2277 "awkgram.c" +#line 2285 "awkgram.c" break; case 31: /* func_name: FUNC_CALL */ -#line 472 "awkgram.y" +#line 473 "awkgram.y" { const char *name = yyvsp[0]->lextok; char *qname = qualify_name(name, strlen(name)); @@ -2288,36 +2296,36 @@ yyreduce: } yyval = yyvsp[0]; } -#line 2292 "awkgram.c" +#line 2300 "awkgram.c" break; case 32: /* func_name: lex_builtin */ -#line 483 "awkgram.y" +#line 484 "awkgram.y" { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); YYABORT; } -#line 2302 "awkgram.c" +#line 2310 "awkgram.c" break; case 33: /* func_name: '@' LEX_EVAL */ -#line 489 "awkgram.y" +#line 490 "awkgram.y" { yyval = yyvsp[0]; at_seen = false; } -#line 2311 "awkgram.c" +#line 2319 "awkgram.c" break; case 36: /* $@1: %empty */ -#line 501 "awkgram.y" +#line 502 "awkgram.y" { want_param_names = FUNC_HEADER; } -#line 2317 "awkgram.c" +#line 2325 "awkgram.c" break; case 37: /* function_prologue: LEX_FUNCTION func_name '(' $@1 opt_param_list r_paren opt_nls */ -#line 502 "awkgram.y" +#line 503 "awkgram.y" { INSTRUCTION *func_comment = NULL; // Merge any comments found in the parameter list with those @@ -2343,17 +2351,17 @@ yyreduce: yyval = yyvsp[-6]; want_param_names = FUNC_BODY; } -#line 2347 "awkgram.c" +#line 2355 "awkgram.c" break; case 38: /* $@2: %empty */ -#line 535 "awkgram.y" +#line 536 "awkgram.y" { want_regexp = true; } -#line 2353 "awkgram.c" +#line 2361 "awkgram.c" break; case 39: /* regexp: a_slash $@2 REGEXP */ -#line 537 "awkgram.y" +#line 538 "awkgram.y" { NODE *n, *exp; char *re; @@ -2382,11 +2390,11 @@ yyreduce: yyval->opcode = Op_match_rec; yyval->memory = n; } -#line 2386 "awkgram.c" +#line 2394 "awkgram.c" break; case 40: /* typed_regexp: TYPED_REGEXP */ -#line 569 "awkgram.y" +#line 570 "awkgram.y" { char *re; size_t len; @@ -2399,23 +2407,23 @@ yyreduce: yyval->opcode = Op_push_re; yyval->memory = make_typed_regex(re, len); } -#line 2403 "awkgram.c" +#line 2411 "awkgram.c" break; case 41: /* a_slash: '/' */ -#line 584 "awkgram.y" +#line 585 "awkgram.y" { bcfree(yyvsp[0]); } -#line 2409 "awkgram.c" +#line 2417 "awkgram.c" break; case 43: /* statements: %empty */ -#line 590 "awkgram.y" +#line 591 "awkgram.y" { yyval = NULL; } -#line 2415 "awkgram.c" +#line 2423 "awkgram.c" break; case 44: /* statements: statements statement */ -#line 592 "awkgram.y" +#line 593 "awkgram.y" { if (yyvsp[0] == NULL) { yyval = yyvsp[-1]; @@ -2435,29 +2443,29 @@ yyreduce: yyerrok; } -#line 2439 "awkgram.c" +#line 2447 "awkgram.c" break; case 45: /* statements: statements error */ -#line 612 "awkgram.y" +#line 613 "awkgram.y" { yyval = NULL; } -#line 2445 "awkgram.c" +#line 2453 "awkgram.c" break; case 46: /* statement_term: nls */ -#line 616 "awkgram.y" +#line 617 "awkgram.y" { yyval = yyvsp[0]; } -#line 2451 "awkgram.c" +#line 2459 "awkgram.c" break; case 47: /* statement_term: semi opt_nls */ -#line 617 "awkgram.y" +#line 618 "awkgram.y" { yyval = yyvsp[0]; } -#line 2457 "awkgram.c" +#line 2465 "awkgram.c" break; case 48: /* statement: semi opt_nls */ -#line 622 "awkgram.y" +#line 623 "awkgram.y" { if (yyvsp[0] != NULL) { INSTRUCTION *ip; @@ -2468,31 +2476,31 @@ yyreduce: } else yyval = NULL; } -#line 2472 "awkgram.c" +#line 2480 "awkgram.c" break; case 49: /* statement: l_brace statements r_brace */ -#line 633 "awkgram.y" +#line 634 "awkgram.y" { trailing_comment = yyvsp[0]; // NULL or comment yyval = make_braced_statements(yyvsp[-2], yyvsp[-1], yyvsp[0]); } -#line 2481 "awkgram.c" +#line 2489 "awkgram.c" break; case 50: /* statement: if_statement */ -#line 638 "awkgram.y" +#line 639 "awkgram.y" { if (do_pretty_print) yyval = list_prepend(yyvsp[0], instruction(Op_exec_count)); else yyval = yyvsp[0]; } -#line 2492 "awkgram.c" +#line 2500 "awkgram.c" break; case 51: /* statement: LEX_SWITCH '(' exp r_paren opt_nls l_brace case_statements opt_nls r_brace */ -#line 645 "awkgram.y" +#line 646 "awkgram.y" { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2600,11 +2608,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2604 "awkgram.c" +#line 2612 "awkgram.c" break; case 52: /* statement: LEX_WHILE '(' exp r_paren opt_nls statement */ -#line 753 "awkgram.y" +#line 754 "awkgram.y" { /* * ----------------- @@ -2655,11 +2663,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2659 "awkgram.c" +#line 2667 "awkgram.c" break; case 53: /* statement: LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls */ -#line 804 "awkgram.y" +#line 805 "awkgram.y" { /* * ----------------- @@ -2709,11 +2717,11 @@ yyreduce: /* else $1 and $4 are NULLs */ } -#line 2713 "awkgram.c" +#line 2721 "awkgram.c" break; case 54: /* statement: LEX_FOR '(' NAME LEX_IN simple_variable r_paren opt_nls statement */ -#line 854 "awkgram.y" +#line 855 "awkgram.y" { INSTRUCTION *ip; char *var_name = yyvsp[-5]->lextok; @@ -2839,11 +2847,11 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2843 "awkgram.c" +#line 2851 "awkgram.c" break; case 55: /* statement: LEX_FOR '(' opt_simple_stmt semi opt_nls exp semi opt_nls opt_simple_stmt r_paren opt_nls statement */ -#line 980 "awkgram.y" +#line 981 "awkgram.y" { if (yyvsp[-7] != NULL) { merge_comments(yyvsp[-7], NULL); @@ -2865,11 +2873,11 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2869 "awkgram.c" +#line 2877 "awkgram.c" break; case 56: /* statement: LEX_FOR '(' opt_simple_stmt semi opt_nls semi opt_nls opt_simple_stmt r_paren opt_nls statement */ -#line 1002 "awkgram.y" +#line 1003 "awkgram.y" { if (yyvsp[-6] != NULL) { merge_comments(yyvsp[-6], NULL); @@ -2890,22 +2898,22 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2894 "awkgram.c" +#line 2902 "awkgram.c" break; case 57: /* statement: non_compound_stmt */ -#line 1023 "awkgram.y" +#line 1024 "awkgram.y" { if (do_pretty_print) yyval = list_prepend(yyvsp[0], instruction(Op_exec_count)); else yyval = yyvsp[0]; } -#line 2905 "awkgram.c" +#line 2913 "awkgram.c" break; case 58: /* non_compound_stmt: LEX_BREAK statement_term */ -#line 1033 "awkgram.y" +#line 1034 "awkgram.y" { if (! break_allowed) error_ln(yyvsp[-1]->source_line, @@ -2915,11 +2923,11 @@ regular_loop: if (yyvsp[0] != NULL) yyval = list_append(yyval, yyvsp[0]); } -#line 2919 "awkgram.c" +#line 2927 "awkgram.c" break; case 59: /* non_compound_stmt: LEX_CONTINUE statement_term */ -#line 1043 "awkgram.y" +#line 1044 "awkgram.y" { if (! continue_allowed) error_ln(yyvsp[-1]->source_line, @@ -2929,11 +2937,11 @@ regular_loop: if (yyvsp[0] != NULL) yyval = list_append(yyval, yyvsp[0]); } -#line 2933 "awkgram.c" +#line 2941 "awkgram.c" break; case 60: /* non_compound_stmt: LEX_NEXT statement_term */ -#line 1053 "awkgram.y" +#line 1054 "awkgram.y" { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2944,11 +2952,11 @@ regular_loop: if (yyvsp[0] != NULL) yyval = list_append(yyval, yyvsp[0]); } -#line 2948 "awkgram.c" +#line 2956 "awkgram.c" break; case 61: /* non_compound_stmt: LEX_NEXTFILE statement_term */ -#line 1064 "awkgram.y" +#line 1065 "awkgram.y" { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2961,11 +2969,11 @@ regular_loop: if (yyvsp[0] != NULL) yyval = list_append(yyval, yyvsp[0]); } -#line 2965 "awkgram.c" +#line 2973 "awkgram.c" break; case 62: /* non_compound_stmt: LEX_EXIT opt_exp statement_term */ -#line 1077 "awkgram.y" +#line 1078 "awkgram.y" { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2982,20 +2990,20 @@ regular_loop: if (yyvsp[0] != NULL) yyval = list_append(yyval, yyvsp[0]); } -#line 2986 "awkgram.c" +#line 2994 "awkgram.c" break; case 63: /* $@3: %empty */ -#line 1094 "awkgram.y" +#line 1095 "awkgram.y" { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2995 "awkgram.c" +#line 3003 "awkgram.c" break; case 64: /* non_compound_stmt: LEX_RETURN $@3 opt_fcall_exp statement_term */ -#line 1097 "awkgram.y" +#line 1098 "awkgram.y" { if (called_from_eval) yyvsp[-3]->opcode = Op_K_return_from_eval; @@ -3009,28 +3017,28 @@ regular_loop: if (yyvsp[0] != NULL) yyval = list_append(yyval, yyvsp[0]); } -#line 3013 "awkgram.c" +#line 3021 "awkgram.c" break; case 65: /* non_compound_stmt: simple_stmt statement_term */ -#line 1111 "awkgram.y" +#line 1112 "awkgram.y" { if (yyvsp[0] != NULL) yyval = list_append(yyvsp[-1], yyvsp[0]); else yyval = yyvsp[-1]; } -#line 3024 "awkgram.c" +#line 3032 "awkgram.c" break; case 66: /* $@4: %empty */ -#line 1128 "awkgram.y" +#line 1129 "awkgram.y" { in_print = true; in_parens = 0; } -#line 3030 "awkgram.c" +#line 3038 "awkgram.c" break; case 67: /* simple_stmt: print $@4 print_expression_list output_redir */ -#line 1129 "awkgram.y" +#line 1130 "awkgram.y" { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -3131,17 +3139,17 @@ regular_print: } } } -#line 3135 "awkgram.c" +#line 3143 "awkgram.c" break; case 68: /* $@5: %empty */ -#line 1230 "awkgram.y" +#line 1231 "awkgram.y" { sub_counter = 0; } -#line 3141 "awkgram.c" +#line 3149 "awkgram.c" break; case 69: /* simple_stmt: LEX_DELETE NAME $@5 delete_subscript_list */ -#line 1231 "awkgram.y" +#line 1232 "awkgram.y" { char *arr = yyvsp[-2]->lextok; @@ -3174,11 +3182,11 @@ regular_print: yyval = list_append(list_append(yyvsp[0], yyvsp[-2]), yyvsp[-3]); } } -#line 3178 "awkgram.c" +#line 3186 "awkgram.c" break; case 70: /* simple_stmt: LEX_DELETE '(' NAME ')' */ -#line 1268 "awkgram.y" +#line 1269 "awkgram.y" { static bool warned = false; char *arr = yyvsp[-1]->lextok; @@ -3204,54 +3212,54 @@ regular_print: fatal(_("`delete' is not allowed with FUNCTAB")); } } -#line 3208 "awkgram.c" +#line 3216 "awkgram.c" break; case 71: /* simple_stmt: exp */ -#line 1294 "awkgram.y" +#line 1295 "awkgram.y" { yyval = optimize_assignment(yyvsp[0]); } -#line 3216 "awkgram.c" +#line 3224 "awkgram.c" break; case 72: /* opt_simple_stmt: %empty */ -#line 1301 "awkgram.y" +#line 1302 "awkgram.y" { yyval = NULL; } -#line 3222 "awkgram.c" +#line 3230 "awkgram.c" break; case 73: /* opt_simple_stmt: simple_stmt */ -#line 1303 "awkgram.y" +#line 1304 "awkgram.y" { yyval = yyvsp[0]; } -#line 3228 "awkgram.c" +#line 3236 "awkgram.c" break; case 74: /* case_statements: %empty */ -#line 1308 "awkgram.y" +#line 1309 "awkgram.y" { yyval = NULL; } -#line 3234 "awkgram.c" +#line 3242 "awkgram.c" break; case 75: /* case_statements: case_statements case_statement */ -#line 1310 "awkgram.y" +#line 1311 "awkgram.y" { if (yyvsp[-1] == NULL) yyval = list_create(yyvsp[0]); else yyval = list_prepend(yyvsp[-1], yyvsp[0]); } -#line 3245 "awkgram.c" +#line 3253 "awkgram.c" break; case 76: /* case_statements: case_statements error */ -#line 1317 "awkgram.y" +#line 1318 "awkgram.y" { yyval = NULL; } -#line 3251 "awkgram.c" +#line 3259 "awkgram.c" break; case 77: /* case_statement: LEX_CASE case_value colon opt_nls statements */ -#line 1322 "awkgram.y" +#line 1323 "awkgram.y" { INSTRUCTION *casestmt = yyvsp[0]; if (yyvsp[0] == NULL) @@ -3264,11 +3272,11 @@ regular_print: bcfree(yyvsp[-2]); yyval = yyvsp[-4]; } -#line 3268 "awkgram.c" +#line 3276 "awkgram.c" break; case 78: /* case_statement: LEX_DEFAULT colon opt_nls statements */ -#line 1335 "awkgram.y" +#line 1336 "awkgram.y" { INSTRUCTION *casestmt = yyvsp[0]; if (yyvsp[0] == NULL) @@ -3280,17 +3288,17 @@ regular_print: yyvsp[-3]->comment = yyvsp[-1]; yyval = yyvsp[-3]; } -#line 3284 "awkgram.c" +#line 3292 "awkgram.c" break; case 79: /* case_value: YNUMBER */ -#line 1350 "awkgram.y" +#line 1351 "awkgram.y" { yyval = yyvsp[0]; } -#line 3290 "awkgram.c" +#line 3298 "awkgram.c" break; case 80: /* case_value: '-' YNUMBER */ -#line 1352 "awkgram.y" +#line 1353 "awkgram.y" { NODE *n = yyvsp[0]->memory; (void) force_number(n); @@ -3298,28 +3306,28 @@ regular_print: bcfree(yyvsp[-1]); yyval = yyvsp[0]; } -#line 3302 "awkgram.c" +#line 3310 "awkgram.c" break; case 81: /* case_value: '+' YNUMBER */ -#line 1360 "awkgram.y" +#line 1361 "awkgram.y" { NODE *n = yyvsp[0]->lasti->memory; bcfree(yyvsp[-1]); add_sign_to_num(n, '+'); yyval = yyvsp[0]; } -#line 3313 "awkgram.c" +#line 3321 "awkgram.c" break; case 82: /* case_value: YSTRING */ -#line 1367 "awkgram.y" +#line 1368 "awkgram.y" { yyval = yyvsp[0]; } -#line 3319 "awkgram.c" +#line 3327 "awkgram.c" break; case 83: /* case_value: regexp */ -#line 1369 "awkgram.y" +#line 1370 "awkgram.y" { if (yyvsp[0]->memory->type == Node_regex) yyvsp[0]->opcode = Op_push_re; @@ -3327,57 +3335,57 @@ regular_print: yyvsp[0]->opcode = Op_push; yyval = yyvsp[0]; } -#line 3331 "awkgram.c" +#line 3339 "awkgram.c" break; case 84: /* case_value: typed_regexp */ -#line 1377 "awkgram.y" +#line 1378 "awkgram.y" { assert((yyvsp[0]->memory->flags & REGEX) == REGEX); yyvsp[0]->opcode = Op_push_re; yyval = yyvsp[0]; } -#line 3341 "awkgram.c" +#line 3349 "awkgram.c" break; case 85: /* print: LEX_PRINT */ -#line 1386 "awkgram.y" +#line 1387 "awkgram.y" { yyval = yyvsp[0]; } -#line 3347 "awkgram.c" +#line 3355 "awkgram.c" break; case 86: /* print: LEX_PRINTF */ -#line 1388 "awkgram.y" +#line 1389 "awkgram.y" { yyval = yyvsp[0]; } -#line 3353 "awkgram.c" +#line 3361 "awkgram.c" break; case 88: /* print_expression_list: '(' expression_list r_paren */ -#line 1398 "awkgram.y" +#line 1399 "awkgram.y" { yyval = yyvsp[-1]; } -#line 3361 "awkgram.c" +#line 3369 "awkgram.c" break; case 89: /* output_redir: %empty */ -#line 1405 "awkgram.y" +#line 1406 "awkgram.y" { in_print = false; in_parens = 0; yyval = NULL; } -#line 3371 "awkgram.c" +#line 3379 "awkgram.c" break; case 90: /* $@6: %empty */ -#line 1410 "awkgram.y" +#line 1411 "awkgram.y" { in_print = false; in_parens = 0; } -#line 3377 "awkgram.c" +#line 3385 "awkgram.c" break; case 91: /* output_redir: IO_OUT $@6 common_exp */ -#line 1411 "awkgram.y" +#line 1412 "awkgram.y" { if (yyvsp[-2]->redir_type == redirect_twoway && yyvsp[0]->lasti->opcode == Op_K_getline_redir @@ -3387,22 +3395,22 @@ regular_print: lintwarn(_("concatenation as I/O `>' redirection target is ambiguous")); yyval = list_prepend(yyvsp[0], yyvsp[-2]); } -#line 3391 "awkgram.c" +#line 3399 "awkgram.c" break; case 92: /* if_statement: LEX_IF '(' exp r_paren opt_nls statement */ -#line 1424 "awkgram.y" +#line 1425 "awkgram.y" { if (yyvsp[-1] != NULL) yyvsp[-5]->comment = yyvsp[-1]; add_lint(yyvsp[-3], LINT_assign_in_cond); yyval = mk_condition(yyvsp[-3], yyvsp[-5], yyvsp[0], NULL, NULL); } -#line 3402 "awkgram.c" +#line 3410 "awkgram.c" break; case 93: /* if_statement: LEX_IF '(' exp r_paren opt_nls statement LEX_ELSE opt_nls statement */ -#line 1432 "awkgram.y" +#line 1433 "awkgram.y" { if (yyvsp[-4] != NULL) yyvsp[-8]->comment = yyvsp[-4]; @@ -3411,19 +3419,19 @@ regular_print: add_lint(yyvsp[-6], LINT_assign_in_cond); yyval = mk_condition(yyvsp[-6], yyvsp[-8], yyvsp[-3], yyvsp[-2], yyvsp[0]); } -#line 3415 "awkgram.c" +#line 3423 "awkgram.c" break; case 94: /* nls: NEWLINE */ -#line 1444 "awkgram.y" +#line 1445 "awkgram.y" { yyval = yyvsp[0]; } -#line 3423 "awkgram.c" +#line 3431 "awkgram.c" break; case 95: /* nls: nls NEWLINE */ -#line 1448 "awkgram.y" +#line 1449 "awkgram.y" { if (yyvsp[-1] != NULL && yyvsp[0] != NULL) { if (yyvsp[-1]->memory->comment_type == EOL_COMMENT) { @@ -3441,59 +3449,59 @@ regular_print: } else yyval = NULL; } -#line 3445 "awkgram.c" +#line 3453 "awkgram.c" break; case 96: /* opt_nls: %empty */ -#line 1469 "awkgram.y" +#line 1470 "awkgram.y" { yyval = NULL; } -#line 3451 "awkgram.c" +#line 3459 "awkgram.c" break; case 97: /* opt_nls: nls */ -#line 1471 "awkgram.y" +#line 1472 "awkgram.y" { yyval = yyvsp[0]; } -#line 3457 "awkgram.c" +#line 3465 "awkgram.c" break; case 98: /* input_redir: %empty */ -#line 1476 "awkgram.y" +#line 1477 "awkgram.y" { yyval = NULL; } -#line 3463 "awkgram.c" +#line 3471 "awkgram.c" break; case 99: /* input_redir: '<' simp_exp */ -#line 1478 "awkgram.y" +#line 1479 "awkgram.y" { bcfree(yyvsp[-1]); yyval = yyvsp[0]; } -#line 3472 "awkgram.c" +#line 3480 "awkgram.c" break; case 100: /* opt_param_list: %empty */ -#line 1486 "awkgram.y" +#line 1487 "awkgram.y" { yyval = NULL; } -#line 3478 "awkgram.c" +#line 3486 "awkgram.c" break; case 101: /* opt_param_list: param_list */ -#line 1488 "awkgram.y" +#line 1489 "awkgram.y" { yyval = yyvsp[0]; } -#line 3484 "awkgram.c" +#line 3492 "awkgram.c" break; case 102: /* param_list: NAME */ -#line 1493 "awkgram.y" +#line 1494 "awkgram.y" { yyvsp[0]->param_count = 0; yyval = list_create(yyvsp[0]); } -#line 3493 "awkgram.c" +#line 3501 "awkgram.c" break; case 103: /* param_list: param_list comma NAME */ -#line 1498 "awkgram.y" +#line 1499 "awkgram.y" { if (yyvsp[-2] != NULL && yyvsp[0] != NULL) { yyvsp[0]->param_count = yyvsp[-2]->lasti->param_count + 1; @@ -3510,76 +3518,76 @@ regular_print: } else yyval = NULL; } -#line 3514 "awkgram.c" +#line 3522 "awkgram.c" break; case 104: /* param_list: error */ -#line 1515 "awkgram.y" +#line 1516 "awkgram.y" { yyval = NULL; } -#line 3520 "awkgram.c" +#line 3528 "awkgram.c" break; case 105: /* param_list: param_list error */ -#line 1517 "awkgram.y" +#line 1518 "awkgram.y" { yyval = yyvsp[-1]; } -#line 3526 "awkgram.c" +#line 3534 "awkgram.c" break; case 106: /* param_list: param_list comma error */ -#line 1519 "awkgram.y" +#line 1520 "awkgram.y" { yyval = yyvsp[-2]; } -#line 3532 "awkgram.c" +#line 3540 "awkgram.c" break; case 107: /* opt_exp: %empty */ -#line 1525 "awkgram.y" +#line 1526 "awkgram.y" { yyval = NULL; } -#line 3538 "awkgram.c" +#line 3546 "awkgram.c" break; case 108: /* opt_exp: exp */ -#line 1527 "awkgram.y" +#line 1528 "awkgram.y" { yyval = yyvsp[0]; } -#line 3544 "awkgram.c" +#line 3552 "awkgram.c" break; case 109: /* opt_expression_list: %empty */ -#line 1532 "awkgram.y" +#line 1533 "awkgram.y" { yyval = NULL; } -#line 3550 "awkgram.c" +#line 3558 "awkgram.c" break; case 110: /* opt_expression_list: expression_list */ -#line 1534 "awkgram.y" +#line 1535 "awkgram.y" { yyval = yyvsp[0]; } -#line 3556 "awkgram.c" +#line 3564 "awkgram.c" break; case 111: /* expression_list: exp */ -#line 1539 "awkgram.y" +#line 1540 "awkgram.y" { yyval = mk_expression_list(NULL, yyvsp[0]); } -#line 3562 "awkgram.c" +#line 3570 "awkgram.c" break; case 112: /* expression_list: expression_list comma exp */ -#line 1541 "awkgram.y" +#line 1542 "awkgram.y" { if (yyvsp[-1] != NULL) yyvsp[-2]->lasti->comment = yyvsp[-1]; yyval = mk_expression_list(yyvsp[-2], yyvsp[0]); yyerrok; } -#line 3573 "awkgram.c" +#line 3581 "awkgram.c" break; case 113: /* expression_list: error */ -#line 1548 "awkgram.y" +#line 1549 "awkgram.y" { yyval = NULL; } -#line 3579 "awkgram.c" +#line 3587 "awkgram.c" break; case 114: /* expression_list: expression_list error */ -#line 1550 "awkgram.y" +#line 1551 "awkgram.y" { /* * Returning the expression list instead of NULL lets @@ -3587,66 +3595,66 @@ regular_print: */ yyval = yyvsp[-1]; } -#line 3591 "awkgram.c" +#line 3599 "awkgram.c" break; case 115: /* expression_list: expression_list error exp */ -#line 1558 "awkgram.y" +#line 1559 "awkgram.y" { /* Ditto */ yyval = mk_expression_list(yyvsp[-2], yyvsp[0]); } -#line 3600 "awkgram.c" +#line 3608 "awkgram.c" break; case 116: /* expression_list: expression_list comma error */ -#line 1563 "awkgram.y" +#line 1564 "awkgram.y" { /* Ditto */ if (yyvsp[-1] != NULL) yyvsp[-2]->lasti->comment = yyvsp[-1]; yyval = yyvsp[-2]; } -#line 3611 "awkgram.c" +#line 3619 "awkgram.c" break; case 117: /* opt_fcall_expression_list: %empty */ -#line 1573 "awkgram.y" +#line 1574 "awkgram.y" { yyval = NULL; } -#line 3617 "awkgram.c" +#line 3625 "awkgram.c" break; case 118: /* opt_fcall_expression_list: fcall_expression_list */ -#line 1575 "awkgram.y" +#line 1576 "awkgram.y" { yyval = yyvsp[0]; } -#line 3623 "awkgram.c" +#line 3631 "awkgram.c" break; case 119: /* fcall_expression_list: fcall_exp */ -#line 1580 "awkgram.y" +#line 1581 "awkgram.y" { yyval = mk_expression_list(NULL, yyvsp[0]); } -#line 3629 "awkgram.c" +#line 3637 "awkgram.c" break; case 120: /* fcall_expression_list: fcall_expression_list comma fcall_exp */ -#line 1582 "awkgram.y" +#line 1583 "awkgram.y" { if (yyvsp[-1] != NULL) yyvsp[-2]->lasti->comment = yyvsp[-1]; yyval = mk_expression_list(yyvsp[-2], yyvsp[0]); yyerrok; } -#line 3640 "awkgram.c" +#line 3648 "awkgram.c" break; case 121: /* fcall_expression_list: error */ -#line 1589 "awkgram.y" +#line 1590 "awkgram.y" { yyval = NULL; } -#line 3646 "awkgram.c" +#line 3654 "awkgram.c" break; case 122: /* fcall_expression_list: fcall_expression_list error */ -#line 1591 "awkgram.y" +#line 1592 "awkgram.y" { /* * Returning the expression list instead of NULL lets @@ -3654,86 +3662,86 @@ regular_print: */ yyval = yyvsp[-1]; } -#line 3658 "awkgram.c" +#line 3666 "awkgram.c" break; case 123: /* fcall_expression_list: fcall_expression_list error fcall_exp */ -#line 1599 "awkgram.y" +#line 1600 "awkgram.y" { /* Ditto */ yyval = mk_expression_list(yyvsp[-2], yyvsp[0]); } -#line 3667 "awkgram.c" +#line 3675 "awkgram.c" break; case 124: /* fcall_expression_list: fcall_expression_list comma error */ -#line 1604 "awkgram.y" +#line 1605 "awkgram.y" { /* Ditto */ if (yyvsp[-1] != NULL) yyvsp[-2]->comment = yyvsp[-1]; yyval = yyvsp[-2]; } -#line 3678 "awkgram.c" +#line 3686 "awkgram.c" break; case 125: /* fcall_exp: exp */ -#line 1613 "awkgram.y" +#line 1614 "awkgram.y" { yyval = yyvsp[0]; } -#line 3684 "awkgram.c" +#line 3692 "awkgram.c" break; case 126: /* fcall_exp: typed_regexp */ -#line 1614 "awkgram.y" +#line 1615 "awkgram.y" { yyval = list_create(yyvsp[0]); } -#line 3690 "awkgram.c" +#line 3698 "awkgram.c" break; case 127: /* opt_fcall_exp: %empty */ -#line 1619 "awkgram.y" +#line 1620 "awkgram.y" { yyval = NULL; } -#line 3696 "awkgram.c" +#line 3704 "awkgram.c" break; case 128: /* opt_fcall_exp: fcall_exp */ -#line 1620 "awkgram.y" +#line 1621 "awkgram.y" { yyval = yyvsp[0]; } -#line 3702 "awkgram.c" +#line 3710 "awkgram.c" break; case 129: /* exp: variable assign_operator exp */ -#line 1626 "awkgram.y" +#line 1627 "awkgram.y" { 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 3713 "awkgram.c" +#line 3721 "awkgram.c" break; case 130: /* exp: variable ASSIGN typed_regexp */ -#line 1633 "awkgram.y" +#line 1634 "awkgram.y" { yyval = mk_assignment(yyvsp[-2], list_create(yyvsp[0]), yyvsp[-1]); } -#line 3721 "awkgram.c" +#line 3729 "awkgram.c" break; case 131: /* exp: exp LEX_AND exp */ -#line 1637 "awkgram.y" +#line 1638 "awkgram.y" { yyval = mk_boolean(yyvsp[-2], yyvsp[0], yyvsp[-1]); } -#line 3727 "awkgram.c" +#line 3735 "awkgram.c" break; case 132: /* exp: exp LEX_OR exp */ -#line 1639 "awkgram.y" +#line 1640 "awkgram.y" { yyval = mk_boolean(yyvsp[-2], yyvsp[0], yyvsp[-1]); } -#line 3733 "awkgram.c" +#line 3741 "awkgram.c" break; case 133: /* exp: exp MATCHOP typed_regexp */ -#line 1641 "awkgram.y" +#line 1642 "awkgram.y" { if (yyvsp[-2]->lasti->opcode == Op_match_rec) warning_ln(yyvsp[-1]->source_line, @@ -3746,11 +3754,11 @@ regular_print: bcfree(yyvsp[0]); yyval = list_append(yyvsp[-2], yyvsp[-1]); } -#line 3750 "awkgram.c" +#line 3758 "awkgram.c" break; case 134: /* exp: exp MATCHOP exp */ -#line 1654 "awkgram.y" +#line 1655 "awkgram.y" { if (yyvsp[-2]->lasti->opcode == Op_match_rec) warning_ln(yyvsp[-1]->source_line, @@ -3767,11 +3775,11 @@ regular_print: yyval = list_append(list_merge(yyvsp[-2], yyvsp[0]), yyvsp[-1]); } } -#line 3771 "awkgram.c" +#line 3779 "awkgram.c" break; case 135: /* exp: exp LEX_IN simple_variable */ -#line 1671 "awkgram.y" +#line 1672 "awkgram.y" { if (do_lint_old) lintwarn_ln(yyvsp[-1]->source_line, @@ -3781,91 +3789,91 @@ regular_print: yyvsp[-1]->expr_count = 1; yyval = list_append(list_merge(yyvsp[-2], yyvsp[0]), yyvsp[-1]); } -#line 3785 "awkgram.c" +#line 3793 "awkgram.c" break; case 136: /* exp: exp a_relop exp */ -#line 1681 "awkgram.y" +#line 1682 "awkgram.y" { 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 3796 "awkgram.c" +#line 3804 "awkgram.c" break; case 137: /* exp: exp '?' exp ':' exp */ -#line 1688 "awkgram.y" +#line 1689 "awkgram.y" { yyval = mk_condition(yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); } -#line 3802 "awkgram.c" +#line 3810 "awkgram.c" break; case 138: /* exp: common_exp */ -#line 1690 "awkgram.y" +#line 1691 "awkgram.y" { yyval = yyvsp[0]; } -#line 3808 "awkgram.c" +#line 3816 "awkgram.c" break; case 139: /* assign_operator: ASSIGN */ -#line 1695 "awkgram.y" +#line 1696 "awkgram.y" { yyval = yyvsp[0]; } -#line 3814 "awkgram.c" +#line 3822 "awkgram.c" break; case 140: /* assign_operator: ASSIGNOP */ -#line 1697 "awkgram.y" +#line 1698 "awkgram.y" { yyval = yyvsp[0]; } -#line 3820 "awkgram.c" +#line 3828 "awkgram.c" break; case 141: /* assign_operator: SLASH_BEFORE_EQUAL ASSIGN */ -#line 1699 "awkgram.y" +#line 1700 "awkgram.y" { yyvsp[0]->opcode = Op_assign_quotient; yyval = yyvsp[0]; } -#line 3829 "awkgram.c" +#line 3837 "awkgram.c" break; case 142: /* relop_or_less: RELOP */ -#line 1707 "awkgram.y" +#line 1708 "awkgram.y" { yyval = yyvsp[0]; } -#line 3835 "awkgram.c" +#line 3843 "awkgram.c" break; case 143: /* relop_or_less: '<' */ -#line 1709 "awkgram.y" +#line 1710 "awkgram.y" { yyval = yyvsp[0]; } -#line 3841 "awkgram.c" +#line 3849 "awkgram.c" break; case 144: /* a_relop: relop_or_less */ -#line 1714 "awkgram.y" +#line 1715 "awkgram.y" { yyval = yyvsp[0]; } -#line 3847 "awkgram.c" +#line 3855 "awkgram.c" break; case 145: /* a_relop: '>' */ -#line 1716 "awkgram.y" +#line 1717 "awkgram.y" { yyval = yyvsp[0]; } -#line 3853 "awkgram.c" +#line 3861 "awkgram.c" break; case 146: /* common_exp: simp_exp */ -#line 1721 "awkgram.y" +#line 1722 "awkgram.y" { yyval = yyvsp[0]; } -#line 3859 "awkgram.c" +#line 3867 "awkgram.c" break; case 147: /* common_exp: simp_exp_nc */ -#line 1723 "awkgram.y" +#line 1724 "awkgram.y" { yyval = yyvsp[0]; } -#line 3865 "awkgram.c" +#line 3873 "awkgram.c" break; case 148: /* common_exp: common_exp simp_exp */ -#line 1725 "awkgram.y" +#line 1726 "awkgram.y" { int count = 2; bool is_simple_var = false; @@ -3919,47 +3927,47 @@ regular_print: max_args = count; } } -#line 3923 "awkgram.c" +#line 3931 "awkgram.c" break; case 150: /* simp_exp: simp_exp '^' simp_exp */ -#line 1784 "awkgram.y" +#line 1785 "awkgram.y" { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); } -#line 3929 "awkgram.c" +#line 3937 "awkgram.c" break; case 151: /* simp_exp: simp_exp '*' simp_exp */ -#line 1786 "awkgram.y" +#line 1787 "awkgram.y" { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); } -#line 3935 "awkgram.c" +#line 3943 "awkgram.c" break; case 152: /* simp_exp: simp_exp '/' simp_exp */ -#line 1788 "awkgram.y" +#line 1789 "awkgram.y" { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); } -#line 3941 "awkgram.c" +#line 3949 "awkgram.c" break; case 153: /* simp_exp: simp_exp '%' simp_exp */ -#line 1790 "awkgram.y" +#line 1791 "awkgram.y" { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); } -#line 3947 "awkgram.c" +#line 3955 "awkgram.c" break; case 154: /* simp_exp: simp_exp '+' simp_exp */ -#line 1792 "awkgram.y" +#line 1793 "awkgram.y" { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); } -#line 3953 "awkgram.c" +#line 3961 "awkgram.c" break; case 155: /* simp_exp: simp_exp '-' simp_exp */ -#line 1794 "awkgram.y" +#line 1795 "awkgram.y" { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); } -#line 3959 "awkgram.c" +#line 3967 "awkgram.c" break; case 156: /* simp_exp: LEX_GETLINE opt_variable input_redir */ -#line 1796 "awkgram.y" +#line 1797 "awkgram.y" { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3973,29 +3981,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); yyval = mk_getline(yyvsp[-2], yyvsp[-1], yyvsp[0], redirect_input); } -#line 3977 "awkgram.c" +#line 3985 "awkgram.c" break; case 157: /* simp_exp: variable INCREMENT */ -#line 1810 "awkgram.y" +#line 1811 "awkgram.y" { yyvsp[0]->opcode = Op_postincrement; yyval = mk_assignment(yyvsp[-1], NULL, yyvsp[0]); } -#line 3986 "awkgram.c" +#line 3994 "awkgram.c" break; case 158: /* simp_exp: variable DECREMENT */ -#line 1815 "awkgram.y" +#line 1816 "awkgram.y" { yyvsp[0]->opcode = Op_postdecrement; yyval = mk_assignment(yyvsp[-1], NULL, yyvsp[0]); } -#line 3995 "awkgram.c" +#line 4003 "awkgram.c" break; case 159: /* simp_exp: '(' expression_list r_paren LEX_IN simple_variable */ -#line 1820 "awkgram.y" +#line 1821 "awkgram.y" { if (do_lint_old) { /* first one is warning so that second one comes out if warnings are fatal */ @@ -4016,64 +4024,64 @@ regular_print: yyval = list_append(list_merge(t, yyvsp[0]), yyvsp[-1]); } } -#line 4020 "awkgram.c" +#line 4028 "awkgram.c" break; case 160: /* simp_exp_nc: common_exp IO_IN LEX_GETLINE opt_variable */ -#line 1846 "awkgram.y" +#line 1847 "awkgram.y" { yyval = mk_getline(yyvsp[-1], yyvsp[0], yyvsp[-3], yyvsp[-2]->redir_type); bcfree(yyvsp[-2]); } -#line 4029 "awkgram.c" +#line 4037 "awkgram.c" break; case 161: /* simp_exp_nc: simp_exp_nc '^' simp_exp */ -#line 1852 "awkgram.y" +#line 1853 "awkgram.y" { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); } -#line 4035 "awkgram.c" +#line 4043 "awkgram.c" break; case 162: /* simp_exp_nc: simp_exp_nc '*' simp_exp */ -#line 1854 "awkgram.y" +#line 1855 "awkgram.y" { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); } -#line 4041 "awkgram.c" +#line 4049 "awkgram.c" break; case 163: /* simp_exp_nc: simp_exp_nc '/' simp_exp */ -#line 1856 "awkgram.y" +#line 1857 "awkgram.y" { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); } -#line 4047 "awkgram.c" +#line 4055 "awkgram.c" break; case 164: /* simp_exp_nc: simp_exp_nc '%' simp_exp */ -#line 1858 "awkgram.y" +#line 1859 "awkgram.y" { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); } -#line 4053 "awkgram.c" +#line 4061 "awkgram.c" break; case 165: /* simp_exp_nc: simp_exp_nc '+' simp_exp */ -#line 1860 "awkgram.y" +#line 1861 "awkgram.y" { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); } -#line 4059 "awkgram.c" +#line 4067 "awkgram.c" break; case 166: /* simp_exp_nc: simp_exp_nc '-' simp_exp */ -#line 1862 "awkgram.y" +#line 1863 "awkgram.y" { yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); } -#line 4065 "awkgram.c" +#line 4073 "awkgram.c" break; case 167: /* non_post_simp_exp: regexp */ -#line 1867 "awkgram.y" +#line 1868 "awkgram.y" { yyval = list_create(yyvsp[0]); } -#line 4073 "awkgram.c" +#line 4081 "awkgram.c" break; case 168: /* non_post_simp_exp: '!' simp_exp */ -#line 1871 "awkgram.y" +#line 1872 "awkgram.y" { if (yyvsp[0]->opcode == Op_match_rec) { yyvsp[0]->opcode = Op_nomatch; @@ -4105,11 +4113,11 @@ regular_print: } } } -#line 4109 "awkgram.c" +#line 4117 "awkgram.c" break; case 169: /* non_post_simp_exp: '(' exp r_paren */ -#line 1903 "awkgram.y" +#line 1904 "awkgram.y" { // Always include. Allows us to lint warn on // print "foo" > "bar" 1 @@ -4117,31 +4125,31 @@ regular_print: // print "foo" > ("bar" 1) yyval = list_append(yyvsp[-1], bcalloc(Op_parens, 1, sourceline)); } -#line 4121 "awkgram.c" +#line 4129 "awkgram.c" break; case 170: /* non_post_simp_exp: LEX_BUILTIN '(' opt_fcall_expression_list r_paren */ -#line 1911 "awkgram.y" +#line 1912 "awkgram.y" { yyval = snode(yyvsp[-1], yyvsp[-3]); if (yyval == NULL) YYABORT; } -#line 4131 "awkgram.c" +#line 4139 "awkgram.c" break; case 171: /* non_post_simp_exp: LEX_LENGTH '(' opt_fcall_expression_list r_paren */ -#line 1917 "awkgram.y" +#line 1918 "awkgram.y" { yyval = snode(yyvsp[-1], yyvsp[-3]); if (yyval == NULL) YYABORT; } -#line 4141 "awkgram.c" +#line 4149 "awkgram.c" break; case 172: /* non_post_simp_exp: LEX_LENGTH */ -#line 1923 "awkgram.y" +#line 1924 "awkgram.y" { static bool warned = false; @@ -4154,45 +4162,45 @@ regular_print: if (yyval == NULL) YYABORT; } -#line 4158 "awkgram.c" +#line 4166 "awkgram.c" break; case 175: /* non_post_simp_exp: INCREMENT variable */ -#line 1938 "awkgram.y" +#line 1939 "awkgram.y" { yyvsp[-1]->opcode = Op_preincrement; yyval = mk_assignment(yyvsp[0], NULL, yyvsp[-1]); } -#line 4167 "awkgram.c" +#line 4175 "awkgram.c" break; case 176: /* non_post_simp_exp: DECREMENT variable */ -#line 1943 "awkgram.y" +#line 1944 "awkgram.y" { yyvsp[-1]->opcode = Op_predecrement; yyval = mk_assignment(yyvsp[0], NULL, yyvsp[-1]); } -#line 4176 "awkgram.c" +#line 4184 "awkgram.c" break; case 177: /* non_post_simp_exp: YNUMBER */ -#line 1948 "awkgram.y" +#line 1949 "awkgram.y" { yyval = list_create(yyvsp[0]); } -#line 4184 "awkgram.c" +#line 4192 "awkgram.c" break; case 178: /* non_post_simp_exp: YSTRING */ -#line 1952 "awkgram.y" +#line 1953 "awkgram.y" { yyval = list_create(yyvsp[0]); } -#line 4192 "awkgram.c" +#line 4200 "awkgram.c" break; case 179: /* non_post_simp_exp: '-' simp_exp */ -#line 1956 "awkgram.y" +#line 1957 "awkgram.y" { if (yyvsp[0]->lasti->opcode == Op_push_i && (yyvsp[0]->lasti->memory->flags & STRING) == 0 @@ -4207,11 +4215,11 @@ regular_print: yyval = list_append(yyvsp[0], yyvsp[-1]); } } -#line 4211 "awkgram.c" +#line 4219 "awkgram.c" break; case 180: /* non_post_simp_exp: '+' simp_exp */ -#line 1971 "awkgram.y" +#line 1972 "awkgram.y" { if (yyvsp[0]->lasti->opcode == Op_push_i && (yyvsp[0]->lasti->memory->flags & STRING) == 0 @@ -4229,20 +4237,20 @@ regular_print: yyval = list_append(yyvsp[0], yyvsp[-1]); } } -#line 4233 "awkgram.c" +#line 4241 "awkgram.c" break; case 181: /* func_call: direct_func_call */ -#line 1992 "awkgram.y" +#line 1993 "awkgram.y" { func_use(yyvsp[0]->lasti->func_name, FUNC_USE); yyval = yyvsp[0]; } -#line 4242 "awkgram.c" +#line 4250 "awkgram.c" break; case 182: /* func_call: '@' direct_func_call */ -#line 1997 "awkgram.y" +#line 1998 "awkgram.y" { /* indirect function call */ INSTRUCTION *f, *t; @@ -4276,11 +4284,11 @@ regular_print: yyval = list_prepend(yyvsp[0], t); at_seen = false; } -#line 4280 "awkgram.c" +#line 4288 "awkgram.c" break; case 183: /* direct_func_call: FUNC_CALL '(' opt_fcall_expression_list r_paren */ -#line 2034 "awkgram.y" +#line 2035 "awkgram.y" { NODE *n; char *name = yyvsp[-3]->func_name; @@ -4313,49 +4321,49 @@ regular_print: yyval = list_append(t, yyvsp[-3]); } } -#line 4317 "awkgram.c" +#line 4325 "awkgram.c" break; case 184: /* opt_variable: %empty */ -#line 2070 "awkgram.y" +#line 2071 "awkgram.y" { yyval = NULL; } -#line 4323 "awkgram.c" +#line 4331 "awkgram.c" break; case 185: /* opt_variable: variable */ -#line 2072 "awkgram.y" +#line 2073 "awkgram.y" { yyval = yyvsp[0]; } -#line 4329 "awkgram.c" +#line 4337 "awkgram.c" break; case 186: /* delete_subscript_list: %empty */ -#line 2077 "awkgram.y" +#line 2078 "awkgram.y" { yyval = NULL; } -#line 4335 "awkgram.c" +#line 4343 "awkgram.c" break; case 187: /* delete_subscript_list: delete_subscript SUBSCRIPT */ -#line 2079 "awkgram.y" +#line 2080 "awkgram.y" { yyval = yyvsp[-1]; } -#line 4341 "awkgram.c" +#line 4349 "awkgram.c" break; case 188: /* delete_subscript: delete_exp_list */ -#line 2084 "awkgram.y" +#line 2085 "awkgram.y" { yyval = yyvsp[0]; } -#line 4347 "awkgram.c" +#line 4355 "awkgram.c" break; case 189: /* delete_subscript: delete_subscript delete_exp_list */ -#line 2086 "awkgram.y" +#line 2087 "awkgram.y" { yyval = list_merge(yyvsp[-1], yyvsp[0]); } -#line 4355 "awkgram.c" +#line 4363 "awkgram.c" break; case 190: /* delete_exp_list: bracketed_exp_list */ -#line 2093 "awkgram.y" +#line 2094 "awkgram.y" { INSTRUCTION *ip = yyvsp[0]->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -4369,11 +4377,11 @@ regular_print: sub_counter++; /* count # of dimensions */ yyval = yyvsp[0]; } -#line 4373 "awkgram.c" +#line 4381 "awkgram.c" break; case 191: /* bracketed_exp_list: '[' expression_list ']' */ -#line 2110 "awkgram.y" +#line 2111 "awkgram.y" { INSTRUCTION *t = yyvsp[-1]; if (yyvsp[-1] == NULL) { @@ -4387,41 +4395,41 @@ regular_print: yyvsp[0]->sub_count = count_expressions(&t, false); yyval = list_append(t, yyvsp[0]); } -#line 4391 "awkgram.c" +#line 4399 "awkgram.c" break; case 192: /* subscript: bracketed_exp_list */ -#line 2127 "awkgram.y" +#line 2128 "awkgram.y" { yyval = yyvsp[0]; } -#line 4397 "awkgram.c" +#line 4405 "awkgram.c" break; case 193: /* subscript: subscript bracketed_exp_list */ -#line 2129 "awkgram.y" +#line 2130 "awkgram.y" { yyval = list_merge(yyvsp[-1], yyvsp[0]); } -#line 4405 "awkgram.c" +#line 4413 "awkgram.c" break; case 194: /* subscript_list: subscript SUBSCRIPT */ -#line 2136 "awkgram.y" +#line 2137 "awkgram.y" { yyval = yyvsp[-1]; } -#line 4411 "awkgram.c" +#line 4419 "awkgram.c" break; case 195: /* simple_variable: NAME */ -#line 2141 "awkgram.y" +#line 2142 "awkgram.y" { yyvsp[0]->opcode = Op_push; yyvsp[0]->memory = variable(yyvsp[0]->source_line, yyvsp[0]->lextok, Node_var_new); yyval = list_create(yyvsp[0]); } -#line 4421 "awkgram.c" +#line 4429 "awkgram.c" break; case 196: /* simple_variable: NAME subscript_list */ -#line 2147 "awkgram.y" +#line 2148 "awkgram.y" { char *arr = yyvsp[-1]->lextok; @@ -4429,11 +4437,11 @@ regular_print: yyvsp[-1]->opcode = Op_push_array; yyval = list_prepend(yyvsp[0], yyvsp[-1]); } -#line 4433 "awkgram.c" +#line 4441 "awkgram.c" break; case 197: /* variable: simple_variable */ -#line 2158 "awkgram.y" +#line 2159 "awkgram.y" { INSTRUCTION *ip = yyvsp[0]->nexti; if (ip->opcode == Op_push @@ -4445,85 +4453,85 @@ regular_print: } else yyval = yyvsp[0]; } -#line 4449 "awkgram.c" +#line 4457 "awkgram.c" break; case 198: /* variable: '$' non_post_simp_exp opt_incdec */ -#line 2170 "awkgram.y" +#line 2171 "awkgram.y" { yyval = list_append(yyvsp[-1], yyvsp[-2]); if (yyvsp[0] != NULL) mk_assignment(yyvsp[-1], NULL, yyvsp[0]); } -#line 4459 "awkgram.c" +#line 4467 "awkgram.c" break; case 199: /* opt_incdec: INCREMENT */ -#line 2179 "awkgram.y" +#line 2180 "awkgram.y" { yyvsp[0]->opcode = Op_postincrement; } -#line 4467 "awkgram.c" +#line 4475 "awkgram.c" break; case 200: /* opt_incdec: DECREMENT */ -#line 2183 "awkgram.y" +#line 2184 "awkgram.y" { yyvsp[0]->opcode = Op_postdecrement; } -#line 4475 "awkgram.c" +#line 4483 "awkgram.c" break; case 201: /* opt_incdec: %empty */ -#line 2187 "awkgram.y" +#line 2188 "awkgram.y" { yyval = NULL; } -#line 4481 "awkgram.c" +#line 4489 "awkgram.c" break; case 202: /* l_brace: '{' opt_nls */ -#line 2191 "awkgram.y" +#line 2192 "awkgram.y" { yyval = yyvsp[0]; } -#line 4487 "awkgram.c" +#line 4495 "awkgram.c" break; case 203: /* r_brace: '}' opt_nls */ -#line 2195 "awkgram.y" +#line 2196 "awkgram.y" { yyval = yyvsp[0]; yyerrok; } -#line 4493 "awkgram.c" +#line 4501 "awkgram.c" break; case 204: /* r_paren: ')' */ -#line 2199 "awkgram.y" +#line 2200 "awkgram.y" { yyerrok; } -#line 4499 "awkgram.c" +#line 4507 "awkgram.c" break; case 205: /* opt_semi: %empty */ -#line 2204 "awkgram.y" +#line 2205 "awkgram.y" { yyval = NULL; } -#line 4505 "awkgram.c" +#line 4513 "awkgram.c" break; case 207: /* semi: ';' */ -#line 2209 "awkgram.y" +#line 2210 "awkgram.y" { yyerrok; } -#line 4511 "awkgram.c" +#line 4519 "awkgram.c" break; case 208: /* colon: ':' */ -#line 2213 "awkgram.y" +#line 2214 "awkgram.y" { yyval = yyvsp[0]; yyerrok; } -#line 4517 "awkgram.c" +#line 4525 "awkgram.c" break; case 209: /* comma: ',' opt_nls */ -#line 2217 "awkgram.y" +#line 2218 "awkgram.y" { yyval = yyvsp[0]; yyerrok; } -#line 4523 "awkgram.c" +#line 4531 "awkgram.c" break; -#line 4527 "awkgram.c" +#line 4535 "awkgram.c" default: break; } @@ -4605,6 +4613,7 @@ yyerrorlab: label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; + ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -4665,7 +4674,7 @@ yyerrlab1: `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturn; + goto yyreturnlab; /*-----------------------------------. @@ -4673,24 +4682,22 @@ yyacceptlab: `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturn; + goto yyreturnlab; -#if !defined yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; - goto yyreturn; -#endif + goto yyreturnlab; -/*-------------------------------------------------------. -| yyreturn -- parsing is finished, clean up and return. | -`-------------------------------------------------------*/ -yyreturn: +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at @@ -4717,7 +4724,7 @@ yyreturn: return yyresult; } -#line 2219 "awkgram.y" +#line 2220 "awkgram.y" struct token { @@ -35,6 +35,7 @@ #endif static void yyerror(const char *m, ...) ATTRIBUTE_PRINTF_1; +#define YYERROR_IS_DECLARED 1 /* for bison 3.8. sigh. */ static void error_ln(int line, const char *m, ...) ATTRIBUTE_PRINTF_2; static void lintwarn_ln(int line, const char *m, ...) ATTRIBUTE_PRINTF_2; static void warning_ln(int line, const char *m, ...) ATTRIBUTE_PRINTF_2; @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.7.1. */ +/* A Bison parser, made by GNU Bison 3.8. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -45,11 +45,11 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Identify Bison output. */ -#define YYBISON 1 +/* Identify Bison output, and Bison version. */ +#define YYBISON 30800 -/* Bison version. */ -#define YYBISON_VERSION "3.7.1" +/* Bison version string. */ +#define YYBISON_VERSION "3.8" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -86,6 +86,7 @@ int yydebug = 2; static int yylex(void); static void yyerror(const char *mesg, ...); +#define YYERROR_IS_DECLARED 1 /* for bison 3.8. sigh. */ static int find_command(const char *token, size_t toklen); @@ -141,7 +142,7 @@ static void append_cmdarg(CMDARG *arg); static int find_argument(CMDARG *arg); #define YYSTYPE CMDARG * -#line 145 "command.c" +#line 146 "command.c" # ifndef YY_CAST # ifdef __cplusplus @@ -232,6 +233,7 @@ extern int zzdebug; typedef enum yytokentype yytoken_kind_t; #endif /* Token kinds. */ +#define YYEMPTY -2 #define YYEOF 0 #define YYerror 256 #define YYUNDEF 257 @@ -292,9 +294,17 @@ typedef int YYSTYPE; extern YYSTYPE zzlval; +#if !defined zzerror && !defined YYERROR_IS_DECLARED +void zzerror (const char *msg); +#endif +#if !defined zzlex && !defined YYLEX_IS_DECLARED +int zzlex (void); +#endif + int zzparse (void); + /* Symbol kind. */ enum yysymbol_kind_t { @@ -456,6 +466,18 @@ typedef int_least16_t yytype_int16; typedef short yytype_int16; #endif +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ @@ -553,17 +575,23 @@ typedef int yy_state_fast_t; /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -782,25 +810,25 @@ static const yytype_int8 yytranslate[] = }; #if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 109, 109, 110, 128, 129, 179, 186, 187, 188, - 189, 190, 194, 195, 196, 197, 201, 202, 203, 204, - 208, 209, 214, 218, 238, 245, 245, 252, 268, 282, - 283, 284, 285, 286, 287, 293, 305, 306, 307, 307, - 308, 308, 309, 310, 311, 312, 313, 313, 314, 315, - 315, 316, 316, 317, 317, 318, 319, 320, 325, 330, - 356, 366, 371, 383, 383, 391, 405, 418, 419, 425, - 426, 430, 431, 432, 433, 439, 440, 441, 446, 457, - 458, 463, 471, 488, 489, 490, 491, 492, 497, 498, - 498, 499, 500, 500, 501, 506, 507, 512, 513, 518, - 519, 523, 524, 528, 529, 544, 545, 550, 558, 559, - 560, 561, 565, 566, 570, 571, 572, 577, 578, 580, - 587, 588, 589, 590, 591, 592, 596, 609, 610, 611, - 615, 616, 617, 618, 622, 624, 626, 630, 645, 649, - 651, 656, 657, 666, 676, 678, 685, 698, 699, 705, - 706, 711, 717, 726, 728, 730, 738 + 0, 110, 110, 111, 129, 130, 180, 187, 188, 189, + 190, 191, 195, 196, 197, 198, 202, 203, 204, 205, + 209, 210, 215, 219, 239, 246, 246, 253, 269, 283, + 284, 285, 286, 287, 288, 294, 306, 307, 308, 308, + 309, 309, 310, 311, 312, 313, 314, 314, 315, 316, + 316, 317, 317, 318, 318, 319, 320, 321, 326, 331, + 357, 367, 372, 384, 384, 392, 406, 419, 420, 426, + 427, 431, 432, 433, 434, 440, 441, 442, 447, 458, + 459, 464, 472, 489, 490, 491, 492, 493, 498, 499, + 499, 500, 501, 501, 502, 507, 508, 513, 514, 519, + 520, 524, 525, 529, 530, 545, 546, 551, 559, 560, + 561, 562, 566, 567, 571, 572, 573, 578, 579, 581, + 588, 589, 590, 591, 592, 593, 597, 610, 611, 612, + 616, 617, 618, 619, 623, 625, 627, 631, 646, 650, + 652, 657, 658, 667, 677, 679, 686, 699, 700, 706, + 707, 712, 718, 727, 729, 731, 739 }; #endif @@ -845,20 +873,6 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_int16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 61, - 44, 58, 64, 43, 45, 91, 93, 36, 10 -}; -#endif - #define YYPACT_NINF (-151) #define yypact_value_is_default(Yyn) \ @@ -869,8 +883,8 @@ static const yytype_int16 yytoknum[] = #define yytable_value_is_error(Yyn) \ 0 - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { -151, 145, -151, -34, -151, -151, 50, -151, -151, -151, @@ -896,9 +910,9 @@ static const yytype_int16 yypact[] = -151, -151, -151 }; - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_uint8 yydefact[] = { 2, 0, 1, 0, 18, 20, 83, 7, 15, 14, @@ -924,7 +938,7 @@ static const yytype_uint8 yydefact[] = 137, 93, 135 }; - /* YYPGOTO[NTERM-NUM]. */ +/* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, @@ -935,10 +949,10 @@ static const yytype_int16 yypgoto[] = 97, -151, -5, -151, -3 }; - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_uint8 yydefgoto[] = { - -1, 1, 46, 47, 48, 49, 50, 98, 51, 111, + 0, 1, 46, 47, 48, 49, 50, 98, 51, 111, 186, 52, 53, 80, 81, 83, 82, 85, 86, 149, 175, 93, 146, 147, 176, 177, 91, 59, 60, 109, 153, 196, 139, 88, 136, 70, 64, 125, 126, 130, @@ -946,9 +960,9 @@ static const yytype_int16 yydefgoto[] = 94, 105, 68, 106, 54 }; - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 55, 61, 76, 78, 132, 121, 138, 174, 140, 141, @@ -999,8 +1013,8 @@ static const yytype_int16 yycheck[] = -1, -1, -1, 58 }; - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ static const yytype_int8 yystos[] = { 0, 60, 0, 1, 3, 4, 5, 6, 7, 8, @@ -1026,7 +1040,7 @@ static const yytype_int8 yystos[] = 56, 79, 108 }; - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int8 yyr1[] = { 0, 59, 60, 60, 61, 61, 61, 62, 62, 62, @@ -1047,7 +1061,7 @@ static const yytype_int8 yyr1[] = 110, 111, 111, 112, 112, 112, 113 }; - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 0, 2, 1, 2, 2, 1, 1, 1, @@ -1077,6 +1091,7 @@ enum { YYENOMEM = -2 }; #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) @@ -1117,10 +1132,7 @@ do { \ YYFPRINTF Args; \ } while (0) -/* This macro is provided for backward compatibility. */ -# ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif + # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ @@ -1144,15 +1156,11 @@ yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; - YYUSE (yyoutput); + YY_USE (yyoutput); if (!yyvaluep) return; -# ifdef YYPRINT - if (yykind < YYNTOKENS) - YYPRINT (yyo, yytoknum[yykind], *yyvaluep); -# endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yykind); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1266,13 +1274,13 @@ static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep) { - YYUSE (yyvaluep); + YY_USE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yykind); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1335,6 +1343,7 @@ yyparse (void) YYDPRINTF ((stderr, "Starting parse\n")); yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; @@ -1360,7 +1369,7 @@ yysetstate: if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; + YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ @@ -1388,7 +1397,7 @@ yysetstate: # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; @@ -1399,7 +1408,7 @@ yysetstate: YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) - goto yyexhaustedlab; + YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE @@ -1421,6 +1430,7 @@ yysetstate: } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + if (yystate == YYFINAL) YYACCEPT; @@ -1533,7 +1543,7 @@ yyreduce: switch (yyn) { case 3: /* input: input line */ -#line 111 "command.y" +#line 112 "command.y" { cmd_idx = -1; want_nodeval = false; @@ -1548,11 +1558,11 @@ yyreduce: arg_list = NULL; } } -#line 1552 "command.c" +#line 1562 "command.c" break; case 5: /* line: command nls */ -#line 130 "command.y" +#line 131 "command.y" { if (dbg_errcount == 0 && cmd_idx >= 0) { Func_cmd cmdfunc; @@ -1602,25 +1612,25 @@ yyreduce: YYACCEPT; } } -#line 1606 "command.c" +#line 1616 "command.c" break; case 6: /* line: error nls */ -#line 180 "command.y" +#line 181 "command.y" { yyerrok; } -#line 1614 "command.c" +#line 1624 "command.c" break; case 22: /* set_want_nodeval: %empty */ -#line 214 "command.y" +#line 215 "command.y" { want_nodeval = true; } -#line 1620 "command.c" +#line 1630 "command.c" break; case 23: /* eval_prologue: D_EVAL set_want_nodeval opt_param_list nls */ -#line 219 "command.y" +#line 220 "command.y" { if (dbg_errcount == 0) { /* don't free arg_list; passed on to statement_list @@ -1636,11 +1646,11 @@ yyreduce: in_eval = true; } } -#line 1640 "command.c" +#line 1650 "command.c" break; case 24: /* statement_list: %empty */ -#line 238 "command.y" +#line 239 "command.y" { yyval = append_statement(arg_list, (char *) start_EVAL); if (read_a_line == read_commands_string) /* unserializing 'eval' in 'commands' */ @@ -1648,25 +1658,25 @@ yyreduce: free_cmdarg(arg_list); arg_list = NULL; } -#line 1652 "command.c" +#line 1662 "command.c" break; case 25: /* @1: %empty */ -#line 245 "command.y" +#line 246 "command.y" { yyval = append_statement(yyvsp[-1], lexptr_begin); } -#line 1658 "command.c" +#line 1668 "command.c" break; case 26: /* statement_list: statement_list D_STATEMENT @1 nls */ -#line 246 "command.y" +#line 247 "command.y" { yyval = yyvsp[-1]; } -#line 1666 "command.c" +#line 1676 "command.c" break; case 27: /* eval_cmd: eval_prologue statement_list D_END */ -#line 253 "command.y" +#line 254 "command.y" { arg_list = append_statement(yyvsp[-1], (char *) end_EVAL); if (read_a_line == read_commands_string) { /* unserializing 'eval' in 'commands' */ @@ -1682,11 +1692,11 @@ yyreduce: cmd_idx = find_command("eval", 4); in_eval = false; } -#line 1686 "command.c" +#line 1696 "command.c" break; case 28: /* eval_cmd: D_EVAL set_want_nodeval string_node */ -#line 269 "command.y" +#line 270 "command.y" { NODE *n; CMDARG *arg; @@ -1697,21 +1707,21 @@ yyreduce: free_cmdarg(arg_list); arg_list = arg; } -#line 1701 "command.c" +#line 1711 "command.c" break; case 34: /* command: frame_cmd opt_integer */ -#line 288 "command.y" +#line 289 "command.y" { if (cmdtab[cmd_idx].lex_class == D_FRAME && yyvsp[0] != NULL && yyvsp[0]->a_int < 0) yyerror(_("invalid frame number: %d"), yyvsp[0]->a_int); } -#line 1711 "command.c" +#line 1721 "command.c" break; case 35: /* command: D_INFO D_STRING */ -#line 294 "command.y" +#line 295 "command.y" { int idx = find_argument(yyvsp[0]); if (idx < 0) @@ -1723,65 +1733,65 @@ yyreduce: yyvsp[0]->a_argument = argtab[idx].value; } } -#line 1727 "command.c" +#line 1737 "command.c" break; case 38: /* $@2: %empty */ -#line 307 "command.y" +#line 308 "command.y" { want_nodeval = true; } -#line 1733 "command.c" +#line 1743 "command.c" break; case 40: /* $@3: %empty */ -#line 308 "command.y" +#line 309 "command.y" { want_nodeval = true; } -#line 1739 "command.c" +#line 1749 "command.c" break; case 46: /* $@4: %empty */ -#line 313 "command.y" +#line 314 "command.y" { want_nodeval = true; } -#line 1745 "command.c" +#line 1755 "command.c" break; case 49: /* $@5: %empty */ -#line 315 "command.y" +#line 316 "command.y" { want_nodeval = true; } -#line 1751 "command.c" +#line 1761 "command.c" break; case 51: /* $@6: %empty */ -#line 316 "command.y" +#line 317 "command.y" { want_nodeval = true; } -#line 1757 "command.c" +#line 1767 "command.c" break; case 53: /* $@7: %empty */ -#line 317 "command.y" +#line 318 "command.y" { want_nodeval = true; } -#line 1763 "command.c" +#line 1773 "command.c" break; case 57: /* command: D_SOURCE D_STRING */ -#line 321 "command.y" +#line 322 "command.y" { if (in_cmd_src(yyvsp[0]->a_string)) yyerror(_("source: `%s': already sourced"), yyvsp[0]->a_string); } -#line 1772 "command.c" +#line 1782 "command.c" break; case 58: /* command: D_SAVE D_STRING */ -#line 326 "command.y" +#line 327 "command.y" { if (! input_from_tty) yyerror(_("save: `%s': command not permitted"), yyvsp[0]->a_string); } -#line 1781 "command.c" +#line 1791 "command.c" break; case 59: /* command: D_COMMANDS commands_arg */ -#line 331 "command.y" +#line 332 "command.y" { int type = 0; int num; @@ -1807,11 +1817,11 @@ yyreduce: } } } -#line 1811 "command.c" +#line 1821 "command.c" break; case 60: /* command: D_END */ -#line 357 "command.y" +#line 358 "command.y" { if (! in_commands) yyerror(_("`end' valid only in command `commands' or `eval'")); @@ -1821,20 +1831,20 @@ yyreduce: in_commands = false; } } -#line 1825 "command.c" +#line 1835 "command.c" break; case 61: /* command: D_SILENT */ -#line 367 "command.y" +#line 368 "command.y" { if (! in_commands) yyerror(_("`silent' valid only in command `commands'")); } -#line 1834 "command.c" +#line 1844 "command.c" break; case 62: /* command: D_TRACE D_STRING */ -#line 372 "command.y" +#line 373 "command.y" { int idx = find_argument(yyvsp[0]); if (idx < 0) @@ -1846,17 +1856,17 @@ yyreduce: yyvsp[0]->a_argument = argtab[idx].value; } } -#line 1850 "command.c" +#line 1860 "command.c" break; case 63: /* $@8: %empty */ -#line 383 "command.y" +#line 384 "command.y" { want_nodeval = true; } -#line 1856 "command.c" +#line 1866 "command.c" break; case 64: /* command: D_CONDITION plus_integer $@8 condition_exp */ -#line 384 "command.y" +#line 385 "command.y" { int type; int num = yyvsp[-2]->a_int; @@ -1864,11 +1874,11 @@ yyreduce: if (! type) yyerror(_("condition: invalid breakpoint/watchpoint number")); } -#line 1868 "command.c" +#line 1878 "command.c" break; case 65: /* command: eval_cmd */ -#line 392 "command.y" +#line 393 "command.y" { if (in_commands) { /* Prepend command 'eval' to argument list */ @@ -1879,11 +1889,11 @@ yyreduce: arg_list = arg; } } -#line 1883 "command.c" +#line 1893 "command.c" break; case 66: /* condition_exp: opt_string_node */ -#line 406 "command.y" +#line 407 "command.y" { if (yyvsp[0] != NULL) { NODE *n = yyvsp[0]->a_node; @@ -1893,76 +1903,76 @@ yyreduce: } yyval = yyvsp[0]; } -#line 1897 "command.c" +#line 1907 "command.c" break; case 68: /* commands_arg: error */ -#line 420 "command.y" +#line 421 "command.y" { yyval = NULL; } -#line 1903 "command.c" +#line 1913 "command.c" break; case 69: /* opt_param_list: %empty */ -#line 425 "command.y" +#line 426 "command.y" { yyval = NULL; } -#line 1909 "command.c" +#line 1919 "command.c" break; case 74: /* param_list: error */ -#line 434 "command.y" +#line 435 "command.y" { yyval = NULL; } -#line 1915 "command.c" +#line 1925 "command.c" break; case 75: /* opt_string_node: %empty */ -#line 439 "command.y" +#line 440 "command.y" { yyval = NULL; } -#line 1921 "command.c" +#line 1931 "command.c" break; case 77: /* opt_string_node: error */ -#line 442 "command.y" +#line 443 "command.y" { yyval = NULL; } -#line 1927 "command.c" +#line 1937 "command.c" break; case 78: /* string_node: D_NODE */ -#line 447 "command.y" +#line 448 "command.y" { NODE *n; n = yyvsp[0]->a_node; if ((n->flags & STRING) == 0) yyerror(_("argument not a string")); } -#line 1938 "command.c" +#line 1948 "command.c" break; case 79: /* option_args: %empty */ -#line 457 "command.y" +#line 458 "command.y" { yyval = NULL; } -#line 1944 "command.c" +#line 1954 "command.c" break; case 80: /* option_args: D_STRING */ -#line 459 "command.y" +#line 460 "command.y" { if (find_option(yyvsp[0]->a_string) < 0) yyerror(_("option: invalid parameter - `%s'"), yyvsp[0]->a_string); } -#line 1953 "command.c" +#line 1963 "command.c" break; case 81: /* option_args: D_STRING '=' D_STRING */ -#line 464 "command.y" +#line 465 "command.y" { if (find_option(yyvsp[-2]->a_string) < 0) yyerror(_("option: invalid parameter - `%s'"), yyvsp[-2]->a_string); } -#line 1962 "command.c" +#line 1972 "command.c" break; case 82: /* func_name: D_STRING */ -#line 472 "command.y" +#line 473 "command.y" { NODE *n; n = lookup(yyvsp[0]->a_string); @@ -1975,53 +1985,53 @@ yyreduce: yyvsp[0]->a_node = n; } } -#line 1979 "command.c" +#line 1989 "command.c" break; case 83: /* location: %empty */ -#line 488 "command.y" +#line 489 "command.y" { yyval = NULL; } -#line 1985 "command.c" +#line 1995 "command.c" break; case 88: /* break_args: %empty */ -#line 497 "command.y" +#line 498 "command.y" { yyval = NULL; } -#line 1991 "command.c" +#line 2001 "command.c" break; case 89: /* $@9: %empty */ -#line 498 "command.y" +#line 499 "command.y" { want_nodeval = true; } -#line 1997 "command.c" +#line 2007 "command.c" break; case 92: /* $@10: %empty */ -#line 500 "command.y" +#line 501 "command.y" { want_nodeval = true; } -#line 2003 "command.c" +#line 2013 "command.c" break; case 95: /* opt_variable: %empty */ -#line 506 "command.y" +#line 507 "command.y" { yyval = NULL; } -#line 2009 "command.c" +#line 2019 "command.c" break; case 97: /* opt_string: %empty */ -#line 512 "command.y" +#line 513 "command.y" { yyval = NULL; } -#line 2015 "command.c" +#line 2025 "command.c" break; case 99: /* opt_node: %empty */ -#line 518 "command.y" +#line 519 "command.y" { yyval = NULL; } -#line 2021 "command.c" +#line 2031 "command.c" break; case 104: /* enable_args: D_STRING opt_integer_list */ -#line 530 "command.y" +#line 531 "command.y" { int idx = find_argument(yyvsp[-1]); if (idx < 0) @@ -2033,52 +2043,52 @@ yyreduce: yyvsp[-1]->a_argument = argtab[idx].value; } } -#line 2037 "command.c" +#line 2047 "command.c" break; case 106: /* print_exp: '@' D_VARIABLE */ -#line 546 "command.y" +#line 547 "command.y" { yyvsp[0]->type = D_array; /* dump all items */ yyvsp[0]->a_count = 0; } -#line 2046 "command.c" +#line 2056 "command.c" break; case 107: /* print_exp: '@' D_VARIABLE subscript_list */ -#line 551 "command.y" +#line 552 "command.y" { yyvsp[-1]->type = D_array; yyvsp[-1]->a_count = num_dim; } -#line 2055 "command.c" +#line 2065 "command.c" break; case 117: /* list_args: %empty */ -#line 577 "command.y" +#line 578 "command.y" { yyval = NULL; } -#line 2061 "command.c" +#line 2071 "command.c" break; case 118: /* list_args: '+' */ -#line 579 "command.y" +#line 580 "command.y" { yyval = NULL; } -#line 2067 "command.c" +#line 2077 "command.c" break; case 119: /* list_args: '-' */ -#line 581 "command.y" +#line 582 "command.y" { CMDARG *a; a = mk_cmdarg(D_int); a->a_int = -1; append_cmdarg(a); } -#line 2078 "command.c" +#line 2088 "command.c" break; case 126: /* integer_range: plus_integer '-' plus_integer */ -#line 597 "command.y" +#line 598 "command.y" { if (yyvsp[-2]->a_int > yyvsp[0]->a_int) yyerror(_("invalid range specification: %d - %d"), @@ -2087,29 +2097,29 @@ yyreduce: yyvsp[-2]->type = D_range; yyval = yyvsp[-2]; } -#line 2091 "command.c" +#line 2101 "command.c" break; case 127: /* opt_integer_list: %empty */ -#line 609 "command.y" +#line 610 "command.y" { yyval = NULL; } -#line 2097 "command.c" +#line 2107 "command.c" break; case 134: /* exp_list: node */ -#line 623 "command.y" +#line 624 "command.y" { yyval = yyvsp[0]; } -#line 2103 "command.c" +#line 2113 "command.c" break; case 135: /* exp_list: exp_list ',' node */ -#line 625 "command.y" +#line 626 "command.y" { yyval = yyvsp[-2]; } -#line 2109 "command.c" +#line 2119 "command.c" break; case 137: /* subscript: '[' exp_list ']' */ -#line 631 "command.y" +#line 632 "command.y" { CMDARG *a; NODE *subs; @@ -2124,23 +2134,23 @@ yyreduce: yyvsp[-1]->a_node = subs; yyval = yyvsp[-1]; } -#line 2128 "command.c" +#line 2138 "command.c" break; case 139: /* subscript_list: subscript */ -#line 650 "command.y" +#line 651 "command.y" { yyval = yyvsp[0]; num_dim = 1; } -#line 2134 "command.c" +#line 2144 "command.c" break; case 140: /* subscript_list: subscript_list subscript */ -#line 652 "command.y" +#line 653 "command.y" { yyval = yyvsp[-1]; num_dim++; } -#line 2140 "command.c" +#line 2150 "command.c" break; case 142: /* variable: '$' D_NODE */ -#line 658 "command.y" +#line 659 "command.y" { NODE *n = yyvsp[0]->a_node; if ((n->flags & NUMBER) == 0) @@ -2149,39 +2159,39 @@ yyreduce: yyvsp[0]->type = D_field; yyval = yyvsp[0]; } -#line 2153 "command.c" +#line 2163 "command.c" break; case 143: /* variable: D_VARIABLE subscript_list */ -#line 667 "command.y" +#line 668 "command.y" { /* a_string is array name, a_count is dimension count */ yyvsp[-1]->type = D_subscript; yyvsp[-1]->a_count = num_dim; yyval = yyvsp[-1]; } -#line 2164 "command.c" +#line 2174 "command.c" break; case 144: /* node: D_NODE */ -#line 677 "command.y" +#line 678 "command.y" { yyval = yyvsp[0]; } -#line 2170 "command.c" +#line 2180 "command.c" break; case 145: /* node: '+' D_NODE */ -#line 679 "command.y" +#line 680 "command.y" { NODE *n = yyvsp[0]->a_node; if ((n->flags & NUMBER) == 0) yyerror(_("non-numeric value found, numeric expected")); yyval = yyvsp[0]; } -#line 2181 "command.c" +#line 2191 "command.c" break; case 146: /* node: '-' D_NODE */ -#line 686 "command.y" +#line 687 "command.y" { NODE *n = yyvsp[0]->a_node; if ((n->flags & NUMBER) == 0) @@ -2190,76 +2200,76 @@ yyreduce: negate_num(n); yyval = yyvsp[0]; } -#line 2194 "command.c" +#line 2204 "command.c" break; case 147: /* opt_plus_integer: %empty */ -#line 698 "command.y" +#line 699 "command.y" { yyval = NULL; } -#line 2200 "command.c" +#line 2210 "command.c" break; case 148: /* opt_plus_integer: plus_integer */ -#line 700 "command.y" +#line 701 "command.y" { yyval = yyvsp[0]; } -#line 2206 "command.c" +#line 2216 "command.c" break; case 149: /* opt_integer: %empty */ -#line 705 "command.y" +#line 706 "command.y" { yyval = NULL; } -#line 2212 "command.c" +#line 2222 "command.c" break; case 150: /* opt_integer: integer */ -#line 707 "command.y" +#line 708 "command.y" { yyval = yyvsp[0]; } -#line 2218 "command.c" +#line 2228 "command.c" break; case 151: /* plus_integer: D_INT */ -#line 712 "command.y" +#line 713 "command.y" { if (yyvsp[0]->a_int == 0) yyerror(_("non-zero integer value")); yyval = yyvsp[0]; } -#line 2228 "command.c" +#line 2238 "command.c" break; case 152: /* plus_integer: '+' D_INT */ -#line 718 "command.y" +#line 719 "command.y" { if (yyvsp[0]->a_int == 0) yyerror(_("non-zero integer value")); yyval = yyvsp[0]; } -#line 2238 "command.c" +#line 2248 "command.c" break; case 153: /* integer: D_INT */ -#line 727 "command.y" +#line 728 "command.y" { yyval = yyvsp[0]; } -#line 2244 "command.c" +#line 2254 "command.c" break; case 154: /* integer: '+' D_INT */ -#line 729 "command.y" +#line 730 "command.y" { yyval = yyvsp[0]; } -#line 2250 "command.c" +#line 2260 "command.c" break; case 155: /* integer: '-' D_INT */ -#line 731 "command.y" +#line 732 "command.y" { yyvsp[0]->a_int = - yyvsp[0]->a_int; yyval = yyvsp[0]; } -#line 2259 "command.c" +#line 2269 "command.c" break; case 156: /* nls: '\n' */ -#line 739 "command.y" +#line 740 "command.y" { if (lexptr_begin != NULL) { if (input_from_tty && lexptr_begin[0] != '\0') @@ -2268,11 +2278,11 @@ yyreduce: lexptr_begin = NULL; } } -#line 2272 "command.c" +#line 2282 "command.c" break; -#line 2276 "command.c" +#line 2286 "command.c" default: break; } @@ -2354,6 +2364,7 @@ yyerrorlab: label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; + ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -2414,7 +2425,7 @@ yyerrlab1: `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturn; + goto yyreturnlab; /*-----------------------------------. @@ -2422,24 +2433,22 @@ yyacceptlab: `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturn; + goto yyreturnlab; -#if !defined yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; - goto yyreturn; -#endif + goto yyreturnlab; -/*-------------------------------------------------------. -| yyreturn -- parsing is finished, clean up and return. | -`-------------------------------------------------------*/ -yyreturn: +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at @@ -2466,7 +2475,7 @@ yyreturn: return yyresult; } -#line 749 "command.y" +#line 750 "command.y" @@ -36,6 +36,7 @@ int yydebug = 2; static int yylex(void); static void yyerror(const char *mesg, ...); +#define YYERROR_IS_DECLARED 1 /* for bison 3.8. sigh. */ static int find_command(const char *token, size_t toklen); |