[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, feature/ns-include, updated. gawk-4.1.0-5574-gbff70f6
From: |
Arnold Robbins |
Subject: |
[SCM] gawk branch, feature/ns-include, updated. gawk-4.1.0-5574-gbff70f61 |
Date: |
Thu, 1 Aug 2024 03:50:39 -0400 (EDT) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, feature/ns-include has been updated
via bff70f61beac1a038f86d216436dce21c25ebb22 (commit)
from 1b2ab0a10a5e0528e6257136bf559a832d8c8afd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=bff70f61beac1a038f86d216436dce21c25ebb22
commit bff70f61beac1a038f86d216436dce21c25ebb22
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Thu Aug 1 10:50:14 2024 +0300
@ns_include --> @nsinclude.
diff --git a/ChangeLog b/ChangeLog
index be127914..1eba0c09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-08-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ Per Andy's suggestion, @ns_include --> @nsinclude.
+
+ * awk.h (SRC_NSINC): Renamed from SRC_NS_INC.
+ * command.y, debug.c, io.c, main.c, profile.c, awkgram.y: All
+ uses adjusted.
+ * awkgram.y (LEX_NSINCLUDE): Renamed from LEX_NS_INCLUDE.
+ (tokentab): "nsinclude" token renamed from "ns_include".
+ (yylex): Adjust logic a bit.
+
2024-07-31 Arnold D. Robbins <arnold@skeeve.com>
Add @ns_include to include a file into the current namespace.
diff --git a/awk.h b/awk.h
index 82d170a4..7ca8e016 100644
--- a/awk.h
+++ b/awk.h
@@ -1025,7 +1025,7 @@ typedef struct srcfile {
SRC_STDIN,
SRC_FILE,
SRC_INC,
- SRC_NS_INC,
+ SRC_NSINC,
SRC_EXTLIB
} stype;
char *src; /* name on command line or include statement */
diff --git a/awkgram.c b/awkgram.c
index 1ff8410e..275a422c 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -67,6 +67,7 @@
/* First part of user prologue. */
+#line 26 "awkgram.y"
#ifdef GAWKDEBUG
#define YYDEBUG 12
@@ -236,6 +237,7 @@ extern double fmod(double x, double y);
#define YYSTYPE INSTRUCTION *
+#line 241 "awkgram.c"
# ifndef YY_CAST
# ifdef __cplusplus
@@ -326,7 +328,7 @@ extern int yydebug;
LEX_EVAL = 305, /* LEX_EVAL */
LEX_LOAD = 306, /* LEX_LOAD */
LEX_NAMESPACE = 307, /* LEX_NAMESPACE */
- LEX_NS_INCLUDE = 308, /* LEX_NS_INCLUDE */
+ LEX_NSINCLUDE = 308, /* LEX_NSINCLUDE */
NEWLINE = 309, /* NEWLINE */
SLASH_BEFORE_EQUAL = 310, /* SLASH_BEFORE_EQUAL */
UNARY = 311 /* UNARY */
@@ -388,7 +390,7 @@ extern int yydebug;
#define LEX_EVAL 305
#define LEX_LOAD 306
#define LEX_NAMESPACE 307
-#define LEX_NS_INCLUDE 308
+#define LEX_NSINCLUDE 308
#define NEWLINE 309
#define SLASH_BEFORE_EQUAL 310
#define UNARY 311
@@ -465,7 +467,7 @@ enum yysymbol_kind_t
YYSYMBOL_LEX_EVAL = 50, /* LEX_EVAL */
YYSYMBOL_LEX_LOAD = 51, /* LEX_LOAD */
YYSYMBOL_LEX_NAMESPACE = 52, /* LEX_NAMESPACE */
- YYSYMBOL_LEX_NS_INCLUDE = 53, /* LEX_NS_INCLUDE */
+ YYSYMBOL_LEX_NSINCLUDE = 53, /* LEX_NSINCLUDE */
YYSYMBOL_NEWLINE = 54, /* NEWLINE */
YYSYMBOL_SLASH_BEFORE_EQUAL = 55, /* SLASH_BEFORE_EQUAL */
YYSYMBOL_56_ = 56, /* '?' */
@@ -953,28 +955,28 @@ static const yytype_int8 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_int16 yyrline[] =
{
- 0, 238, 238, 239, 244, 254, 258, 270, 278, 292,
- 303, 313, 323, 333, 359, 369, 371, 376, 386, 388,
- 393, 395, 397, 403, 407, 412, 442, 454, 466, 472,
- 481, 499, 500, 511, 517, 525, 526, 530, 530, 564,
- 563, 597, 612, 614, 619, 620, 640, 645, 646, 650,
- 661, 666, 673, 781, 832, 882, 1008, 1030, 1051, 1061,
- 1071, 1081, 1092, 1105, 1123, 1122, 1139, 1157, 1157, 1259,
- 1259, 1292, 1322, 1330, 1331, 1337, 1338, 1345, 1350, 1363,
- 1378, 1380, 1388, 1395, 1397, 1405, 1414, 1416, 1425, 1426,
- 1434, 1439, 1439, 1452, 1459, 1472, 1476, 1498, 1499, 1505,
- 1506, 1515, 1516, 1521, 1526, 1543, 1545, 1547, 1554, 1555,
- 1561, 1562, 1567, 1569, 1576, 1578, 1586, 1591, 1602, 1603,
- 1608, 1610, 1617, 1619, 1627, 1632, 1642, 1643, 1648, 1649,
- 1654, 1661, 1665, 1667, 1669, 1682, 1699, 1709, 1716, 1718,
- 1723, 1725, 1727, 1735, 1737, 1742, 1744, 1749, 1751, 1753,
- 1810, 1812, 1814, 1816, 1818, 1820, 1822, 1824, 1838, 1843,
- 1848, 1874, 1880, 1882, 1884, 1886, 1888, 1890, 1895, 1899,
- 1931, 1939, 1945, 1951, 1964, 1965, 1966, 1971, 1976, 1980,
- 1984, 1999, 2020, 2025, 2062, 2099, 2100, 2106, 2107, 2112,
- 2114, 2121, 2138, 2155, 2157, 2164, 2169, 2175, 2187, 2199,
- 2208, 2212, 2217, 2221, 2225, 2229, 2234, 2235, 2239, 2243,
- 2247
+ 0, 237, 237, 238, 243, 253, 257, 269, 277, 291,
+ 302, 312, 322, 332, 358, 368, 370, 375, 385, 387,
+ 392, 394, 396, 402, 406, 411, 441, 453, 465, 471,
+ 480, 498, 499, 510, 516, 524, 525, 529, 529, 563,
+ 562, 596, 611, 613, 618, 619, 639, 644, 645, 649,
+ 660, 665, 672, 780, 831, 881, 1007, 1029, 1050, 1060,
+ 1070, 1080, 1091, 1104, 1122, 1121, 1138, 1156, 1156, 1258,
+ 1258, 1291, 1321, 1329, 1330, 1336, 1337, 1344, 1349, 1362,
+ 1377, 1379, 1387, 1394, 1396, 1404, 1413, 1415, 1424, 1425,
+ 1433, 1438, 1438, 1451, 1458, 1471, 1475, 1497, 1498, 1504,
+ 1505, 1514, 1515, 1520, 1525, 1542, 1544, 1546, 1553, 1554,
+ 1560, 1561, 1566, 1568, 1575, 1577, 1585, 1590, 1601, 1602,
+ 1607, 1609, 1616, 1618, 1626, 1631, 1641, 1642, 1647, 1648,
+ 1653, 1660, 1664, 1666, 1668, 1681, 1698, 1708, 1715, 1717,
+ 1722, 1724, 1726, 1734, 1736, 1741, 1743, 1748, 1750, 1752,
+ 1809, 1811, 1813, 1815, 1817, 1819, 1821, 1823, 1837, 1842,
+ 1847, 1873, 1879, 1881, 1883, 1885, 1887, 1889, 1894, 1898,
+ 1930, 1938, 1944, 1950, 1963, 1964, 1965, 1970, 1975, 1979,
+ 1983, 1998, 2019, 2024, 2061, 2098, 2099, 2105, 2106, 2111,
+ 2113, 2120, 2137, 2154, 2156, 2163, 2168, 2174, 2186, 2198,
+ 2207, 2211, 2216, 2220, 2224, 2228, 2233, 2234, 2238, 2242,
+ 2246
};
#endif
@@ -1000,7 +1002,7 @@ static const char *const yytname[] =
"LEX_ENDFILE", "LEX_GETLINE", "LEX_NEXTFILE", "LEX_IN", "LEX_AND",
"LEX_OR", "INCREMENT", "DECREMENT", "LEX_BUILTIN", "LEX_LENGTH",
"LEX_EOF", "LEX_INCLUDE", "LEX_EVAL", "LEX_LOAD", "LEX_NAMESPACE",
- "LEX_NS_INCLUDE", "NEWLINE", "SLASH_BEFORE_EQUAL", "'?'", "':'", "','",
+ "LEX_NSINCLUDE", "NEWLINE", "SLASH_BEFORE_EQUAL", "'?'", "':'", "','",
"'<'", "'>'", "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "UNARY", "'^'",
"'$'", "'('", "')'", "'@'", "'['", "']'", "'{'", "'}'", "';'", "$accept",
"program", "rule", "source", "library", "namespace", "pattern", "action",
@@ -1956,17 +1958,22 @@ yyreduce:
switch (yyn)
{
case 2: /* program: %empty */
+#line 237 "awkgram.y"
{ yyval = NULL; }
+#line 1964 "awkgram.c"
break;
case 3: /* program: program rule */
+#line 239 "awkgram.y"
{
rule = 0;
yyerrok;
}
+#line 1973 "awkgram.c"
break;
case 4: /* program: program nls */
+#line 244 "awkgram.y"
{
if (yyvsp[0] != NULL) {
if (yyvsp[-1] == NULL)
@@ -1976,15 +1983,19 @@ yyreduce:
}
yyval = yyvsp[-1];
}
+#line 1987 "awkgram.c"
break;
case 5: /* program: program LEX_EOF */
+#line 254 "awkgram.y"
{
next_sourcefile();
}
+#line 1995 "awkgram.c"
break;
case 6: /* program: program error */
+#line 258 "awkgram.y"
{
rule = 0;
/*
@@ -1993,9 +2004,11 @@ yyreduce:
*/
/* yyerrok; */
}
+#line 2008 "awkgram.c"
break;
case 7: /* rule: pattern action */
+#line 270 "awkgram.y"
{
(void) append_rule(yyvsp[-1], yyvsp[0]);
if (pending_comment != NULL) {
@@ -2003,9 +2016,11 @@ yyreduce:
pending_comment = NULL;
}
}
+#line 2020 "awkgram.c"
break;
case 8: /* rule: pattern statement_term */
+#line 278 "awkgram.y"
{
if (rule != Rule) {
msg(_("%s blocks must have an action part"),
ruletab[rule]);
@@ -2019,9 +2034,11 @@ yyreduce:
(void) append_rule(yyvsp[-1], NULL);
}
}
+#line 2038 "awkgram.c"
break;
case 9: /* rule: function_prologue action */
+#line 292 "awkgram.y"
{
in_function = false;
(void) mk_function(yyvsp[-1], yyvsp[0]);
@@ -2032,9 +2049,11 @@ yyreduce:
}
yyerrok;
}
+#line 2053 "awkgram.c"
break;
case 10: /* rule: '@' LEX_INCLUDE source statement_term */
+#line 303 "awkgram.y"
{
want_source = false;
at_seen--;
@@ -2044,9 +2063,11 @@ yyreduce:
}
yyerrok;
}
+#line 2067 "awkgram.c"
break;
- case 11: /* rule: '@' LEX_NS_INCLUDE source statement_term */
+ case 11: /* rule: '@' LEX_NSINCLUDE source statement_term */
+#line 313 "awkgram.y"
{
want_source = false;
at_seen--;
@@ -2056,9 +2077,11 @@ yyreduce:
}
yyerrok;
}
+#line 2081 "awkgram.c"
break;
case 12: /* rule: '@' LEX_LOAD library statement_term */
+#line 323 "awkgram.y"
{
want_source = false;
at_seen--;
@@ -2068,9 +2091,11 @@ yyreduce:
}
yyerrok;
}
+#line 2095 "awkgram.c"
break;
case 13: /* rule: '@' LEX_NAMESPACE namespace statement_term */
+#line 333 "awkgram.y"
{
/*
* 1/2022:
@@ -2093,9 +2118,11 @@ yyreduce:
yyerrok;
}
+#line 2122 "awkgram.c"
break;
case 14: /* source: FILENAME */
+#line 359 "awkgram.y"
{
void *srcfile = NULL;
@@ -2105,17 +2132,23 @@ yyreduce:
bcfree(yyvsp[0]);
yyval = (INSTRUCTION *) srcfile;
}
+#line 2136 "awkgram.c"
break;
case 15: /* source: FILENAME error */
+#line 369 "awkgram.y"
{ yyval = NULL; }
+#line 2142 "awkgram.c"
break;
case 16: /* source: error */
+#line 371 "awkgram.y"
{ yyval = NULL; }
+#line 2148 "awkgram.c"
break;
case 17: /* library: FILENAME */
+#line 376 "awkgram.y"
{
void *srcfile;
@@ -2125,42 +2158,58 @@ yyreduce:
bcfree(yyvsp[0]);
yyval = (INSTRUCTION *) srcfile;
}
+#line 2162 "awkgram.c"
break;
case 18: /* library: FILENAME error */
+#line 386 "awkgram.y"
{ yyval = NULL; }
+#line 2168 "awkgram.c"
break;
case 19: /* library: error */
+#line 388 "awkgram.y"
{ yyval = NULL; }
+#line 2174 "awkgram.c"
break;
case 20: /* namespace: FILENAME */
+#line 393 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 2180 "awkgram.c"
break;
case 21: /* namespace: FILENAME error */
+#line 395 "awkgram.y"
{ yyval = NULL; }
+#line 2186 "awkgram.c"
break;
case 22: /* namespace: error */
+#line 397 "awkgram.y"
{ yyval = NULL; }
+#line 2192 "awkgram.c"
break;
case 23: /* pattern: %empty */
+#line 402 "awkgram.y"
{
rule = Rule;
yyval = NULL;
}
+#line 2201 "awkgram.c"
break;
case 24: /* pattern: exp */
+#line 407 "awkgram.y"
{
rule = Rule;
}
+#line 2209 "awkgram.c"
break;
case 25: /* pattern: exp comma exp */
+#line 412 "awkgram.y"
{
INSTRUCTION *tp;
@@ -2190,9 +2239,11 @@ yyreduce:
yyval = list_append(list_merge(yyvsp[-2], yyvsp[0]),
tp);
rule = Rule;
}
+#line 2243 "awkgram.c"
break;
case 26: /* pattern: LEX_BEGIN */
+#line 442 "awkgram.y"
{
static int begin_seen = 0;
@@ -2204,9 +2255,11 @@ yyreduce:
yyvsp[0]->source_file = source;
yyval = yyvsp[0];
}
+#line 2259 "awkgram.c"
break;
case 27: /* pattern: LEX_END */
+#line 454 "awkgram.y"
{
static int end_seen = 0;
@@ -2218,25 +2271,31 @@ yyreduce:
yyvsp[0]->source_file = source;
yyval = yyvsp[0];
}
+#line 2275 "awkgram.c"
break;
case 28: /* pattern: LEX_BEGINFILE */
+#line 466 "awkgram.y"
{
yyvsp[0]->in_rule = rule = BEGINFILE;
yyvsp[0]->source_file = source;
yyval = yyvsp[0];
}
+#line 2285 "awkgram.c"
break;
case 29: /* pattern: LEX_ENDFILE */
+#line 472 "awkgram.y"
{
yyvsp[0]->in_rule = rule = ENDFILE;
yyvsp[0]->source_file = source;
yyval = yyvsp[0];
}
+#line 2295 "awkgram.c"
break;
case 30: /* action: l_brace statements r_brace opt_semi opt_nls */
+#line 481 "awkgram.y"
{
INSTRUCTION *ip = make_braced_statements(yyvsp[-4], yyvsp[-3],
yyvsp[-2]);
@@ -2251,9 +2310,11 @@ yyreduce:
yyval = ip;
}
+#line 2314 "awkgram.c"
break;
case 32: /* func_name: FUNC_CALL */
+#line 500 "awkgram.y"
{
const char *name = yyvsp[0]->lextok;
char *qname = qualify_name(name, strlen(name));
@@ -2264,28 +2325,36 @@ yyreduce:
}
yyval = yyvsp[0];
}
+#line 2329 "awkgram.c"
break;
case 33: /* func_name: lex_builtin */
+#line 511 "awkgram.y"
{
yyerror(_("`%s' is a built-in function, it cannot be
redefined"),
tokstart);
YYABORT;
}
+#line 2339 "awkgram.c"
break;
case 34: /* func_name: '@' LEX_EVAL */
+#line 517 "awkgram.y"
{
yyval = yyvsp[0];
at_seen--;
}
+#line 2348 "awkgram.c"
break;
case 37: /* $@1: %empty */
+#line 529 "awkgram.y"
{ want_param_names = FUNC_HEADER; }
+#line 2354 "awkgram.c"
break;
case 38: /* function_prologue: LEX_FUNCTION func_name '(' $@1 opt_param_list
r_paren opt_nls */
+#line 530 "awkgram.y"
{
INSTRUCTION *func_comment = NULL;
// Merge any comments found in the parameter list with those
@@ -2311,13 +2380,17 @@ yyreduce:
yyval = yyvsp[-6];
want_param_names = FUNC_BODY;
}
+#line 2384 "awkgram.c"
break;
case 39: /* $@2: %empty */
+#line 563 "awkgram.y"
{ want_regexp = true; }
+#line 2390 "awkgram.c"
break;
case 40: /* regexp: a_slash $@2 REGEXP */
+#line 565 "awkgram.y"
{
NODE *n, *exp;
char *re;
@@ -2346,9 +2419,11 @@ yyreduce:
yyval->opcode = Op_match_rec;
yyval->memory = n;
}
+#line 2423 "awkgram.c"
break;
case 41: /* typed_regexp: TYPED_REGEXP */
+#line 597 "awkgram.y"
{
char *re;
size_t len;
@@ -2361,17 +2436,23 @@ yyreduce:
yyval->opcode = Op_push_re;
yyval->memory = make_typed_regex(re, len);
}
+#line 2440 "awkgram.c"
break;
case 42: /* a_slash: '/' */
+#line 612 "awkgram.y"
{ bcfree(yyvsp[0]); }
+#line 2446 "awkgram.c"
break;
case 44: /* statements: %empty */
+#line 618 "awkgram.y"
{ yyval = NULL; }
+#line 2452 "awkgram.c"
break;
case 45: /* statements: statements statement */
+#line 620 "awkgram.y"
{
if (yyvsp[0] == NULL) {
yyval = yyvsp[-1];
@@ -2391,21 +2472,29 @@ yyreduce:
yyerrok;
}
+#line 2476 "awkgram.c"
break;
case 46: /* statements: statements error */
+#line 640 "awkgram.y"
{ yyval = NULL; }
+#line 2482 "awkgram.c"
break;
case 47: /* statement_term: nls */
+#line 644 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 2488 "awkgram.c"
break;
case 48: /* statement_term: semi opt_nls */
+#line 645 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 2494 "awkgram.c"
break;
case 49: /* statement: semi opt_nls */
+#line 650 "awkgram.y"
{
if (yyvsp[0] != NULL) {
INSTRUCTION *ip;
@@ -2416,25 +2505,31 @@ yyreduce:
} else
yyval = NULL;
}
+#line 2509 "awkgram.c"
break;
case 50: /* statement: l_brace statements r_brace */
+#line 661 "awkgram.y"
{
trailing_comment = yyvsp[0]; // NULL or comment
yyval = make_braced_statements(yyvsp[-2], yyvsp[-1], yyvsp[0]);
}
+#line 2518 "awkgram.c"
break;
case 51: /* statement: if_statement */
+#line 666 "awkgram.y"
{
if (do_pretty_print)
yyval = list_prepend(yyvsp[0],
instruction(Op_exec_count));
else
yyval = yyvsp[0];
}
+#line 2529 "awkgram.c"
break;
case 52: /* statement: LEX_SWITCH '(' exp r_paren opt_nls l_brace
case_statements opt_nls r_brace */
+#line 673 "awkgram.y"
{
INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
INSTRUCTION *ip, *nextc, *tbreak;
@@ -2542,9 +2637,11 @@ yyreduce:
break_allowed--;
fix_break_continue(ip, tbreak, NULL);
}
+#line 2641 "awkgram.c"
break;
case 53: /* statement: LEX_WHILE '(' exp r_paren opt_nls statement */
+#line 781 "awkgram.y"
{
/*
* -----------------
@@ -2595,9 +2692,11 @@ yyreduce:
continue_allowed--;
fix_break_continue(ip, tbreak, tcont);
}
+#line 2696 "awkgram.c"
break;
case 54: /* statement: LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren
opt_nls */
+#line 832 "awkgram.y"
{
/*
* -----------------
@@ -2647,9 +2746,11 @@ yyreduce:
/* else
$1 and $4 are NULLs */
}
+#line 2750 "awkgram.c"
break;
case 55: /* statement: LEX_FOR '(' NAME LEX_IN simple_variable r_paren
opt_nls statement */
+#line 882 "awkgram.y"
{
INSTRUCTION *ip;
char *var_name = yyvsp[-5]->lextok;
@@ -2775,9 +2876,11 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
+#line 2880 "awkgram.c"
break;
case 56: /* statement: LEX_FOR '(' opt_simple_stmt semi opt_nls exp semi
opt_nls opt_simple_stmt r_paren opt_nls statement */
+#line 1008 "awkgram.y"
{
if (yyvsp[-7] != NULL) {
merge_comments(yyvsp[-7], NULL);
@@ -2799,9 +2902,11 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
+#line 2906 "awkgram.c"
break;
case 57: /* statement: LEX_FOR '(' opt_simple_stmt semi opt_nls semi opt_nls
opt_simple_stmt r_paren opt_nls statement */
+#line 1030 "awkgram.y"
{
if (yyvsp[-6] != NULL) {
merge_comments(yyvsp[-6], NULL);
@@ -2822,18 +2927,22 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
+#line 2931 "awkgram.c"
break;
case 58: /* statement: non_compound_stmt */
+#line 1051 "awkgram.y"
{
if (do_pretty_print)
yyval = list_prepend(yyvsp[0],
instruction(Op_exec_count));
else
yyval = yyvsp[0];
}
+#line 2942 "awkgram.c"
break;
case 59: /* non_compound_stmt: LEX_BREAK statement_term */
+#line 1061 "awkgram.y"
{
if (! break_allowed)
error_ln(yyvsp[-1]->source_line,
@@ -2843,9 +2952,11 @@ regular_loop:
if (yyvsp[0] != NULL)
yyval = list_append(yyval, yyvsp[0]);
}
+#line 2956 "awkgram.c"
break;
case 60: /* non_compound_stmt: LEX_CONTINUE statement_term */
+#line 1071 "awkgram.y"
{
if (! continue_allowed)
error_ln(yyvsp[-1]->source_line,
@@ -2855,9 +2966,11 @@ regular_loop:
if (yyvsp[0] != NULL)
yyval = list_append(yyval, yyvsp[0]);
}
+#line 2970 "awkgram.c"
break;
case 61: /* non_compound_stmt: LEX_NEXT statement_term */
+#line 1081 "awkgram.y"
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule && rule != Rule)
@@ -2868,9 +2981,11 @@ regular_loop:
if (yyvsp[0] != NULL)
yyval = list_append(yyval, yyvsp[0]);
}
+#line 2985 "awkgram.c"
break;
case 62: /* non_compound_stmt: LEX_NEXTFILE statement_term */
+#line 1092 "awkgram.y"
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule == BEGIN || rule == END || rule == ENDFILE)
@@ -2883,9 +2998,11 @@ regular_loop:
if (yyvsp[0] != NULL)
yyval = list_append(yyval, yyvsp[0]);
}
+#line 3002 "awkgram.c"
break;
case 63: /* non_compound_stmt: LEX_EXIT opt_exp statement_term */
+#line 1105 "awkgram.y"
{
/* Initialize the two possible jump targets, the actual target
* is resolved at run-time.
@@ -2902,16 +3019,20 @@ regular_loop:
if (yyvsp[0] != NULL)
yyval = list_append(yyval, yyvsp[0]);
}
+#line 3023 "awkgram.c"
break;
case 64: /* $@3: %empty */
+#line 1122 "awkgram.y"
{
if (! in_function)
yyerror(_("`return' used outside function context"));
}
+#line 3032 "awkgram.c"
break;
case 65: /* non_compound_stmt: LEX_RETURN $@3 opt_fcall_exp statement_term
*/
+#line 1125 "awkgram.y"
{
if (called_from_eval)
yyvsp[-3]->opcode = Op_K_return_from_eval;
@@ -2925,22 +3046,28 @@ regular_loop:
if (yyvsp[0] != NULL)
yyval = list_append(yyval, yyvsp[0]);
}
+#line 3050 "awkgram.c"
break;
case 66: /* non_compound_stmt: simple_stmt statement_term */
+#line 1139 "awkgram.y"
{
if (yyvsp[0] != NULL)
yyval = list_append(yyvsp[-1], yyvsp[0]);
else
yyval = yyvsp[-1];
}
+#line 3061 "awkgram.c"
break;
case 67: /* $@4: %empty */
+#line 1156 "awkgram.y"
{ in_print = true; in_parens = 0; }
+#line 3067 "awkgram.c"
break;
case 68: /* simple_stmt: print $@4 print_expression_list output_redir */
+#line 1157 "awkgram.y"
{
/*
* Optimization: plain `print' has no expression list, so $3 is
null.
@@ -3041,13 +3168,17 @@ regular_print:
}
}
}
+#line 3172 "awkgram.c"
break;
case 69: /* $@5: %empty */
+#line 1258 "awkgram.y"
{ sub_counter = 0; }
+#line 3178 "awkgram.c"
break;
case 70: /* simple_stmt: LEX_DELETE NAME $@5 delete_subscript_list */
+#line 1259 "awkgram.y"
{
char *arr = yyvsp[-2]->lextok;
@@ -3080,9 +3211,11 @@ regular_print:
yyval = list_append(list_append(yyvsp[0], yyvsp[-2]),
yyvsp[-3]);
}
}
+#line 3215 "awkgram.c"
break;
case 71: /* simple_stmt: LEX_DELETE '(' NAME ')' */
+#line 1296 "awkgram.y"
{
static bool warned = false;
char *arr = yyvsp[-1]->lextok;
@@ -3108,40 +3241,54 @@ regular_print:
fatal(_("`delete' is not allowed with
FUNCTAB"));
}
}
+#line 3245 "awkgram.c"
break;
case 72: /* simple_stmt: exp */
+#line 1322 "awkgram.y"
{
yyval = optimize_assignment(yyvsp[0]);
}
+#line 3253 "awkgram.c"
break;
case 73: /* opt_simple_stmt: %empty */
+#line 1329 "awkgram.y"
{ yyval = NULL; }
+#line 3259 "awkgram.c"
break;
case 74: /* opt_simple_stmt: simple_stmt */
+#line 1331 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3265 "awkgram.c"
break;
case 75: /* case_statements: %empty */
+#line 1336 "awkgram.y"
{ yyval = NULL; }
+#line 3271 "awkgram.c"
break;
case 76: /* case_statements: case_statements case_statement */
+#line 1338 "awkgram.y"
{
if (yyvsp[-1] == NULL)
yyval = list_create(yyvsp[0]);
else
yyval = list_prepend(yyvsp[-1], yyvsp[0]);
}
+#line 3282 "awkgram.c"
break;
case 77: /* case_statements: case_statements error */
+#line 1345 "awkgram.y"
{ yyval = NULL; }
+#line 3288 "awkgram.c"
break;
case 78: /* case_statement: LEX_CASE case_value colon opt_nls statements */
+#line 1350 "awkgram.y"
{
INSTRUCTION *casestmt = yyvsp[0];
if (yyvsp[0] == NULL)
@@ -3154,9 +3301,11 @@ regular_print:
bcfree(yyvsp[-2]);
yyval = yyvsp[-4];
}
+#line 3305 "awkgram.c"
break;
case 79: /* case_statement: LEX_DEFAULT colon opt_nls statements */
+#line 1363 "awkgram.y"
{
INSTRUCTION *casestmt = yyvsp[0];
if (yyvsp[0] == NULL)
@@ -3168,13 +3317,17 @@ regular_print:
yyvsp[-3]->comment = yyvsp[-1];
yyval = yyvsp[-3];
}
+#line 3321 "awkgram.c"
break;
case 80: /* case_value: YNUMBER */
+#line 1378 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3327 "awkgram.c"
break;
case 81: /* case_value: '-' YNUMBER */
+#line 1380 "awkgram.y"
{
NODE *n = yyvsp[0]->memory;
(void) force_number(n);
@@ -3182,22 +3335,28 @@ regular_print:
bcfree(yyvsp[-1]);
yyval = yyvsp[0];
}
+#line 3339 "awkgram.c"
break;
case 82: /* case_value: '+' YNUMBER */
+#line 1388 "awkgram.y"
{
NODE *n = yyvsp[0]->lasti->memory;
bcfree(yyvsp[-1]);
add_sign_to_num(n, '+');
yyval = yyvsp[0];
}
+#line 3350 "awkgram.c"
break;
case 83: /* case_value: YSTRING */
+#line 1395 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3356 "awkgram.c"
break;
case 84: /* case_value: regexp */
+#line 1397 "awkgram.y"
{
if (yyvsp[0]->memory->type == Node_regex)
yyvsp[0]->opcode = Op_push_re;
@@ -3205,43 +3364,57 @@ regular_print:
yyvsp[0]->opcode = Op_push;
yyval = yyvsp[0];
}
+#line 3368 "awkgram.c"
break;
case 85: /* case_value: typed_regexp */
+#line 1405 "awkgram.y"
{
assert((yyvsp[0]->memory->flags & REGEX) == REGEX);
yyvsp[0]->opcode = Op_push_re;
yyval = yyvsp[0];
}
+#line 3378 "awkgram.c"
break;
case 86: /* print: LEX_PRINT */
+#line 1414 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3384 "awkgram.c"
break;
case 87: /* print: LEX_PRINTF */
+#line 1416 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3390 "awkgram.c"
break;
case 89: /* print_expression_list: '(' expression_list r_paren */
+#line 1426 "awkgram.y"
{
yyval = yyvsp[-1];
}
+#line 3398 "awkgram.c"
break;
case 90: /* output_redir: %empty */
+#line 1433 "awkgram.y"
{
in_print = false;
in_parens = 0;
yyval = NULL;
}
+#line 3408 "awkgram.c"
break;
case 91: /* $@6: %empty */
+#line 1438 "awkgram.y"
{ in_print = false; in_parens = 0; }
+#line 3414 "awkgram.c"
break;
case 92: /* output_redir: IO_OUT $@6 common_exp */
+#line 1439 "awkgram.y"
{
if (yyvsp[-2]->redir_type == redirect_twoway
&& yyvsp[0]->lasti->opcode == Op_K_getline_redir
@@ -3251,18 +3424,22 @@ regular_print:
lintwarn(_("concatenation as I/O `>' redirection target
is ambiguous"));
yyval = list_prepend(yyvsp[0], yyvsp[-2]);
}
+#line 3428 "awkgram.c"
break;
case 93: /* if_statement: LEX_IF '(' exp r_paren opt_nls statement */
+#line 1452 "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 3439 "awkgram.c"
break;
case 94: /* if_statement: LEX_IF '(' exp r_paren opt_nls statement LEX_ELSE
opt_nls statement */
+#line 1460 "awkgram.y"
{
if (yyvsp[-4] != NULL)
yyvsp[-8]->comment = yyvsp[-4];
@@ -3271,15 +3448,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 3452 "awkgram.c"
break;
case 95: /* nls: NEWLINE */
+#line 1472 "awkgram.y"
{
yyval = yyvsp[0];
}
+#line 3460 "awkgram.c"
break;
case 96: /* nls: nls NEWLINE */
+#line 1476 "awkgram.y"
{
if (yyvsp[-1] != NULL && yyvsp[0] != NULL) {
if (yyvsp[-1]->memory->comment_type == EOL_COMMENT) {
@@ -3297,43 +3478,59 @@ regular_print:
} else
yyval = NULL;
}
+#line 3482 "awkgram.c"
break;
case 97: /* opt_nls: %empty */
+#line 1497 "awkgram.y"
{ yyval = NULL; }
+#line 3488 "awkgram.c"
break;
case 98: /* opt_nls: nls */
+#line 1499 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3494 "awkgram.c"
break;
case 99: /* input_redir: %empty */
+#line 1504 "awkgram.y"
{ yyval = NULL; }
+#line 3500 "awkgram.c"
break;
case 100: /* input_redir: '<' simp_exp */
+#line 1506 "awkgram.y"
{
bcfree(yyvsp[-1]);
yyval = yyvsp[0];
}
+#line 3509 "awkgram.c"
break;
case 101: /* opt_param_list: %empty */
+#line 1514 "awkgram.y"
{ yyval = NULL; }
+#line 3515 "awkgram.c"
break;
case 102: /* opt_param_list: param_list */
+#line 1516 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3521 "awkgram.c"
break;
case 103: /* param_list: NAME */
+#line 1521 "awkgram.y"
{
yyvsp[0]->param_count = 0;
yyval = list_create(yyvsp[0]);
}
+#line 3530 "awkgram.c"
break;
case 104: /* param_list: param_list comma NAME */
+#line 1526 "awkgram.y"
{
if (yyvsp[-2] != NULL && yyvsp[0] != NULL) {
yyvsp[0]->param_count = yyvsp[-2]->lasti->param_count +
1;
@@ -3350,54 +3547,76 @@ regular_print:
} else
yyval = NULL;
}
+#line 3551 "awkgram.c"
break;
case 105: /* param_list: error */
+#line 1543 "awkgram.y"
{ yyval = NULL; }
+#line 3557 "awkgram.c"
break;
case 106: /* param_list: param_list error */
+#line 1545 "awkgram.y"
{ yyval = yyvsp[-1]; }
+#line 3563 "awkgram.c"
break;
case 107: /* param_list: param_list comma error */
+#line 1547 "awkgram.y"
{ yyval = yyvsp[-2]; }
+#line 3569 "awkgram.c"
break;
case 108: /* opt_exp: %empty */
+#line 1553 "awkgram.y"
{ yyval = NULL; }
+#line 3575 "awkgram.c"
break;
case 109: /* opt_exp: exp */
+#line 1555 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3581 "awkgram.c"
break;
case 110: /* opt_expression_list: %empty */
+#line 1560 "awkgram.y"
{ yyval = NULL; }
+#line 3587 "awkgram.c"
break;
case 111: /* opt_expression_list: expression_list */
+#line 1562 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3593 "awkgram.c"
break;
case 112: /* expression_list: exp */
+#line 1567 "awkgram.y"
{ yyval = mk_expression_list(NULL, yyvsp[0]); }
+#line 3599 "awkgram.c"
break;
case 113: /* expression_list: expression_list comma exp */
+#line 1569 "awkgram.y"
{
if (yyvsp[-1] != NULL)
yyvsp[-2]->lasti->comment = yyvsp[-1];
yyval = mk_expression_list(yyvsp[-2], yyvsp[0]);
yyerrok;
}
+#line 3610 "awkgram.c"
break;
case 114: /* expression_list: error */
+#line 1576 "awkgram.y"
{ yyval = NULL; }
+#line 3616 "awkgram.c"
break;
case 115: /* expression_list: expression_list error */
+#line 1578 "awkgram.y"
{
/*
* Returning the expression list instead of NULL lets
@@ -3405,50 +3624,66 @@ regular_print:
*/
yyval = yyvsp[-1];
}
+#line 3628 "awkgram.c"
break;
case 116: /* expression_list: expression_list error exp */
+#line 1586 "awkgram.y"
{
/* Ditto */
yyval = mk_expression_list(yyvsp[-2], yyvsp[0]);
}
+#line 3637 "awkgram.c"
break;
case 117: /* expression_list: expression_list comma error */
+#line 1591 "awkgram.y"
{
/* Ditto */
if (yyvsp[-1] != NULL)
yyvsp[-2]->lasti->comment = yyvsp[-1];
yyval = yyvsp[-2];
}
+#line 3648 "awkgram.c"
break;
case 118: /* opt_fcall_expression_list: %empty */
+#line 1601 "awkgram.y"
{ yyval = NULL; }
+#line 3654 "awkgram.c"
break;
case 119: /* opt_fcall_expression_list: fcall_expression_list */
+#line 1603 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3660 "awkgram.c"
break;
case 120: /* fcall_expression_list: fcall_exp */
+#line 1608 "awkgram.y"
{ yyval = mk_expression_list(NULL, yyvsp[0]); }
+#line 3666 "awkgram.c"
break;
case 121: /* fcall_expression_list: fcall_expression_list comma fcall_exp */
+#line 1610 "awkgram.y"
{
if (yyvsp[-1] != NULL)
yyvsp[-2]->lasti->comment = yyvsp[-1];
yyval = mk_expression_list(yyvsp[-2], yyvsp[0]);
yyerrok;
}
+#line 3677 "awkgram.c"
break;
case 122: /* fcall_expression_list: error */
+#line 1617 "awkgram.y"
{ yyval = NULL; }
+#line 3683 "awkgram.c"
break;
case 123: /* fcall_expression_list: fcall_expression_list error */
+#line 1619 "awkgram.y"
{
/*
* Returning the expression list instead of NULL lets
@@ -3456,64 +3691,86 @@ regular_print:
*/
yyval = yyvsp[-1];
}
+#line 3695 "awkgram.c"
break;
case 124: /* fcall_expression_list: fcall_expression_list error fcall_exp */
+#line 1627 "awkgram.y"
{
/* Ditto */
yyval = mk_expression_list(yyvsp[-2], yyvsp[0]);
}
+#line 3704 "awkgram.c"
break;
case 125: /* fcall_expression_list: fcall_expression_list comma error */
+#line 1632 "awkgram.y"
{
/* Ditto */
if (yyvsp[-1] != NULL)
yyvsp[-2]->comment = yyvsp[-1];
yyval = yyvsp[-2];
}
+#line 3715 "awkgram.c"
break;
case 126: /* fcall_exp: exp */
+#line 1641 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3721 "awkgram.c"
break;
case 127: /* fcall_exp: typed_regexp */
+#line 1642 "awkgram.y"
{ yyval = list_create(yyvsp[0]); }
+#line 3727 "awkgram.c"
break;
case 128: /* opt_fcall_exp: %empty */
+#line 1647 "awkgram.y"
{ yyval = NULL; }
+#line 3733 "awkgram.c"
break;
case 129: /* opt_fcall_exp: fcall_exp */
+#line 1648 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3739 "awkgram.c"
break;
case 130: /* exp: variable assign_operator exp */
+#line 1654 "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 3750 "awkgram.c"
break;
case 131: /* exp: variable ASSIGN typed_regexp */
+#line 1661 "awkgram.y"
{
yyval = mk_assignment(yyvsp[-2], list_create(yyvsp[0]),
yyvsp[-1]);
}
+#line 3758 "awkgram.c"
break;
case 132: /* exp: exp LEX_AND exp */
+#line 1665 "awkgram.y"
{ yyval = mk_boolean(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
+#line 3764 "awkgram.c"
break;
case 133: /* exp: exp LEX_OR exp */
+#line 1667 "awkgram.y"
{ yyval = mk_boolean(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
+#line 3770 "awkgram.c"
break;
case 134: /* exp: exp MATCHOP typed_regexp */
+#line 1669 "awkgram.y"
{
if (yyvsp[-2]->lasti->opcode == Op_match_rec)
warning_ln(yyvsp[-1]->source_line,
@@ -3526,9 +3783,11 @@ regular_print:
bcfree(yyvsp[0]);
yyval = list_append(yyvsp[-2], yyvsp[-1]);
}
+#line 3787 "awkgram.c"
break;
case 135: /* exp: exp MATCHOP exp */
+#line 1682 "awkgram.y"
{
if (yyvsp[-2]->lasti->opcode == Op_match_rec)
warning_ln(yyvsp[-1]->source_line,
@@ -3545,9 +3804,11 @@ regular_print:
yyval = list_append(list_merge(yyvsp[-2], yyvsp[0]),
yyvsp[-1]);
}
}
+#line 3808 "awkgram.c"
break;
case 136: /* exp: exp LEX_IN simple_variable */
+#line 1699 "awkgram.y"
{
if (do_lint_old)
lintwarn_ln(yyvsp[-1]->source_line,
@@ -3557,65 +3818,91 @@ regular_print:
yyvsp[-1]->expr_count = 1;
yyval = list_append(list_merge(yyvsp[-2], yyvsp[0]), yyvsp[-1]);
}
+#line 3822 "awkgram.c"
break;
case 137: /* exp: exp a_relop exp */
+#line 1709 "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 3833 "awkgram.c"
break;
case 138: /* exp: exp '?' exp ':' exp */
+#line 1716 "awkgram.y"
{ yyval = mk_condition(yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1],
yyvsp[0]); }
+#line 3839 "awkgram.c"
break;
case 139: /* exp: common_exp */
+#line 1718 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3845 "awkgram.c"
break;
case 140: /* assign_operator: ASSIGN */
+#line 1723 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3851 "awkgram.c"
break;
case 141: /* assign_operator: ASSIGNOP */
+#line 1725 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3857 "awkgram.c"
break;
case 142: /* assign_operator: SLASH_BEFORE_EQUAL ASSIGN */
+#line 1727 "awkgram.y"
{
yyvsp[0]->opcode = Op_assign_quotient;
yyval = yyvsp[0];
}
+#line 3866 "awkgram.c"
break;
case 143: /* relop_or_less: RELOP */
+#line 1735 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3872 "awkgram.c"
break;
case 144: /* relop_or_less: '<' */
+#line 1737 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3878 "awkgram.c"
break;
case 145: /* a_relop: relop_or_less */
+#line 1742 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3884 "awkgram.c"
break;
case 146: /* a_relop: '>' */
+#line 1744 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3890 "awkgram.c"
break;
case 147: /* common_exp: simp_exp */
+#line 1749 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3896 "awkgram.c"
break;
case 148: /* common_exp: simp_exp_nc */
+#line 1751 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 3902 "awkgram.c"
break;
case 149: /* common_exp: common_exp simp_exp */
+#line 1753 "awkgram.y"
{
int count = 2;
bool is_simple_var = false;
@@ -3669,33 +3956,47 @@ regular_print:
max_args = count;
}
}
+#line 3960 "awkgram.c"
break;
case 151: /* simp_exp: simp_exp '^' simp_exp */
+#line 1812 "awkgram.y"
{ yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
+#line 3966 "awkgram.c"
break;
case 152: /* simp_exp: simp_exp '*' simp_exp */
+#line 1814 "awkgram.y"
{ yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
+#line 3972 "awkgram.c"
break;
case 153: /* simp_exp: simp_exp '/' simp_exp */
+#line 1816 "awkgram.y"
{ yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
+#line 3978 "awkgram.c"
break;
case 154: /* simp_exp: simp_exp '%' simp_exp */
+#line 1818 "awkgram.y"
{ yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
+#line 3984 "awkgram.c"
break;
case 155: /* simp_exp: simp_exp '+' simp_exp */
+#line 1820 "awkgram.y"
{ yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
+#line 3990 "awkgram.c"
break;
case 156: /* simp_exp: simp_exp '-' simp_exp */
+#line 1822 "awkgram.y"
{ yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
+#line 3996 "awkgram.c"
break;
case 157: /* simp_exp: LEX_GETLINE opt_variable input_redir */
+#line 1824 "awkgram.y"
{
/*
* In BEGINFILE/ENDFILE, allow `getline [var] < file'
@@ -3709,23 +4010,29 @@ regular_print:
_("non-redirected `getline' undefined inside
END action"));
yyval = mk_getline(yyvsp[-2], yyvsp[-1], yyvsp[0],
redirect_input);
}
+#line 4014 "awkgram.c"
break;
case 158: /* simp_exp: variable INCREMENT */
+#line 1838 "awkgram.y"
{
yyvsp[0]->opcode = Op_postincrement;
yyval = mk_assignment(yyvsp[-1], NULL, yyvsp[0]);
}
+#line 4023 "awkgram.c"
break;
case 159: /* simp_exp: variable DECREMENT */
+#line 1843 "awkgram.y"
{
yyvsp[0]->opcode = Op_postdecrement;
yyval = mk_assignment(yyvsp[-1], NULL, yyvsp[0]);
}
+#line 4032 "awkgram.c"
break;
case 160: /* simp_exp: '(' expression_list r_paren LEX_IN simple_variable */
+#line 1848 "awkgram.y"
{
if (do_lint_old) {
/* first one is warning so that second one comes out if
warnings are fatal */
@@ -3746,46 +4053,64 @@ regular_print:
yyval = list_append(list_merge(t, yyvsp[0]), yyvsp[-1]);
}
}
+#line 4057 "awkgram.c"
break;
case 161: /* simp_exp_nc: common_exp IO_IN LEX_GETLINE opt_variable */
+#line 1874 "awkgram.y"
{
yyval = mk_getline(yyvsp[-1], yyvsp[0], yyvsp[-3],
yyvsp[-2]->redir_type);
bcfree(yyvsp[-2]);
}
+#line 4066 "awkgram.c"
break;
case 162: /* simp_exp_nc: simp_exp_nc '^' simp_exp */
+#line 1880 "awkgram.y"
{ yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
+#line 4072 "awkgram.c"
break;
case 163: /* simp_exp_nc: simp_exp_nc '*' simp_exp */
+#line 1882 "awkgram.y"
{ yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
+#line 4078 "awkgram.c"
break;
case 164: /* simp_exp_nc: simp_exp_nc '/' simp_exp */
+#line 1884 "awkgram.y"
{ yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
+#line 4084 "awkgram.c"
break;
case 165: /* simp_exp_nc: simp_exp_nc '%' simp_exp */
+#line 1886 "awkgram.y"
{ yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
+#line 4090 "awkgram.c"
break;
case 166: /* simp_exp_nc: simp_exp_nc '+' simp_exp */
+#line 1888 "awkgram.y"
{ yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
+#line 4096 "awkgram.c"
break;
case 167: /* simp_exp_nc: simp_exp_nc '-' simp_exp */
+#line 1890 "awkgram.y"
{ yyval = mk_binary(yyvsp[-2], yyvsp[0], yyvsp[-1]); }
+#line 4102 "awkgram.c"
break;
case 168: /* non_post_simp_exp: regexp */
+#line 1895 "awkgram.y"
{
yyval = list_create(yyvsp[0]);
}
+#line 4110 "awkgram.c"
break;
case 169: /* non_post_simp_exp: '!' simp_exp */
+#line 1899 "awkgram.y"
{
if (yyvsp[0]->opcode == Op_match_rec) {
yyvsp[0]->opcode = Op_nomatch;
@@ -3817,9 +4142,11 @@ regular_print:
}
}
}
+#line 4146 "awkgram.c"
break;
case 170: /* non_post_simp_exp: '(' exp r_paren */
+#line 1931 "awkgram.y"
{
// Always include. Allows us to lint warn on
// print "foo" > "bar" 1
@@ -3827,25 +4154,31 @@ regular_print:
// print "foo" > ("bar" 1)
yyval = list_append(yyvsp[-1], bcalloc(Op_parens, 1,
sourceline));
}
+#line 4158 "awkgram.c"
break;
case 171: /* non_post_simp_exp: LEX_BUILTIN '(' opt_fcall_expression_list
r_paren */
+#line 1939 "awkgram.y"
{
yyval = snode(yyvsp[-1], yyvsp[-3]);
if (yyval == NULL)
YYABORT;
}
+#line 4168 "awkgram.c"
break;
case 172: /* non_post_simp_exp: LEX_LENGTH '(' opt_fcall_expression_list
r_paren */
+#line 1945 "awkgram.y"
{
yyval = snode(yyvsp[-1], yyvsp[-3]);
if (yyval == NULL)
YYABORT;
}
+#line 4178 "awkgram.c"
break;
case 173: /* non_post_simp_exp: LEX_LENGTH */
+#line 1951 "awkgram.y"
{
static bool warned = false;
@@ -3858,35 +4191,45 @@ regular_print:
if (yyval == NULL)
YYABORT;
}
+#line 4195 "awkgram.c"
break;
case 176: /* non_post_simp_exp: INCREMENT variable */
+#line 1966 "awkgram.y"
{
yyvsp[-1]->opcode = Op_preincrement;
yyval = mk_assignment(yyvsp[0], NULL, yyvsp[-1]);
}
+#line 4204 "awkgram.c"
break;
case 177: /* non_post_simp_exp: DECREMENT variable */
+#line 1971 "awkgram.y"
{
yyvsp[-1]->opcode = Op_predecrement;
yyval = mk_assignment(yyvsp[0], NULL, yyvsp[-1]);
}
+#line 4213 "awkgram.c"
break;
case 178: /* non_post_simp_exp: YNUMBER */
+#line 1976 "awkgram.y"
{
yyval = list_create(yyvsp[0]);
}
+#line 4221 "awkgram.c"
break;
case 179: /* non_post_simp_exp: YSTRING */
+#line 1980 "awkgram.y"
{
yyval = list_create(yyvsp[0]);
}
+#line 4229 "awkgram.c"
break;
case 180: /* non_post_simp_exp: '-' simp_exp */
+#line 1984 "awkgram.y"
{
if (yyvsp[0]->lasti->opcode == Op_push_i
&& (yyvsp[0]->lasti->memory->flags & STRING) == 0
@@ -3901,9 +4244,11 @@ regular_print:
yyval = list_append(yyvsp[0], yyvsp[-1]);
}
}
+#line 4248 "awkgram.c"
break;
case 181: /* non_post_simp_exp: '+' simp_exp */
+#line 1999 "awkgram.y"
{
if (yyvsp[0]->lasti->opcode == Op_push_i
&& (yyvsp[0]->lasti->memory->flags & STRING) == 0
@@ -3921,16 +4266,20 @@ regular_print:
yyval = list_append(yyvsp[0], yyvsp[-1]);
}
}
+#line 4270 "awkgram.c"
break;
case 182: /* func_call: direct_func_call */
+#line 2020 "awkgram.y"
{
func_use(yyvsp[0]->lasti->func_name, FUNC_USE);
yyval = yyvsp[0];
}
+#line 4279 "awkgram.c"
break;
case 183: /* func_call: '@' direct_func_call */
+#line 2025 "awkgram.y"
{
/* indirect function call */
INSTRUCTION *f, *t;
@@ -3964,9 +4313,11 @@ regular_print:
yyval = list_prepend(yyvsp[0], t);
at_seen--;
}
+#line 4317 "awkgram.c"
break;
case 184: /* direct_func_call: FUNC_CALL '(' opt_fcall_expression_list
r_paren */
+#line 2062 "awkgram.y"
{
NODE *n;
char *name = yyvsp[-3]->func_name;
@@ -3999,35 +4350,49 @@ regular_print:
yyval = list_append(t, yyvsp[-3]);
}
}
+#line 4354 "awkgram.c"
break;
case 185: /* opt_variable: %empty */
+#line 2098 "awkgram.y"
{ yyval = NULL; }
+#line 4360 "awkgram.c"
break;
case 186: /* opt_variable: variable */
+#line 2100 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 4366 "awkgram.c"
break;
case 187: /* delete_subscript_list: %empty */
+#line 2105 "awkgram.y"
{ yyval = NULL; }
+#line 4372 "awkgram.c"
break;
case 188: /* delete_subscript_list: delete_subscript SUBSCRIPT */
+#line 2107 "awkgram.y"
{ yyval = yyvsp[-1]; }
+#line 4378 "awkgram.c"
break;
case 189: /* delete_subscript: delete_exp_list */
+#line 2112 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 4384 "awkgram.c"
break;
case 190: /* delete_subscript: delete_subscript delete_exp_list */
+#line 2114 "awkgram.y"
{
yyval = list_merge(yyvsp[-1], yyvsp[0]);
}
+#line 4392 "awkgram.c"
break;
case 191: /* delete_exp_list: bracketed_exp_list */
+#line 2121 "awkgram.y"
{
INSTRUCTION *ip = yyvsp[0]->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated
expressions */
@@ -4041,9 +4406,11 @@ regular_print:
sub_counter++; /* count # of dimensions */
yyval = yyvsp[0];
}
+#line 4410 "awkgram.c"
break;
case 192: /* bracketed_exp_list: '[' expression_list ']' */
+#line 2138 "awkgram.y"
{
INSTRUCTION *t = yyvsp[-1];
if (yyvsp[-1] == NULL) {
@@ -4057,31 +4424,41 @@ regular_print:
yyvsp[0]->sub_count = count_expressions(&t, false);
yyval = list_append(t, yyvsp[0]);
}
+#line 4428 "awkgram.c"
break;
case 193: /* subscript: bracketed_exp_list */
+#line 2155 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 4434 "awkgram.c"
break;
case 194: /* subscript: subscript bracketed_exp_list */
+#line 2157 "awkgram.y"
{
yyval = list_merge(yyvsp[-1], yyvsp[0]);
}
+#line 4442 "awkgram.c"
break;
case 195: /* subscript_list: subscript SUBSCRIPT */
+#line 2164 "awkgram.y"
{ yyval = yyvsp[-1]; }
+#line 4448 "awkgram.c"
break;
case 196: /* simple_variable: NAME */
+#line 2169 "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 4458 "awkgram.c"
break;
case 197: /* simple_variable: NAME subscript_list */
+#line 2175 "awkgram.y"
{
char *arr = yyvsp[-1]->lextok;
@@ -4090,9 +4467,11 @@ regular_print:
yyvsp[-1]->opcode = Op_push_array;
yyval = list_prepend(yyvsp[0], yyvsp[-1]);
}
+#line 4471 "awkgram.c"
break;
case 198: /* variable: simple_variable */
+#line 2187 "awkgram.y"
{
INSTRUCTION *ip = yyvsp[0]->nexti;
if (ip->opcode == Op_push
@@ -4104,61 +4483,85 @@ regular_print:
} else
yyval = yyvsp[0];
}
+#line 4487 "awkgram.c"
break;
case 199: /* variable: '$' non_post_simp_exp opt_incdec */
+#line 2199 "awkgram.y"
{
yyval = list_append(yyvsp[-1], yyvsp[-2]);
if (yyvsp[0] != NULL)
mk_assignment(yyvsp[-1], NULL, yyvsp[0]);
}
+#line 4497 "awkgram.c"
break;
case 200: /* opt_incdec: INCREMENT */
+#line 2208 "awkgram.y"
{
yyvsp[0]->opcode = Op_postincrement;
}
+#line 4505 "awkgram.c"
break;
case 201: /* opt_incdec: DECREMENT */
+#line 2212 "awkgram.y"
{
yyvsp[0]->opcode = Op_postdecrement;
}
+#line 4513 "awkgram.c"
break;
case 202: /* opt_incdec: %empty */
+#line 2216 "awkgram.y"
{ yyval = NULL; }
+#line 4519 "awkgram.c"
break;
case 203: /* l_brace: '{' opt_nls */
+#line 2220 "awkgram.y"
{ yyval = yyvsp[0]; }
+#line 4525 "awkgram.c"
break;
case 204: /* r_brace: '}' opt_nls */
+#line 2224 "awkgram.y"
{ yyval = yyvsp[0]; yyerrok; }
+#line 4531 "awkgram.c"
break;
case 205: /* r_paren: ')' */
+#line 2228 "awkgram.y"
{ yyerrok; }
+#line 4537 "awkgram.c"
break;
case 206: /* opt_semi: %empty */
+#line 2233 "awkgram.y"
{ yyval = NULL; }
+#line 4543 "awkgram.c"
break;
case 208: /* semi: ';' */
+#line 2238 "awkgram.y"
{ yyerrok; }
+#line 4549 "awkgram.c"
break;
case 209: /* colon: ':' */
+#line 2242 "awkgram.y"
{ yyval = yyvsp[0]; yyerrok; }
+#line 4555 "awkgram.c"
break;
case 210: /* comma: ',' opt_nls */
+#line 2246 "awkgram.y"
{ yyval = yyvsp[0]; yyerrok; }
+#line 4561 "awkgram.c"
break;
+#line 4565 "awkgram.c"
default: break;
}
@@ -4351,6 +4754,7 @@ yyreturnlab:
return yyresult;
}
+#line 2248 "awkgram.y"
struct token {
@@ -4453,7 +4857,7 @@ static const struct token tokentab[] = {
{"namespace", Op_symbol, LEX_NAMESPACE, GAWKX, 0,
0},
{"next", Op_K_next, LEX_NEXT, 0, 0, 0},
{"nextfile", Op_K_nextfile, LEX_NEXTFILE, 0, 0, 0},
-{"ns_include", Op_symbol, LEX_NS_INCLUDE, GAWKX, 0, 0},
+{"nsinclude", Op_symbol, LEX_NSINCLUDE, GAWKX, 0, 0},
{"or", Op_builtin, LEX_BUILTIN, GAWKX, do_or,
MPF(or)},
{"patsplit", Op_builtin, LEX_BUILTIN, GAWKX|A(2)|A(3)|A(4),
do_patsplit, 0},
{"print", Op_K_print, LEX_PRINT, 0, 0, 0},
@@ -4588,7 +4992,7 @@ print_included_from()
saveline = sourceline;
sourceline = 0;
- for (s = sourcefile; s != NULL && (s->stype == SRC_INC || s->stype ==
SRC_NS_INC); ) {
+ for (s = sourcefile; s != NULL && (s->stype == SRC_INC || s->stype ==
SRC_NSINC); ) {
s = s->next;
if (s == NULL || s->fd <= INVALID_HANDLE)
continue;
@@ -4600,7 +5004,7 @@ print_included_from()
msg("%s %s:%d%c",
s->prev == sourcefile ? "In file included from"
: " from",
- (s->stype == SRC_INC || s->stype == SRC_NS_INC ||
+ (s->stype == SRC_INC || s->stype == SRC_NSINC ||
s->stype == SRC_FILE) ? s->src : "cmd. line",
line,
s->stype != SRC_FILE ? ',' : ':'
@@ -5005,7 +5409,7 @@ add_srcfile(enum srctype stype, char *src, SRCFILE
*thisfile, bool *already_incl
/* N.B. We do not eliminate duplicate SRC_FILE (-f) programs. */
for (s = srcfiles->next; s != srcfiles; s = s->next) {
- if ((s->stype == SRC_FILE || s->stype == SRC_INC || s->stype ==
SRC_NS_INC || s->stype == SRC_EXTLIB) && files_are_same(path, s)) {
+ if ((s->stype == SRC_FILE || s->stype == SRC_INC || s->stype ==
SRC_NSINC || s->stype == SRC_EXTLIB) && files_are_same(path, s)) {
if (stype == SRC_INC || stype == SRC_EXTLIB) {
/* eliminate duplicates */
if ((stype == SRC_INC) && (s->stype ==
SRC_FILE))
@@ -5070,7 +5474,7 @@ include_source(INSTRUCTION *file, void **srcfile_p)
return true;
}
- s = add_srcfile(include_use_current_namespace ? SRC_NS_INC : SRC_INC,
+ s = add_srcfile(include_use_current_namespace ? SRC_NSINC : SRC_INC,
src, sourcefile, &already_included, &errcode);
if (s == NULL) {
if (already_included)
@@ -6491,9 +6895,7 @@ retry:
int class = tokentab[mid].class;
switch (class) {
- case LEX_NS_INCLUDE:
- include_use_current_namespace = true;
- // fall through
+ case LEX_NSINCLUDE:
case LEX_EVAL:
case LEX_INCLUDE:
case LEX_LOAD:
@@ -6557,12 +6959,15 @@ retry:
continue_allowed++;
switch (class) {
+ case LEX_NSINCLUDE:
+ include_use_current_namespace = true;
+ goto make_at_token; // can't fall through
case LEX_NAMESPACE:
want_namespace = true;
// fall through
case LEX_INCLUDE:
- case LEX_NS_INCLUDE:
case LEX_LOAD:
+ make_at_token:
want_source = true;
break;
case LEX_EVAL:
diff --git a/awkgram.y b/awkgram.y
index bbf4ab74..0e7e8f58 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -192,7 +192,6 @@ extern double fmod(double x, double y);
#define YYSTYPE INSTRUCTION *
%}
-%no-lines
%token FUNC_CALL NAME REGEXP FILENAME
%token YNUMBER YSTRING TYPED_REGEXP
@@ -208,7 +207,7 @@ extern double fmod(double x, double y);
%token LEX_AND LEX_OR INCREMENT DECREMENT
%token LEX_BUILTIN LEX_LENGTH
%token LEX_EOF
-%token LEX_INCLUDE LEX_EVAL LEX_LOAD LEX_NAMESPACE LEX_NS_INCLUDE
+%token LEX_INCLUDE LEX_EVAL LEX_LOAD LEX_NAMESPACE LEX_NSINCLUDE
%token NEWLINE
/* Lowest to highest */
@@ -310,7 +309,7 @@ rule
}
yyerrok;
}
- | '@' LEX_NS_INCLUDE source statement_term
+ | '@' LEX_NSINCLUDE source statement_term
{
want_source = false;
at_seen--;
@@ -2348,7 +2347,7 @@ static const struct token tokentab[] = {
{"namespace", Op_symbol, LEX_NAMESPACE, GAWKX, 0,
0},
{"next", Op_K_next, LEX_NEXT, 0, 0, 0},
{"nextfile", Op_K_nextfile, LEX_NEXTFILE, 0, 0, 0},
-{"ns_include", Op_symbol, LEX_NS_INCLUDE, GAWKX, 0, 0},
+{"nsinclude", Op_symbol, LEX_NSINCLUDE, GAWKX, 0, 0},
{"or", Op_builtin, LEX_BUILTIN, GAWKX, do_or,
MPF(or)},
{"patsplit", Op_builtin, LEX_BUILTIN, GAWKX|A(2)|A(3)|A(4),
do_patsplit, 0},
{"print", Op_K_print, LEX_PRINT, 0, 0, 0},
@@ -2483,7 +2482,7 @@ print_included_from()
saveline = sourceline;
sourceline = 0;
- for (s = sourcefile; s != NULL && (s->stype == SRC_INC || s->stype ==
SRC_NS_INC); ) {
+ for (s = sourcefile; s != NULL && (s->stype == SRC_INC || s->stype ==
SRC_NSINC); ) {
s = s->next;
if (s == NULL || s->fd <= INVALID_HANDLE)
continue;
@@ -2495,7 +2494,7 @@ print_included_from()
msg("%s %s:%d%c",
s->prev == sourcefile ? "In file included from"
: " from",
- (s->stype == SRC_INC || s->stype == SRC_NS_INC ||
+ (s->stype == SRC_INC || s->stype == SRC_NSINC ||
s->stype == SRC_FILE) ? s->src : "cmd. line",
line,
s->stype != SRC_FILE ? ',' : ':'
@@ -2900,7 +2899,7 @@ add_srcfile(enum srctype stype, char *src, SRCFILE
*thisfile, bool *already_incl
/* N.B. We do not eliminate duplicate SRC_FILE (-f) programs. */
for (s = srcfiles->next; s != srcfiles; s = s->next) {
- if ((s->stype == SRC_FILE || s->stype == SRC_INC || s->stype ==
SRC_NS_INC || s->stype == SRC_EXTLIB) && files_are_same(path, s)) {
+ if ((s->stype == SRC_FILE || s->stype == SRC_INC || s->stype ==
SRC_NSINC || s->stype == SRC_EXTLIB) && files_are_same(path, s)) {
if (stype == SRC_INC || stype == SRC_EXTLIB) {
/* eliminate duplicates */
if ((stype == SRC_INC) && (s->stype ==
SRC_FILE))
@@ -2965,7 +2964,7 @@ include_source(INSTRUCTION *file, void **srcfile_p)
return true;
}
- s = add_srcfile(include_use_current_namespace ? SRC_NS_INC : SRC_INC,
+ s = add_srcfile(include_use_current_namespace ? SRC_NSINC : SRC_INC,
src, sourcefile, &already_included, &errcode);
if (s == NULL) {
if (already_included)
@@ -4386,9 +4385,7 @@ retry:
int class = tokentab[mid].class;
switch (class) {
- case LEX_NS_INCLUDE:
- include_use_current_namespace = true;
- // fall through
+ case LEX_NSINCLUDE:
case LEX_EVAL:
case LEX_INCLUDE:
case LEX_LOAD:
@@ -4452,12 +4449,15 @@ retry:
continue_allowed++;
switch (class) {
+ case LEX_NSINCLUDE:
+ include_use_current_namespace = true;
+ goto make_at_token; // can't fall through
case LEX_NAMESPACE:
want_namespace = true;
// fall through
case LEX_INCLUDE:
- case LEX_NS_INCLUDE:
case LEX_LOAD:
+ make_at_token:
want_source = true;
break;
case LEX_EVAL:
diff --git a/command.c b/command.c
index 1d4588ce..a3993e2d 100644
--- a/command.c
+++ b/command.c
@@ -74,6 +74,7 @@
#define yychar zzchar
/* First part of user prologue. */
+#line 28 "command.y"
#include "awk.h"
#include "cmd.h"
@@ -141,6 +142,7 @@ static void append_cmdarg(CMDARG *arg);
static int find_argument(CMDARG *arg);
#define YYSTYPE CMDARG *
+#line 146 "command.c"
# ifndef YY_CAST
# ifdef __cplusplus
@@ -805,22 +807,22 @@ static const yytype_int8 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_int16 yyrline[] =
{
- 0, 111, 111, 112, 130, 131, 181, 188, 189, 190,
- 191, 192, 196, 197, 198, 199, 203, 204, 205, 206,
- 210, 211, 216, 220, 240, 247, 247, 254, 270, 284,
- 285, 286, 287, 288, 289, 295, 307, 308, 309, 309,
- 310, 310, 311, 312, 313, 314, 315, 315, 316, 317,
- 317, 318, 318, 319, 319, 320, 321, 322, 327, 332,
- 358, 368, 373, 385, 385, 393, 407, 420, 421, 427,
- 428, 432, 433, 434, 435, 441, 442, 443, 448, 459,
- 460, 465, 473, 490, 491, 492, 493, 494, 499, 500,
- 500, 501, 502, 502, 503, 508, 509, 514, 515, 520,
- 521, 525, 526, 530, 531, 546, 547, 552, 560, 561,
- 562, 563, 567, 568, 572, 573, 574, 579, 580, 582,
- 589, 590, 591, 592, 593, 594, 598, 611, 612, 613,
- 617, 618, 619, 620, 624, 626, 628, 632, 647, 651,
- 653, 658, 659, 668, 678, 680, 687, 700, 701, 707,
- 708, 713, 719, 728, 730, 732, 740
+ 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
@@ -1535,6 +1537,7 @@ yyreduce:
switch (yyn)
{
case 3: /* input: input line */
+#line 112 "command.y"
{
cmd_idx = -1;
want_nodeval = false;
@@ -1549,9 +1552,11 @@ yyreduce:
arg_list = NULL;
}
}
+#line 1556 "command.c"
break;
case 5: /* line: command nls */
+#line 131 "command.y"
{
if (dbg_errcount == 0 && cmd_idx >= 0) {
Func_cmd cmdfunc;
@@ -1601,19 +1606,25 @@ yyreduce:
YYACCEPT;
}
}
+#line 1610 "command.c"
break;
case 6: /* line: error nls */
+#line 181 "command.y"
{
yyerrok;
}
+#line 1618 "command.c"
break;
case 22: /* set_want_nodeval: %empty */
+#line 215 "command.y"
{ want_nodeval = true; }
+#line 1624 "command.c"
break;
case 23: /* eval_prologue: D_EVAL set_want_nodeval opt_param_list nls */
+#line 220 "command.y"
{
if (dbg_errcount == 0) {
/* don't free arg_list; passed on to statement_list
@@ -1629,9 +1640,11 @@ yyreduce:
in_eval = true;
}
}
+#line 1644 "command.c"
break;
case 24: /* statement_list: %empty */
+#line 239 "command.y"
{
yyval = append_statement(arg_list, (char *) start_EVAL);
if (read_a_line == read_commands_string) /*
unserializing 'eval' in 'commands' */
@@ -1639,19 +1652,25 @@ yyreduce:
free_cmdarg(arg_list);
arg_list = NULL;
}
+#line 1656 "command.c"
break;
case 25: /* @1: %empty */
+#line 246 "command.y"
{ yyval = append_statement(yyvsp[-1],
lexptr_begin); }
+#line 1662 "command.c"
break;
case 26: /* statement_list: statement_list D_STATEMENT @1 nls */
+#line 247 "command.y"
{
yyval = yyvsp[-1];
}
+#line 1670 "command.c"
break;
case 27: /* eval_cmd: eval_prologue statement_list D_END */
+#line 254 "command.y"
{
arg_list = append_statement(yyvsp[-1], (char *) end_EVAL);
if (read_a_line == read_commands_string) { /*
unserializing 'eval' in 'commands' */
@@ -1667,9 +1686,11 @@ yyreduce:
cmd_idx = find_command("eval", 4);
in_eval = false;
}
+#line 1690 "command.c"
break;
case 28: /* eval_cmd: D_EVAL set_want_nodeval string_node */
+#line 270 "command.y"
{
NODE *n;
CMDARG *arg;
@@ -1680,17 +1701,21 @@ yyreduce:
free_cmdarg(arg_list);
arg_list = arg;
}
+#line 1705 "command.c"
break;
case 34: /* command: frame_cmd opt_integer */
+#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 1715 "command.c"
break;
case 35: /* command: D_INFO D_STRING */
+#line 295 "command.y"
{
int idx = find_argument(yyvsp[0]);
if (idx < 0)
@@ -1702,47 +1727,65 @@ yyreduce:
yyvsp[0]->a_argument = argtab[idx].value;
}
}
+#line 1731 "command.c"
break;
case 38: /* $@2: %empty */
+#line 308 "command.y"
{ want_nodeval = true; }
+#line 1737 "command.c"
break;
case 40: /* $@3: %empty */
+#line 309 "command.y"
{ want_nodeval = true; }
+#line 1743 "command.c"
break;
case 46: /* $@4: %empty */
+#line 314 "command.y"
{ want_nodeval = true; }
+#line 1749 "command.c"
break;
case 49: /* $@5: %empty */
+#line 316 "command.y"
{ want_nodeval = true; }
+#line 1755 "command.c"
break;
case 51: /* $@6: %empty */
+#line 317 "command.y"
{ want_nodeval = true; }
+#line 1761 "command.c"
break;
case 53: /* $@7: %empty */
+#line 318 "command.y"
{ want_nodeval = true; }
+#line 1767 "command.c"
break;
case 57: /* command: D_SOURCE D_STRING */
+#line 322 "command.y"
{
if (in_cmd_src(yyvsp[0]->a_string))
yyerror(_("source: `%s': already sourced"),
yyvsp[0]->a_string);
}
+#line 1776 "command.c"
break;
case 58: /* command: D_SAVE D_STRING */
+#line 327 "command.y"
{
if (! input_from_tty)
yyerror(_("save: `%s': command not permitted"),
yyvsp[0]->a_string);
}
+#line 1785 "command.c"
break;
case 59: /* command: D_COMMANDS commands_arg */
+#line 332 "command.y"
{
int type = 0;
int num;
@@ -1768,9 +1811,11 @@ yyreduce:
}
}
}
+#line 1815 "command.c"
break;
case 60: /* command: D_END */
+#line 358 "command.y"
{
if (! in_commands)
yyerror(_("`end' valid only in command `commands' or
`eval'"));
@@ -1780,16 +1825,20 @@ yyreduce:
in_commands = false;
}
}
+#line 1829 "command.c"
break;
case 61: /* command: D_SILENT */
+#line 368 "command.y"
{
if (! in_commands)
yyerror(_("`silent' valid only in command `commands'"));
}
+#line 1838 "command.c"
break;
case 62: /* command: D_TRACE D_STRING */
+#line 373 "command.y"
{
int idx = find_argument(yyvsp[0]);
if (idx < 0)
@@ -1801,13 +1850,17 @@ yyreduce:
yyvsp[0]->a_argument = argtab[idx].value;
}
}
+#line 1854 "command.c"
break;
case 63: /* $@8: %empty */
+#line 384 "command.y"
{ want_nodeval = true; }
+#line 1860 "command.c"
break;
case 64: /* command: D_CONDITION plus_integer $@8 condition_exp */
+#line 385 "command.y"
{
int type;
int num = yyvsp[-2]->a_int;
@@ -1815,9 +1868,11 @@ yyreduce:
if (! type)
yyerror(_("condition: invalid breakpoint/watchpoint
number"));
}
+#line 1872 "command.c"
break;
case 65: /* command: eval_cmd */
+#line 393 "command.y"
{
if (in_commands) {
/* Prepend command 'eval' to argument list */
@@ -1828,9 +1883,11 @@ yyreduce:
arg_list = arg;
}
}
+#line 1887 "command.c"
break;
case 66: /* condition_exp: opt_string_node */
+#line 407 "command.y"
{
if (yyvsp[0] != NULL) {
NODE *n = yyvsp[0]->a_node;
@@ -1840,56 +1897,76 @@ yyreduce:
}
yyval = yyvsp[0];
}
+#line 1901 "command.c"
break;
case 68: /* commands_arg: error */
+#line 421 "command.y"
{ yyval = NULL; }
+#line 1907 "command.c"
break;
case 69: /* opt_param_list: %empty */
+#line 426 "command.y"
{ yyval = NULL; }
+#line 1913 "command.c"
break;
case 74: /* param_list: error */
+#line 435 "command.y"
{ yyval = NULL; }
+#line 1919 "command.c"
break;
case 75: /* opt_string_node: %empty */
+#line 440 "command.y"
{ yyval = NULL; }
+#line 1925 "command.c"
break;
case 77: /* opt_string_node: error */
+#line 443 "command.y"
{ yyval = NULL; }
+#line 1931 "command.c"
break;
case 78: /* string_node: D_NODE */
+#line 448 "command.y"
{
NODE *n;
n = yyvsp[0]->a_node;
if ((n->flags & STRING) == 0)
yyerror(_("argument not a string"));
}
+#line 1942 "command.c"
break;
case 79: /* option_args: %empty */
+#line 458 "command.y"
{ yyval = NULL; }
+#line 1948 "command.c"
break;
case 80: /* option_args: D_STRING */
+#line 460 "command.y"
{
if (find_option(yyvsp[0]->a_string) < 0)
yyerror(_("option: invalid parameter - `%s'"),
yyvsp[0]->a_string);
}
+#line 1957 "command.c"
break;
case 81: /* option_args: D_STRING '=' D_STRING */
+#line 465 "command.y"
{
if (find_option(yyvsp[-2]->a_string) < 0)
yyerror(_("option: invalid parameter - `%s'"),
yyvsp[-2]->a_string);
}
+#line 1966 "command.c"
break;
case 82: /* func_name: D_STRING */
+#line 473 "command.y"
{
NODE *n;
n = lookup(yyvsp[0]->a_string);
@@ -1902,37 +1979,53 @@ yyreduce:
yyvsp[0]->a_node = n;
}
}
+#line 1983 "command.c"
break;
case 83: /* location: %empty */
+#line 489 "command.y"
{ yyval = NULL; }
+#line 1989 "command.c"
break;
case 88: /* break_args: %empty */
+#line 498 "command.y"
{ yyval = NULL; }
+#line 1995 "command.c"
break;
case 89: /* $@9: %empty */
+#line 499 "command.y"
{ want_nodeval = true; }
+#line 2001 "command.c"
break;
case 92: /* $@10: %empty */
+#line 501 "command.y"
{ want_nodeval = true; }
+#line 2007 "command.c"
break;
case 95: /* opt_variable: %empty */
+#line 507 "command.y"
{ yyval = NULL; }
+#line 2013 "command.c"
break;
case 97: /* opt_string: %empty */
+#line 513 "command.y"
{ yyval = NULL; }
+#line 2019 "command.c"
break;
case 99: /* opt_node: %empty */
+#line 519 "command.y"
{ yyval = NULL; }
+#line 2025 "command.c"
break;
case 104: /* enable_args: D_STRING opt_integer_list */
+#line 531 "command.y"
{
int idx = find_argument(yyvsp[-1]);
if (idx < 0)
@@ -1944,40 +2037,52 @@ yyreduce:
yyvsp[-1]->a_argument = argtab[idx].value;
}
}
+#line 2041 "command.c"
break;
case 106: /* print_exp: '@' D_VARIABLE */
+#line 547 "command.y"
{
yyvsp[0]->type = D_array; /* dump all items */
yyvsp[0]->a_count = 0;
}
+#line 2050 "command.c"
break;
case 107: /* print_exp: '@' D_VARIABLE subscript_list */
+#line 552 "command.y"
{
yyvsp[-1]->type = D_array;
yyvsp[-1]->a_count = num_dim;
}
+#line 2059 "command.c"
break;
case 117: /* list_args: %empty */
+#line 578 "command.y"
{ yyval = NULL; }
+#line 2065 "command.c"
break;
case 118: /* list_args: '+' */
+#line 580 "command.y"
{ yyval = NULL; }
+#line 2071 "command.c"
break;
case 119: /* list_args: '-' */
+#line 582 "command.y"
{
CMDARG *a;
a = mk_cmdarg(D_int);
a->a_int = -1;
append_cmdarg(a);
}
+#line 2082 "command.c"
break;
case 126: /* integer_range: plus_integer '-' plus_integer */
+#line 598 "command.y"
{
if (yyvsp[-2]->a_int > yyvsp[0]->a_int)
yyerror(_("invalid range specification: %d - %d"),
@@ -1986,21 +2091,29 @@ yyreduce:
yyvsp[-2]->type = D_range;
yyval = yyvsp[-2];
}
+#line 2095 "command.c"
break;
case 127: /* opt_integer_list: %empty */
+#line 610 "command.y"
{ yyval = NULL; }
+#line 2101 "command.c"
break;
case 134: /* exp_list: node */
+#line 624 "command.y"
{ yyval = yyvsp[0]; }
+#line 2107 "command.c"
break;
case 135: /* exp_list: exp_list ',' node */
+#line 626 "command.y"
{ yyval = yyvsp[-2]; }
+#line 2113 "command.c"
break;
case 137: /* subscript: '[' exp_list ']' */
+#line 632 "command.y"
{
CMDARG *a;
NODE *subs;
@@ -2015,17 +2128,23 @@ yyreduce:
yyvsp[-1]->a_node = subs;
yyval = yyvsp[-1];
}
+#line 2132 "command.c"
break;
case 139: /* subscript_list: subscript */
+#line 651 "command.y"
{ yyval = yyvsp[0]; num_dim = 1; }
+#line 2138 "command.c"
break;
case 140: /* subscript_list: subscript_list subscript */
+#line 653 "command.y"
{ yyval = yyvsp[-1]; num_dim++; }
+#line 2144 "command.c"
break;
case 142: /* variable: '$' D_NODE */
+#line 659 "command.y"
{
NODE *n = yyvsp[0]->a_node;
if ((n->flags & NUMBER) == 0)
@@ -2034,31 +2153,39 @@ yyreduce:
yyvsp[0]->type = D_field;
yyval = yyvsp[0];
}
+#line 2157 "command.c"
break;
case 143: /* variable: D_VARIABLE subscript_list */
+#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 2168 "command.c"
break;
case 144: /* node: D_NODE */
+#line 678 "command.y"
{ yyval = yyvsp[0]; }
+#line 2174 "command.c"
break;
case 145: /* node: '+' D_NODE */
+#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 2185 "command.c"
break;
case 146: /* node: '-' D_NODE */
+#line 687 "command.y"
{
NODE *n = yyvsp[0]->a_node;
if ((n->flags & NUMBER) == 0)
@@ -2067,56 +2194,76 @@ yyreduce:
negate_num(n);
yyval = yyvsp[0];
}
+#line 2198 "command.c"
break;
case 147: /* opt_plus_integer: %empty */
+#line 699 "command.y"
{ yyval = NULL; }
+#line 2204 "command.c"
break;
case 148: /* opt_plus_integer: plus_integer */
+#line 701 "command.y"
{ yyval = yyvsp[0]; }
+#line 2210 "command.c"
break;
case 149: /* opt_integer: %empty */
+#line 706 "command.y"
{ yyval = NULL; }
+#line 2216 "command.c"
break;
case 150: /* opt_integer: integer */
+#line 708 "command.y"
{ yyval = yyvsp[0]; }
+#line 2222 "command.c"
break;
case 151: /* plus_integer: D_INT */
+#line 713 "command.y"
{
if (yyvsp[0]->a_int == 0)
yyerror(_("non-zero integer value"));
yyval = yyvsp[0];
}
+#line 2232 "command.c"
break;
case 152: /* plus_integer: '+' D_INT */
+#line 719 "command.y"
{
if (yyvsp[0]->a_int == 0)
yyerror(_("non-zero integer value"));
yyval = yyvsp[0];
}
+#line 2242 "command.c"
break;
case 153: /* integer: D_INT */
+#line 728 "command.y"
{ yyval = yyvsp[0]; }
+#line 2248 "command.c"
break;
case 154: /* integer: '+' D_INT */
+#line 730 "command.y"
{ yyval = yyvsp[0]; }
+#line 2254 "command.c"
break;
case 155: /* integer: '-' D_INT */
+#line 732 "command.y"
{
yyvsp[0]->a_int = - yyvsp[0]->a_int;
yyval = yyvsp[0];
}
+#line 2263 "command.c"
break;
case 156: /* nls: '\n' */
+#line 740 "command.y"
{
if (lexptr_begin != NULL) {
if (input_from_tty && lexptr_begin[0] != '\0')
@@ -2125,9 +2272,11 @@ yyreduce:
lexptr_begin = NULL;
}
}
+#line 2276 "command.c"
break;
+#line 2280 "command.c"
default: break;
}
@@ -2320,6 +2469,7 @@ yyreturnlab:
return yyresult;
}
+#line 750 "command.y"
@@ -3200,7 +3350,7 @@ srcfile_generator(const char *text, int state)
s = srcfiles->next;
}
while (s != srcfiles) {
- if (s->stype != SRC_FILE && s->stype != SRC_INC && s->stype !=
SRC_NS_INC) {
+ if (s->stype != SRC_FILE && s->stype != SRC_INC && s->stype !=
SRC_NSINC) {
s = s->next;
continue;
}
diff --git a/command.y b/command.y
index 23025dc3..fb0f560a 100644
--- a/command.y
+++ b/command.y
@@ -92,7 +92,6 @@ static void append_cmdarg(CMDARG *arg);
static int find_argument(CMDARG *arg);
#define YYSTYPE CMDARG *
%}
-%no-lines
%token D_BACKTRACE D_BREAK D_CLEAR D_CONTINUE D_DELETE D_DISABLE D_DOWN
%token D_ENABLE D_FINISH D_FRAME D_HELP D_IGNORE D_INFO D_LIST
@@ -1628,7 +1627,7 @@ srcfile_generator(const char *text, int state)
s = srcfiles->next;
}
while (s != srcfiles) {
- if (s->stype != SRC_FILE && s->stype != SRC_INC && s->stype !=
SRC_NS_INC) {
+ if (s->stype != SRC_FILE && s->stype != SRC_INC && s->stype !=
SRC_NSINC) {
s = s->next;
continue;
}
diff --git a/debug.c b/debug.c
index 464bdd45..ad926e55 100644
--- a/debug.c
+++ b/debug.c
@@ -507,7 +507,7 @@ source_find(char *src)
return cur_srcfile;
for (s = srcfiles->next; s != srcfiles; s = s->next) {
- if ((s->stype == SRC_FILE || s->stype == SRC_INC || s->stype ==
SRC_NS_INC)
+ if ((s->stype == SRC_FILE || s->stype == SRC_INC || s->stype ==
SRC_NSINC)
&& strcmp(s->src, src) == 0)
return s;
}
@@ -515,7 +515,7 @@ source_find(char *src)
path = find_source(src, & sbuf, & errno_val, false);
if (path != NULL) {
for (s = srcfiles->next; s != srcfiles; s = s->next) {
- if ((s->stype == SRC_FILE || s->stype == SRC_INC ||
s->stype == SRC_NS_INC)
+ if ((s->stype == SRC_FILE || s->stype == SRC_INC ||
s->stype == SRC_NSINC)
&& files_are_same(path, s)) {
efree(path);
return s;
@@ -760,7 +760,7 @@ do_info(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
SRCFILE *s;
for (s = srcfiles->next; s != srcfiles; s = s->next) {
fprintf(out_fp, _("Source file (lines): %s (%d)\n"),
- (s->stype == SRC_FILE || s->stype ==
SRC_INC || s->stype == SRC_NS_INC) ? s->src
+ (s->stype == SRC_FILE || s->stype ==
SRC_INC || s->stype == SRC_NSINC) ? s->src
:
"cmd. line",
s->srclines);
}
@@ -2852,7 +2852,7 @@ debug_prog(INSTRUCTION *pc)
cur_srcfile = cur_srcfile->prev) {
if (cur_srcfile->stype == SRC_FILE
|| cur_srcfile->stype == SRC_INC
- || cur_srcfile->stype == SRC_NS_INC)
+ || cur_srcfile->stype == SRC_NSINC)
break;
}
diff --git a/io.c b/io.c
index f222cce2..3943c5a9 100644
--- a/io.c
+++ b/io.c
@@ -3151,7 +3151,7 @@ srcopen(SRCFILE *s)
if (s->stype == SRC_STDIN)
fd = fileno(stdin);
- else if (s->stype == SRC_FILE || s->stype == SRC_INC || s->stype ==
SRC_NS_INC)
+ else if (s->stype == SRC_FILE || s->stype == SRC_INC || s->stype ==
SRC_NSINC)
fd = devopen(s->fullpath, "r");
/* set binary mode so that debugger byte offset calculations will be
right */
diff --git a/main.c b/main.c
index c3c537f2..f1de9dc4 100644
--- a/main.c
+++ b/main.c
@@ -459,7 +459,7 @@ main(int argc, char **argv)
for (s = srcfiles->next; s != srcfiles; s = s->next) {
if (s->stype == SRC_EXTLIB)
load_ext(s->fullpath);
- else if (s->stype != SRC_INC && s->stype != SRC_NS_INC)
+ else if (s->stype != SRC_INC && s->stype != SRC_NSINC)
have_srcfile = true;
}
diff --git a/profile.c b/profile.c
index aa972864..149878ba 100644
--- a/profile.c
+++ b/profile.c
@@ -1354,10 +1354,10 @@ print_include_list(FILE *prof_fp)
return;
for (s = srcfiles->next; s != srcfiles; s = s->next) {
- if (s->stype == SRC_INC || s->stype == SRC_NS_INC) {
+ if (s->stype == SRC_INC || s->stype == SRC_NSINC) {
if (! printed_header) {
printed_header = true;
- fprintf(prof_fp, _("\n# Included files (-i
and/or @include and/or @ns_include)\n\n"));
+ fprintf(prof_fp, _("\n# Included files (-i
and/or @include and/or @nsinclude)\n\n"));
}
found = true;
fprintf(prof_fp, "# @include \"%s\"", s->src);
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 11 ++
awk.h | 2 +-
awkgram.c | 477 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
awkgram.y | 24 ++--
command.c | 184 +++++++++++++++++++++---
command.y | 3 +-
debug.c | 8 +-
io.c | 2 +-
main.c | 2 +-
profile.c | 4 +-
10 files changed, 641 insertions(+), 76 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] gawk branch, feature/ns-include, updated. gawk-4.1.0-5574-gbff70f61,
Arnold Robbins <=