11
static void yyerror (); /* va_alist */
12
static char *get_src_buf P((void));
13
static int yylex P((void));
14
static NODE *node_common P((NODETYPE op));
15
static NODE *snode P((NODE *subn, NODETYPE op, int index));
16
static NODE *mkrangenode P((NODE *cpair));
17
static NODE *make_for_loop P((NODE *init, NODE *cond, NODE *incr));
18
static NODE *append_right P((NODE *list, NODE *new));
19
static void func_install P((NODE *params, NODE *def));
20
static void pop_var P((NODE *np, int freeit));
21
static void pop_params P((NODE *params));
22
static NODE *make_param P((char *name));
23
static NODE *mk_rexp P((NODE *exp));
25
static int want_assign; /* lexical scanning kludge */
26
static int want_regexp; /* lexical scanning kludge */
27
static int can_return; /* lexical scanning kludge */
28
static int io_allowed = 1; /* lexical scanning kludge */
29
static char *lexptr; /* pointer to next char during parsing */
31
static char *lexptr_begin; /* keep track of where we were for error msgs */
32
static char *lexeme; /* beginning of lexeme for debugging */
33
static char *thisline = NULL;
34
#define YYDEBUG_LEXER_TEXT (lexeme)
35
static int param_counter;
36
static char *tokstart = NULL;
37
static char *token = NULL;
40
NODE *variables[HASHSIZE];
43
extern int sourceline;
44
extern char *cmdline_src;
45
extern char **srcfiles;
47
extern NODE *begin_block;
48
extern NODE *end_block;
59
# define FUNC_CALL 257
66
# define APPEND_OP 264
70
# define CONCAT_OP 268
71
# define LEX_BEGIN 269
75
# define LEX_RETURN 273
76
# define LEX_DELETE 274
77
# define LEX_WHILE 275
80
# define LEX_BREAK 278
81
# define LEX_CONTINUE 279
82
# define LEX_PRINT 280
83
# define LEX_PRINTF 281
86
# define LEX_FUNCTION 284
87
# define LEX_GETLINE 285
91
# define INCREMENT 289
92
# define DECREMENT 290
93
# define LEX_BUILTIN 291
94
# define LEX_LENGTH 292
96
#define yyclearin yychar = -1
97
#define yyerrok yyerrflag = 0
101
#define YYMAXDEPTH 150
103
YYSTYPE yylval, yyval;
104
# define YYERRCODE 256
110
char *operator; /* text to match */
111
NODETYPE value; /* node type */
112
int class; /* lexical class */
113
unsigned flags; /* # of args. allowed and compatability */
114
# define ARGS 0xFF /* 0, 1, 2, 3 args allowed (any combination */
115
# define A(n) (1<<(n))
116
# define VERSION 0xFF00 /* old awk is zero */
117
# define NOT_OLD 0x0100 /* feature not in old awk */
118
# define NOT_POSIX 0x0200 /* feature not in POSIX */
119
# define GAWK 0x0400 /* gawk extension */
120
NODE *(*ptr) (); /* function that implements this keyword */
124
*do_exp(), *do_getline(), *do_index(), *do_length(),
125
*do_sqrt(), *do_log(), *do_sprintf(), *do_substr(),
126
*do_split(), *do_system(), *do_int(), *do_close(),
127
*do_atan2(), *do_sin(), *do_cos(), *do_rand(),
128
*do_srand(), *do_match(), *do_tolower(), *do_toupper(),
129
*do_sub(), *do_gsub(), *do_strftime(), *do_systime();
131
/* Tokentab is sorted ascii ascending order, so it can be binary searched. */
133
static struct token tokentab[] = {
134
{"BEGIN", Node_illegal, LEX_BEGIN, 0, 0},
135
{"END", Node_illegal, LEX_END, 0, 0},
136
{"atan2", Node_builtin, LEX_BUILTIN, NOT_OLD|A(2), do_atan2},
137
{"break", Node_K_break, LEX_BREAK, 0, 0},
138
{"close", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_close},
139
{"continue", Node_K_continue, LEX_CONTINUE, 0, 0},
140
{"cos", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_cos},
141
{"delete", Node_K_delete, LEX_DELETE, NOT_OLD, 0},
142
{"do", Node_K_do, LEX_DO, NOT_OLD, 0},
143
{"else", Node_illegal, LEX_ELSE, 0, 0},
144
{"exit", Node_K_exit, LEX_EXIT, 0, 0},
145
{"exp", Node_builtin, LEX_BUILTIN, A(1), do_exp},
146
{"for", Node_K_for, LEX_FOR, 0, 0},
147
{"func", Node_K_function, LEX_FUNCTION, NOT_POSIX|NOT_OLD, 0},
148
{"function", Node_K_function, LEX_FUNCTION, NOT_OLD, 0},
149
{"getline", Node_K_getline, LEX_GETLINE, NOT_OLD, 0},
150
{"gsub", Node_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), do_gsub},
151
{"if", Node_K_if, LEX_IF, 0, 0},
152
{"in", Node_illegal, LEX_IN, 0, 0},
153
{"index", Node_builtin, LEX_BUILTIN, A(2), do_index},
154
{"int", Node_builtin, LEX_BUILTIN, A(1), do_int},
155
{"length", Node_builtin, LEX_LENGTH, A(0)|A(1), do_length},
156
{"log", Node_builtin, LEX_BUILTIN, A(1), do_log},
157
{"match", Node_builtin, LEX_BUILTIN, NOT_OLD|A(2), do_match},
158
{"next", Node_K_next, LEX_NEXT, 0, 0},
159
{"print", Node_K_print, LEX_PRINT, 0, 0},
160
{"printf", Node_K_printf, LEX_PRINTF, 0, 0},
161
{"rand", Node_builtin, LEX_BUILTIN, NOT_OLD|A(0), do_rand},
162
{"return", Node_K_return, LEX_RETURN, NOT_OLD, 0},
163
{"sin", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_sin},
164
{"split", Node_builtin, LEX_BUILTIN, A(2)|A(3), do_split},
165
{"sprintf", Node_builtin, LEX_BUILTIN, 0, do_sprintf},
166
{"sqrt", Node_builtin, LEX_BUILTIN, A(1), do_sqrt},
167
{"srand", Node_builtin, LEX_BUILTIN, NOT_OLD|A(0)|A(1), do_srand},
168
{"strftime", Node_builtin, LEX_BUILTIN, GAWK|A(1)|A(2), do_strftime},
169
{"sub", Node_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), do_sub},
170
{"substr", Node_builtin, LEX_BUILTIN, A(2)|A(3), do_substr},
171
{"system", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_system},
172
{"systime", Node_builtin, LEX_BUILTIN, GAWK|A(0), do_systime},
173
{"tolower", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_tolower},
174
{"toupper", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_toupper},
175
{"while", Node_K_while, LEX_WHILE, 0, 0},
185
register char *ptr, *beg;
189
/* Find the current line in the input file */
192
for (beg = lexeme; beg != lexptr_begin && *beg != '\n'; --beg)
198
/* NL isn't guaranteed */
200
while (ptr < lexend && *ptr && *ptr != '\n')
203
thisline = "(END OF FILE)";
207
fprintf(stderr, "%.*s\n", (int) (ptr - thisline), thisline);
210
while (scan < lexeme)
219
mesg = va_arg(args, char *);
220
vfprintf(stderr, mesg, args);
229
static int samefile = 0;
230
static int nextfile = 0;
231
static char *buf = NULL;
236
static int did_newline = 0;
237
# define SLOP 128 /* enough space to hold most source lines */
241
len = strlen(cmdline_src);
245
lexptr = lexptr_begin = cmdline_src;
246
lexend = lexptr + len;
247
} else if (!did_newline && *(lexptr-1) != '\n') {
249
* The following goop is to ensure that the source
250
* ends with a newline and that the entire current
251
* line is available for error messages.
256
offset = lexptr - lexeme;
257
for (scan = lexeme; scan > lexptr_begin; scan--)
263
emalloc(buf, char *, len+1, "get_src_buf");
264
memcpy(buf, scan, len);
268
lexeme = lexptr - offset;
272
lexptr = lexptr_begin = NULL;
276
source = srcfiles[nextfile];
277
if (source == NULL) {
280
return lexptr = lexptr_begin = NULL;
282
fd = pathopen(source);
284
fatal("can't open source file \"%s\" for reading (%s)",
285
source, strerror(errno));
286
len = optimal_bufsize(fd);
289
emalloc(buf, char *, len + SLOP, "get_src_buf");
290
lexptr_begin = buf + SLOP;
295
* Here, we retain the current source line (up to length SLOP)
296
* in the beginning of the buffer that was overallocated above
301
offset = lexptr - lexeme;
302
for (scan = lexeme; scan > lexptr_begin; scan--)
307
linelen = lexptr - scan;
310
thisline = buf + SLOP - linelen;
311
memcpy(thisline, scan, linelen);
312
lexeme = buf + SLOP - offset;
313
lexptr_begin = thisline;
315
n = read(fd, buf + SLOP, len);
317
fatal("can't read sourcefile \"%s\" (%s)",
318
source, strerror(errno));
322
return get_src_buf();
329
#define tokadd(x) (*token++ = (x), token == tokend ? tokexpand() : token)
334
static int toksize = 60;
337
tokoffset = token - tokstart;
340
erealloc(tokstart, char *, toksize, "tokexpand");
342
emalloc(tokstart, char *, toksize, "tokexpand");
343
tokend = tokstart + toksize;
344
token = tokstart + tokoffset;
351
if (lexptr && lexptr < lexend)
358
#define nextc() ((lexptr && lexptr < lexend) ? \
360
(get_src_buf() ? *lexptr++ : '\0') \
363
#define pushback() (lexptr && lexptr > lexptr_begin ? lexptr-- : lexptr)
366
* Read the input and turn it into tokens.
373
int seen_e = 0; /* These are for numbers */
375
int esc_seen; /* for literal strings */
377
static int did_newline = 0;
390
while (c = nextc()) {
399
if ((c = nextc()) == '\0') {
400
yyerror("unterminated regexp ends with \\ at end of file");
401
} else if (c == '\n') {
407
case '/': /* end of the regexp */
413
yylval.sval = tokstart;
417
yyerror("unterminated regexp");
419
yyerror("unterminated regexp at end of file");
425
while ((c = nextc()) == ' ' || c == '\t')
431
yylval.nodetypeval = Node_illegal;
441
case '#': /* it's a comment */
442
while ((c = nextc()) != '\n') {
450
#ifdef RELAXED_CONTINUATION
451
if (!strict) { /* strip trailing white-space and/or comment */
452
while ((c = nextc()) == ' ' || c == '\t') continue;
454
while ((c = nextc()) != '\n') if (!c) break;
457
#endif /*RELAXED_CONTINUATION*/
458
if (nextc() == '\n') {
462
yyerror("inappropriate use of backslash");
481
if ((c = nextc()) == '=') {
482
yylval.nodetypeval = Node_assign_times;
484
} else if (do_posix) {
487
} else if (c == '*') {
488
/* make ** and **= aliases for ^ and ^= */
489
static int did_warn_op = 0, did_warn_assgn = 0;
491
if (nextc() == '=') {
492
if (do_lint && ! did_warn_assgn) {
494
warning("**= is not allowed by POSIX");
496
yylval.nodetypeval = Node_assign_exp;
500
if (do_lint && ! did_warn_op) {
502
warning("** is not allowed by POSIX");
512
if (nextc() == '=') {
513
yylval.nodetypeval = Node_assign_quotient;
521
if (nextc() == '=') {
522
yylval.nodetypeval = Node_assign_mod;
530
static int did_warn_op = 0, did_warn_assgn = 0;
532
if (nextc() == '=') {
534
if (do_lint && ! did_warn_assgn) {
536
warning("operator `^=' is not supported in old awk");
538
yylval.nodetypeval = Node_assign_exp;
542
if (do_lint && ! did_warn_op) {
544
warning("operator `^' is not supported in old awk");
550
if ((c = nextc()) == '=') {
551
yylval.nodetypeval = Node_assign_plus;
560
if ((c = nextc()) == '=') {
561
yylval.nodetypeval = Node_notequal;
565
yylval.nodetypeval = Node_nomatch;
573
if (nextc() == '=') {
574
yylval.nodetypeval = Node_leq;
577
yylval.nodetypeval = Node_less;
582
if (nextc() == '=') {
583
yylval.nodetypeval = Node_equal;
586
yylval.nodetypeval = Node_assign;
591
if ((c = nextc()) == '=') {
592
yylval.nodetypeval = Node_geq;
594
} else if (c == '>') {
595
yylval.nodetypeval = Node_redirect_append;
598
yylval.nodetypeval = Node_greater;
603
yylval.nodetypeval = Node_match;
609
* Added did newline stuff. Easier than
610
* hacking the grammar
617
--lexptr; /* pick up } next time */
622
while ((c = nextc()) != '"') {
625
yyerror("unterminated string");
638
yyerror("unterminated string");
642
yylval.nodeval = make_str_node(tokstart,
643
token - tokstart, esc_seen ? SCAN : 0);
644
yylval.nodeval->flags |= PERM;
648
if ((c = nextc()) == '=') {
649
yylval.nodetypeval = Node_assign_minus;
688
if ((c = nextc()) == '-' || c == '+')
712
yylval.nodeval = make_number(atof(tokstart));
713
yylval.nodeval->flags |= PERM;
717
if ((c = nextc()) == '&') {
718
yylval.nodetypeval = Node_and;
724
while ((c = nextc()) != '\n' && c != '\0')
743
if ((c = nextc()) == '|') {
744
yylval.nodetypeval = Node_or;
750
while ((c = nextc()) != '\n' && c != '\0')
769
if (c != '_' && ! isalpha(c))
770
yyerror("Invalid char '%c' in expression\n", c);
772
/* it's some type of name-type-thing. Find its length */
774
while (is_identchar(c)) {
779
emalloc(tokkey, char *, token - tokstart, "yylex");
780
memcpy(tokkey, tokstart, token - tokstart);
783
/* See if it is a special token. */
785
high = (sizeof (tokentab) / sizeof (tokentab[0])) - 1;
786
while (low <= high) {
789
mid = (low + high) / 2;
790
c = *tokstart - tokentab[mid].operator[0];
791
i = c ? c : strcmp (tokstart, tokentab[mid].operator);
793
if (i < 0) { /* token < mid */
795
} else if (i > 0) { /* token > mid */
799
if (tokentab[mid].flags & GAWK)
800
warning("%s() is a gawk extension",
801
tokentab[mid].operator);
802
if (tokentab[mid].flags & NOT_POSIX)
803
warning("POSIX does not allow %s",
804
tokentab[mid].operator);
805
if (tokentab[mid].flags & NOT_OLD)
806
warning("%s is not supported in old awk",
807
tokentab[mid].operator);
809
if ((strict && (tokentab[mid].flags & GAWK))
810
|| (do_posix && (tokentab[mid].flags & NOT_POSIX)))
812
if (tokentab[mid].class == LEX_BUILTIN
813
|| tokentab[mid].class == LEX_LENGTH
817
yylval.nodetypeval = tokentab[mid].value;
819
return tokentab[mid].class;
823
yylval.sval = tokkey;
841
/* if lookahead is NL, lineno is 1 too high */
842
if (lexeme && *lexeme == '\n')
843
r->source_line = sourceline - 1;
845
r->source_line = sourceline;
846
r->source_file = source;
851
* This allocates a node with defined lnode and rnode.
854
node(left, op, right)
867
* This allocates a node with defined subnode and proc for builtin functions
868
* Checks for arg. count and supplies defaults where possible.
871
snode(subn, op, index)
883
/* traverse expression list to see how many args. given */
884
for (n= subn; n; n= n->rnode) {
890
/* check against how many args. are allowed for this builtin */
891
args_allowed = tokentab[index].flags & ARGS;
892
if (args_allowed && !(args_allowed & A(nexp)))
893
fatal("%s() cannot have %d argument%c",
894
tokentab[index].operator, nexp, nexp == 1 ? ' ' : 's');
896
r->proc = tokentab[index].ptr;
898
/* special case processing for a few builtins */
899
if (nexp == 0 && r->proc == do_length) {
900
subn = node(node(make_number(0.0),Node_field_spec,(NODE *)NULL),
901
Node_expression_list,
903
} else if (r->proc == do_match) {
904
if (subn->rnode->lnode->type != Node_regex)
905
subn->rnode->lnode = mk_rexp(subn->rnode->lnode);
906
} else if (r->proc == do_sub || r->proc == do_gsub) {
907
if (subn->lnode->type != Node_regex)
908
subn->lnode = mk_rexp(subn->lnode);
910
append_right(subn, node(node(make_number(0.0),
913
Node_expression_list,
915
else if (do_lint && subn->rnode->rnode->lnode->type == Node_val)
916
warning("string literal as last arg of substitute");
917
} else if (r->proc == do_split) {
920
node(FS_node, Node_expression_list, (NODE *) NULL));
921
n = subn->rnode->rnode->lnode;
922
if (n->type != Node_regex)
923
subn->rnode->rnode->lnode = mk_rexp(n);
925
subn->rnode->rnode->lnode->re_flags |= FS_DFLT;
933
* This allocates a Node_line_range node with defined condpair and
934
* zeroes the trigger word to avoid the temptation of assuming that calling
935
* 'node( foo, Node_line_range, 0)' will properly initialize 'triggered'.
937
/* Otherwise like node() */
945
r->type = Node_line_range;
951
/* Build a for loop */
953
make_for_loop(init, cond, incr)
954
NODE *init, *cond, *incr;
956
register FOR_LOOP_HEADER *r;
959
emalloc(r, FOR_LOOP_HEADER *, sizeof(FOR_LOOP_HEADER), "make_for_loop");
961
n->type = Node_illegal;
965
n->sub.nodep.r.hd = r;
970
* Install a name in the symbol table, even if it is already there.
971
* Caller must check against redefinition if that is desired.
979
register int len, bucket;
982
bucket = hash(name, len);
984
hp->type = Node_hashnode;
985
hp->hnext = variables[bucket];
986
variables[bucket] = hp;
993
/* find the most recent hash node for name installed by install */
998
register NODE *bucket;
1002
bucket = variables[hash(name, len)];
1004
if (bucket->hlength == len && STREQN(bucket->hname, name, len))
1005
return bucket->hvalue;
1006
bucket = bucket->hnext;
1012
* Add new to the rightmost branch of LIST. This uses n^2 time, so we make
1013
* a simple attempt at optimizing it.
1016
append_right(list, new)
1019
register NODE *oldlist;
1020
static NODE *savefront = NULL, *savetail = NULL;
1023
if (savefront == oldlist) {
1024
savetail = savetail->rnode = new;
1027
savefront = oldlist;
1028
while (list->rnode != NULL)
1030
savetail = list->rnode = new;
1035
* check if name is already installed; if so, it had better have Null value,
1036
* in which case def is added as the value. Otherwise, install name with def
1040
func_install(params, def)
1046
pop_params(params->rnode);
1048
r = lookup(params->param);
1050
fatal("function name `%s' previously defined", params->param);
1052
(void) install(params->param, node(params, Node_func, def));
1060
register NODE *bucket, **save;
1066
save = &(variables[hash(name, len)]);
1067
for (bucket = *save; bucket; bucket = bucket->hnext) {
1068
if (len == bucket->hlength && STREQN(bucket->hname, name, len)) {
1069
*save = bucket->hnext;
1075
save = &(bucket->hnext);
1085
for (np = params; np != NULL; np = np->rnode)
1096
r->type = Node_param_list;
1099
r->param_cnt = param_counter++;
1100
return (install(name, r));
1103
/* Name points to a variable name. Make sure its in the symbol table */
1105
variable(name, can_free)
1110
static int env_loaded = 0;
1112
if (!env_loaded && STREQ(name, "ENVIRON")) {
1116
if ((r = lookup(name)) == NULL)
1117
r = install(name, node(Nnull_string, Node_var, (NODE *) NULL));
1127
if (exp->type == Node_regex)
1133
n->type = Node_regex;
1209
# define YYNPROD 158
1210
# define YYLAST 1843
1213
62, 212, 20, 13, 107, 24, 13, 87, 225, 17,
1214
88, 89, 36, 123, 35, 82, 25, 291, 91, 235,
1215
45, 45, 4, 37, 168, 88, 89, 286, 45, 285,
1216
264, 88, 89, 200, 260, 24, 259, 261, 52, 184,
1217
166, 165, 249, 161, 63, 127, 199, 22, 100, 186,
1218
158, 173, 82, 122, 65, 124, 125, 126, 63, 128,
1219
129, 130, 131, 20, 218, 82, 24, 90, 107, 171,
1220
17, 82, 63, 36, 45, 35, 64, 25, 63, 174,
1221
159, 136, 63, 93, 22, 171, 228, 63, 263, 45,
1222
220, 185, 22, 270, 68, 202, 163, 144, 142, 175,
1223
113, 103, 112, 111, 6, 252, 101, 227, 183, 167,
1224
39, 102, 183, 183, 183, 160, 26, 157, 110, 133,
1225
20, 86, 82, 24, 11, 140, 97, 17, 121, 24,
1226
36, 46, 35, 98, 25, 48, 36, 41, 35, 164,
1227
25, 108, 82, 194, 82, 159, 45, 141, 91, 77,
1228
257, 71, 148, 22, 149, 68, 258, 182, 100, 10,
1229
27, 159, 5, 1, 219, 50, 118, 12, 221, 222,
1230
224, 120, 20, 0, 203, 24, 189, 0, 97, 17,
1231
0, 24, 36, 0, 35, 98, 25, 0, 36, 0,
1232
35, 0, 233, 0, 0, 197, 193, 198, 45, 236,
1233
0, 240, 241, 242, 187, 188, 0, 190, 0, 0,
1234
22, 217, 0, 0, 0, 192, 0, 0, 0, 183,
1235
0, 0, 0, 0, 0, 135, 30, 23, 4, 4,
1236
33, 34, 0, 0, 0, 201, 0, 213, 265, 0,
1237
83, 0, 80, 81, 72, 73, 74, 75, 76, 84,
1238
85, 78, 79, 0, 18, 0, 169, 23, 31, 32,
1239
28, 29, 22, 82, 276, 253, 20, 159, 255, 24,
1240
169, 232, 82, 17, 0, 0, 36, 0, 35, 159,
1241
25, 0, 0, 273, 169, 267, 67, 30, 23, 82,
1242
274, 33, 34, 59, 169, 60, 82, 82, 82, 204,
1243
0, 83, 19, 80, 81, 72, 73, 74, 75, 76,
1244
84, 85, 78, 79, 0, 18, 0, 279, 0, 31,
1245
32, 28, 29, 95, 0, 0, 0, 0, 0, 289,
1246
103, 0, 0, 0, 0, 101, 104, 0, 105, 0,
1247
102, 0, 0, 67, 30, 23, 0, 0, 33, 34,
1248
30, 23, 0, 0, 33, 34, 0, 53, 83, 0,
1249
80, 81, 72, 73, 74, 75, 76, 84, 85, 78,
1250
79, 0, 18, 0, 0, 0, 31, 32, 28, 29,
1251
154, 0, 31, 32, 28, 29, 0, 100, 0, 0,
1252
0, 0, 0, 0, 0, 211, 30, 23, 0, 0,
1253
33, 34, 30, 23, 0, 0, 33, 34, 0, 0,
1254
83, 0, 80, 81, 72, 73, 74, 75, 76, 84,
1255
85, 78, 79, 16, 18, 0, 0, 0, 31, 32,
1256
28, 29, 0, 0, 31, 32, 28, 29, 0, 0,
1257
0, 0, 94, 0, 99, 0, 0, 0, 109, 0,
1258
0, 0, 0, 154, 20, 114, 115, 24, 214, 99,
1259
99, 17, 0, 0, 36, 0, 35, 0, 25, 0,
1260
0, 0, 0, 150, 0, 0, 0, 0, 0, 0,
1261
45, 59, 0, 60, 61, 0, 0, 0, 0, 0,
1262
20, 23, 0, 24, 33, 34, 58, 17, 171, 0,
1263
36, 152, 35, 0, 25, 0, 154, 154, 154, 154,
1264
154, 0, 154, 154, 154, 0, 0, 59, 0, 60,
1265
61, 99, 31, 32, 99, 99, 99, 99, 99, 99,
1266
20, 0, 0, 24, 0, 0, 0, 17, 0, 0,
1267
36, 0, 35, 0, 25, 53, 154, 94, 154, 154,
1268
154, 154, 0, 154, 154, 154, 45, 59, 0, 60,
1269
61, 0, 0, 0, 0, 0, 20, 0, 0, 24,
1270
0, 154, 154, 17, 152, 0, 36, 94, 35, 99,
1271
25, 53, 0, 0, 154, 0, 0, 0, 0, 0,
1272
0, 191, 0, 59, 0, 60, 61, 0, 99, 243,
1273
245, 246, 247, 248, 0, 250, 251, 70, 0, 0,
1274
14, 0, 20, 14, 0, 24, 0, 0, 14, 17,
1275
51, 53, 36, 63, 35, 0, 25, 152, 152, 152,
1276
152, 152, 0, 152, 152, 152, 0, 0, 0, 59,
1277
0, 60, 61, 0, 0, 0, 0, 0, 269, 14,
1278
0, 0, 0, 0, 14, 0, 0, 53, 0, 0,
1279
0, 0, 0, 0, 281, 0, 0, 152, 0, 152,
1280
152, 152, 152, 0, 152, 152, 152, 0, 30, 23,
1281
0, 0, 33, 34, 58, 0, 0, 56, 4, 0,
1282
0, 0, 152, 152, 0, 0, 0, 0, 0, 0,
1283
0, 0, 0, 53, 0, 152, 18, 57, 54, 55,
1284
31, 32, 28, 29, 30, 23, 0, 0, 33, 34,
1285
58, 0, 0, 56, 0, 0, 155, 0, 0, 24,
1286
0, 0, 0, 98, 0, 0, 36, 0, 35, 0,
1287
25, 0, 18, 57, 54, 55, 31, 32, 28, 29,
1288
0, 268, 0, 0, 30, 23, 210, 0, 33, 34,
1289
58, 0, 155, 56, 0, 24, 0, 0, 0, 98,
1290
0, 0, 36, 0, 35, 0, 25, 0, 0, 0,
1291
0, 0, 18, 57, 54, 55, 31, 32, 28, 29,
1292
30, 23, 210, 0, 33, 34, 58, 0, 0, 56,
1293
20, 0, 0, 24, 0, 0, 0, 17, 0, 0,
1294
36, 0, 35, 0, 25, 0, 0, 0, 18, 57,
1295
54, 55, 31, 32, 28, 29, 0, 59, 0, 60,
1296
61, 0, 0, 0, 0, 0, 30, 23, 21, 0,
1297
33, 34, 58, 0, 0, 56, 0, 0, 155, 0,
1298
0, 24, 0, 0, 0, 98, 0, 0, 36, 96,
1299
35, 0, 25, 0, 18, 57, 54, 55, 31, 32,
1300
28, 29, 0, 20, 116, 117, 24, 0, 0, 0,
1301
17, 0, 0, 36, 0, 35, 0, 25, 0, 0,
1302
0, 53, 0, 0, 0, 0, 0, 0, 0, 0,
1303
59, 0, 60, 0, 0, 0, 0, 0, 0, 0,
1304
155, 0, 0, 24, 0, 0, 156, 98, 20, 0,
1305
36, 24, 35, 0, 25, 17, 0, 0, 36, 0,
1306
35, 0, 25, 0, 0, 0, 96, 0, 0, 176,
1307
177, 178, 179, 180, 181, 59, 0, 60, 0, 0,
1308
30, 23, 0, 0, 33, 34, 209, 0, 0, 207,
1309
0, 0, 0, 20, 53, 0, 24, 0, 0, 0,
1310
17, 0, 0, 36, 0, 35, 0, 25, 153, 208,
1311
205, 206, 31, 32, 28, 29, 30, 23, 0, 156,
1312
33, 34, 209, 20, 96, 207, 24, 0, 0, 0,
1313
17, 0, 0, 36, 0, 35, 0, 25, 0, 53,
1314
0, 0, 0, 226, 153, 208, 205, 206, 31, 32,
1315
28, 29, 0, 0, 30, 23, 0, 0, 33, 34,
1316
58, 0, 0, 56, 0, 0, 0, 0, 0, 0,
1317
0, 0, 156, 156, 156, 156, 156, 0, 156, 156,
1318
156, 0, 18, 57, 54, 55, 31, 32, 28, 29,
1319
20, 0, 0, 24, 0, 0, 0, 17, 0, 0,
1320
36, 0, 35, 23, 25, 0, 33, 34, 209, 0,
1321
0, 0, 156, 22, 156, 156, 156, 156, 0, 156,
1322
156, 156, 0, 0, 0, 0, 0, 30, 23, 0,
1323
0, 33, 34, 58, 31, 32, 56, 156, 156, 155,
1324
0, 0, 24, 0, 0, 0, 98, 0, 0, 36,
1325
156, 35, 0, 25, 0, 18, 57, 54, 0, 31,
1326
32, 28, 29, 0, 0, 23, 0, 0, 33, 34,
1327
0, 0, 30, 23, 0, 0, 33, 34, 58, 155,
1328
22, 56, 24, 0, 0, 0, 98, 0, 0, 36,
1329
0, 35, 2, 25, 0, 0, 31, 32, 38, 0,
1330
18, 57, 0, 0, 31, 32, 28, 29, 0, 0,
1331
0, 0, 0, 0, 0, 106, 20, 0, 23, 24,
1332
0, 33, 34, 17, 0, 0, 36, 0, 35, 0,
1333
25, 0, 0, 0, 0, 0, 0, 119, 0, 0,
1334
0, 0, 45, 0, 0, 0, 40, 30, 23, 31,
1335
32, 33, 34, 0, 0, 0, 132, 4, 0, 8,
1336
9, 138, 139, 0, 0, 0, 143, 0, 0, 0,
1337
0, 0, 0, 0, 15, 18, 0, 0, 0, 31,
1338
32, 28, 29, 20, 0, 0, 24, 0, 0, 0,
1339
17, 155, 0, 36, 24, 35, 0, 25, 98, 0,
1340
0, 36, 0, 35, 0, 25, 0, 0, 0, 0,
1341
0, 66, 0, 7, 30, 23, 0, 0, 33, 34,
1342
0, 0, 0, 0, 0, 0, 8, 9, 0, 0,
1343
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1344
0, 15, 18, 0, 0, 0, 31, 32, 28, 29,
1345
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1346
0, 0, 0, 30, 23, 172, 0, 33, 34, 209,
1347
20, 0, 207, 24, 0, 0, 134, 17, 0, 0,
1348
36, 0, 35, 0, 25, 0, 0, 0, 0, 0,
1349
0, 153, 208, 205, 0, 31, 32, 28, 29, 0,
1350
0, 0, 0, 30, 23, 0, 0, 33, 34, 209,
1351
155, 0, 207, 24, 0, 0, 0, 147, 0, 0,
1352
36, 0, 35, 0, 25, 0, 0, 262, 0, 0,
1353
0, 153, 208, 134, 0, 31, 32, 28, 29, 0,
1354
30, 23, 0, 0, 33, 34, 0, 20, 0, 271,
1355
24, 0, 0, 134, 17, 195, 170, 36, 0, 35,
1356
0, 25, 0, 0, 0, 284, 0, 0, 18, 0,
1357
288, 0, 31, 32, 28, 29, 0, 0, 0, 0,
1358
292, 0, 0, 295, 296, 155, 0, 297, 24, 0,
1359
42, 0, 98, 0, 0, 36, 0, 35, 0, 25,
1360
47, 49, 0, 0, 0, 0, 92, 30, 23, 0,
1361
0, 33, 34, 0, 244, 30, 23, 0, 0, 33,
1362
34, 0, 20, 0, 0, 24, 0, 0, 0, 17,
1363
0, 0, 36, 0, 35, 18, 25, 0, 0, 31,
1364
32, 28, 29, 153, 0, 0, 0, 31, 32, 28,
1365
29, 229, 0, 230, 231, 0, 0, 0, 0, 0,
1366
234, 0, 0, 0, 238, 0, 145, 146, 0, 0,
1367
0, 0, 0, 162, 275, 0, 0, 69, 0, 0,
1368
0, 0, 0, 283, 0, 256, 44, 44, 44, 0,
1369
0, 0, 0, 223, 30, 23, 0, 0, 33, 34,
1370
293, 3, 0, 0, 0, 0, 0, 298, 299, 300,
1371
43, 43, 43, 0, 0, 0, 0, 0, 0, 0,
1372
0, 0, 18, 272, 0, 0, 31, 32, 28, 29,
1373
277, 0, 0, 151, 30, 23, 0, 0, 33, 34,
1374
0, 0, 287, 137, 0, 290, 0, 0, 215, 216,
1375
0, 0, 0, 44, 44, 294, 0, 0, 0, 0,
1376
44, 0, 153, 0, 0, 0, 31, 32, 28, 29,
1377
0, 30, 23, 0, 0, 33, 34, 43, 43, 0,
1378
0, 0, 0, 0, 43, 0, 0, 0, 0, 0,
1379
239, 0, 0, 0, 0, 0, 0, 0, 0, 18,
1380
0, 0, 0, 31, 32, 28, 29, 0, 254, 30,
1381
23, 137, 0, 33, 34, 0, 0, 0, 0, 0,
1382
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1383
0, 0, 0, 0, 0, 44, 44, 153, 0, 0,
1384
0, 31, 32, 28, 29, 0, 30, 196, 0, 0,
1385
33, 34, 0, 0, 0, 0, 0, 0, 280, 43,
1386
43, 282, 0, 0, 0, 0, 0, 137, 0, 0,
1387
0, 0, 0, 0, 18, 237, 0, 44, 31, 32,
1388
28, 29, 0, 0, 0, 0, 0, 0, 0, 0,
1389
0, 0, 0, 0, 0, 44, 0, 0, 0, 0,
1390
0, 43, 0, 0, 0, 0, 0, 0, 0, 0,
1391
0, 0, 0, 0, 0, 266, 0, 0, 0, 43,
1392
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1393
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1394
0, 0, 0, 278, 0, 44, 0, 0, 44, 0,
1395
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1396
0, 0, 0, 0, 0, 0, 0, 0, 0, 43,
1400
-245, -1000, 1027, -244, -1000, 960, -1000, -1000, -38, -38,
1401
-39, -1000, -76, 579, 30, -1000, -258, 1220, -1, -1000,
1402
93, 293, -245, -23, 145, -1000, -1000, -1000, 63, 62,
1403
60, -1, -1, -1000, -1000, 145, 145, -1000, -1000, -1000,
1404
-1000, -76, -1000, -244, -245, -1000, -76, -1000, -1000, -1000,
1405
-1000, 87, 1384, -272, 1384, 1384, 1384, -213, 1384, 1384,
1406
1384, 1384, 930, -245, -31, 15, -1000, -1000, -245, -245,
1407
30, -1000, 58, -245, 57, -38, -38, 1347, -1000, 1384,
1408
-1000, -215, 421, 56, -1000, -1000, -217, -1000, -1000, -1000,
1409
28, 457, -1000, 19, -1000, -1000, -46, 145, 1384, -279,
1410
145, 145, 145, 145, 145, 145, -1000, 1220, -1000, -1000,
1411
-220, 1220, 1220, 1220, -1000, -1000, -46, -46, -1000, -1000,
1412
-1000, -31, 767, -1, 885, 840, 233, -1000, 930, 930,
1413
930, 533, -1000, 15, -1000, -1000, -1000, -1000, -1000, -1000,
1414
-1000, -31, 1384, 139, 1459, -1000, -1000, 1220, -29, 43,
1415
729, -1000, -264, -1, -1000, 93, 293, -38, -38, 767,
1416
1384, -27, -1000, 1384, 50, -1000, -1000, 1384, 1307, 1384,
1417
-278, -1000, -1000, -1000, 145, 457, -46, -46, -46, -46,
1418
64, 64, 14, 767, 39, 44, 38, 44, 44, 15,
1419
-1000, 1384, -1000, -1000, 457, -256, -87, 15, 28, -38,
1420
1384, 1384, 1384, 1228, 1422, 1422, 1422, 1422, -216, 1422,
1421
1422, 877, -1000, 19, -1000, -1000, -1000, -38, 1220, 457,
1422
-222, 767, 767, -1000, 767, -221, 293, -1000, -1000, -1000,
1423
-1000, -1000, -1000, 767, -245, 48, -228, 1153, -29, -1000,
1424
767, 767, 767, 729, -1000, 729, 1116, 1076, 815, -1000,
1425
877, 693, 1422, -1000, -1000, 0, -245, 44, 34, -1000,
1426
-1000, -1000, 139, 1384, 44, 497, 1384, -38, 1422, 729,
1427
-38, 139, -245, -229, -1000, -1000, 457, -245, 1384, 44,
1428
-1000, 729, -1000, -255, -1000, -1000, -1000, -245, 139, 44,
1429
-245, -245, -1000, -1000, -245, 139, 139, 139, -1000, -1000,
1433
0, 167, 165, 395, 0, 163, 162, 104, 838, 116,
1434
160, 159, 124, 423, 156, 154, 152, 49, 91, 76,
1435
1281, 151, 150, 50, 83, 302, 51, 46, 149, 139,
1436
1162, 137, 131, 1460, 121, 1335, 607, 54, 81, 24,
1437
118, 1571, 1547, 117, 115, 109, 105 };
1440
0, 5, 6, 6, 6, 6, 31, 7, 32, 7,
1441
7, 7, 7, 7, 7, 7, 29, 29, 34, 1,
1442
2, 11, 11, 40, 25, 12, 12, 19, 19, 19,
1443
19, 33, 33, 20, 20, 20, 20, 20, 20, 20,
1444
20, 20, 20, 20, 20, 20, 43, 20, 20, 44,
1445
20, 20, 20, 28, 28, 21, 21, 41, 41, 30,
1446
30, 26, 26, 27, 27, 27, 27, 22, 22, 14,
1447
14, 14, 14, 14, 23, 23, 16, 16, 15, 15,
1448
15, 15, 15, 15, 18, 18, 17, 17, 17, 17,
1449
17, 17, 45, 4, 4, 4, 4, 4, 4, 4,
1450
4, 4, 4, 4, 4, 4, 4, 4, 4, 46,
1451
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1452
3, 3, 8, 8, 8, 8, 8, 8, 8, 8,
1453
9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
1454
9, 9, 10, 10, 10, 24, 24, 13, 13, 13,
1455
13, 36, 37, 35, 38, 38, 42, 39 };
1458
0, 7, 3, 5, 3, 5, 1, 7, 1, 7,
1459
5, 5, 5, 3, 5, 5, 3, 3, 1, 15,
1460
9, 3, 7, 1, 9, 9, 7, 3, 5, 3,
1461
5, 2, 4, 5, 5, 7, 3, 13, 17, 17,
1462
21, 19, 5, 5, 13, 9, 1, 7, 7, 1,
1463
9, 13, 5, 3, 3, 13, 19, 3, 4, 0,
1464
2, 1, 5, 1, 5, 5, 5, 1, 3, 3,
1465
7, 3, 5, 7, 1, 3, 1, 3, 3, 7,
1466
3, 5, 7, 7, 1, 3, 3, 7, 3, 5,
1467
7, 7, 1, 9, 11, 9, 7, 7, 7, 7,
1468
3, 5, 7, 7, 7, 7, 11, 3, 5, 1,
1469
9, 7, 7, 7, 3, 5, 7, 7, 7, 11,
1470
3, 5, 2, 2, 7, 7, 7, 7, 7, 7,
1471
5, 7, 9, 9, 3, 9, 5, 5, 3, 3,
1472
5, 5, 5, 5, 2, 1, 3, 3, 9, 5,
1473
5, 4, 5, 3, 0, 2, 3, 5 };
1476
-1000, -5, -30, -41, 267, -6, -7, 256, 269, 270,
1477
-11, -12, -1, -4, -36, 284, -13, 40, 285, -25,
1478
33, -8, 123, 258, 36, 47, -9, -10, 291, 292,
1479
257, 289, 290, 261, 262, 45, 43, 267, -30, -7,
1480
256, -31, -33, -41, -42, 59, -32, -33, -12, -33,
1481
-2, -36, -39, 124, 287, 288, 266, 286, 263, 60,
1482
62, 63, -4, 44, -19, -37, -20, 256, 125, -42,
1483
-36, -21, 275, 276, 277, 278, 279, -28, 282, 283,
1484
273, 274, -4, 271, 280, 281, -34, 265, 289, 290,
1485
-17, -4, 256, -24, -13, -25, -8, 33, 40, -13,
1486
94, 42, 47, 37, 43, 45, -30, 91, -9, -13,
1487
-40, 40, 40, 40, -13, -13, -8, -8, -12, -30,
1488
-12, -19, -4, 285, -4, -4, -4, 258, -4, -4,
1489
-4, -4, -30, -37, -20, 256, -38, -42, -30, -30,
1490
-37, -19, 40, -30, 40, -33, -33, 40, -16, -15,
1491
-3, 256, -13, 285, -25, 33, -8, -43, -23, -4,
1492
-44, 258, -33, 40, -29, 258, 257, -45, -39, 256,
1493
-35, 41, -35, -26, 60, -4, -8, -8, -8, -8,
1494
-8, -8, -17, -4, 259, -18, -17, -18, -18, -37,
1495
-24, 58, -38, -37, -4, -20, 258, -23, -17, -27,
1496
62, 264, 124, -39, 256, 287, 288, 266, 286, 263,
1497
63, -3, 265, -24, -25, -33, -33, -23, 91, -4,
1498
40, -4, -4, 256, -4, 286, -8, 93, 47, -35,
1499
-35, -35, -38, -4, -35, 275, 286, -42, -35, -33,
1500
-4, -4, -4, -3, 256, -3, -3, -3, -3, 258,
1501
-3, -3, -46, -26, -33, -17, -35, -22, -14, 258,
1502
256, 258, -30, 40, 258, -4, -42, -27, 58, -3,
1503
93, -30, -35, -39, 256, -20, -4, -35, -42, -23,
1504
-33, -3, -33, -20, -30, 258, 256, -35, -30, -23,
1505
-35, 272, -30, -20, -35, -30, -30, -30, -20, -20,
1509
59, -2, 0, 60, 57, -2, 2, 4, 6, 8,
1510
0, 13, 0, 21, 0, 18, 144, 0, 145, 100,
1511
0, 107, 59, 147, 0, 23, 122, 123, 0, 134,
1512
0, 0, 0, 138, 139, 0, 0, 58, 1, 3,
1513
5, 0, 10, 31, 59, 156, 0, 11, 12, 14,
1514
15, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1515
0, 0, 108, 59, 0, 154, 27, 29, 59, 59,
1516
0, 36, 0, 59, 0, 0, 0, -2, 46, 74,
1517
49, 0, 0, 0, 53, 54, 0, 92, 142, 143,
1518
0, 86, 88, 61, 146, 101, 130, 0, 0, 144,
1519
0, 0, 0, 0, 0, 0, 151, 0, 149, 150,
1520
0, -2, -2, -2, 136, 137, 140, 141, 7, 32,
1521
9, 0, 22, 145, 97, 98, -2, 102, -2, -2,
1522
-2, 0, 157, 154, 28, 30, 26, 155, 152, 33,
1523
34, 0, 0, 0, 74, 42, 43, 0, 63, -2,
1524
78, 80, 144, 145, 114, 0, 120, 0, 0, 75,
1525
74, 0, 52, 0, 0, 16, 17, 0, 0, 89,
1526
0, 153, 131, 96, 0, 0, 124, 125, 126, 127,
1527
128, 129, 0, 86, 0, 0, -2, 0, 0, 154,
1528
95, 0, 25, 35, 0, 0, 147, 0, 0, 0,
1529
0, 0, 0, 0, 81, 0, 0, 0, 0, 0,
1530
0, 121, 109, 61, 115, 47, 48, 0, 0, 0,
1531
-2, 93, 87, 91, 90, 0, 62, 148, 24, 132,
1532
133, 135, 20, 106, 59, 0, 0, 0, 63, 45,
1533
64, 65, 66, 79, 83, 82, 111, 112, -2, 117,
1534
-2, 0, 0, 113, 50, 0, 59, 0, -2, 69,
1535
71, 94, 0, 0, 0, 0, 74, 0, 0, 110,
1536
0, 0, 59, 0, 72, 37, 0, 59, 74, 0,
1537
44, 119, 51, 55, 19, 70, 73, 59, 0, 0,
1538
59, 59, 38, 39, 59, 0, 0, 0, 41, 56,
1540
typedef struct { char *t_name; int t_val; } yytoktype;
1542
# define YYDEBUG 0 /* don't allow debugging */
1547
yytoktype yytoks[] =
1571
"LEX_CONTINUE", 279,
1576
"LEX_FUNCTION", 284,
1601
"-unknown-", -1 /* ends search */
1606
"-no such reduction-",
1607
"start : opt_nls program opt_nls",
1609
"program : program rule",
1611
"program : program error",
1613
"rule : LEX_BEGIN action",
1615
"rule : LEX_END action",
1616
"rule : LEX_BEGIN statement_term",
1617
"rule : LEX_END statement_term",
1618
"rule : pattern action",
1620
"rule : pattern statement_term",
1621
"rule : function_prologue function_body",
1623
"func_name : FUNC_CALL",
1624
"function_prologue : LEX_FUNCTION",
1625
"function_prologue : LEX_FUNCTION func_name '(' opt_param_list r_paren opt_nls",
1626
"function_body : l_brace statements r_brace opt_semi",
1628
"pattern : exp comma exp",
1630
"regexp : '/' REGEXP '/'",
1631
"action : l_brace statements r_brace opt_semi",
1632
"action : l_brace r_brace opt_semi",
1633
"statements : statement",
1634
"statements : statements statement",
1635
"statements : error",
1636
"statements : statements error",
1637
"statement_term : nls",
1638
"statement_term : semi opt_nls",
1639
"statement : semi opt_nls",
1640
"statement : l_brace r_brace",
1641
"statement : l_brace statements r_brace",
1642
"statement : if_statement",
1643
"statement : LEX_WHILE '(' exp r_paren opt_nls statement",
1644
"statement : LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls",
1645
"statement : LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement",
1646
"statement : LEX_FOR '(' opt_exp semi exp semi opt_exp r_paren opt_nls statement",
1647
"statement : LEX_FOR '(' opt_exp semi semi opt_exp r_paren opt_nls statement",
1648
"statement : LEX_BREAK statement_term",
1649
"statement : LEX_CONTINUE statement_term",
1650
"statement : print '(' expression_list r_paren output_redir statement_term",
1651
"statement : print opt_rexpression_list output_redir statement_term",
1652
"statement : LEX_NEXT",
1653
"statement : LEX_NEXT statement_term",
1654
"statement : LEX_EXIT opt_exp statement_term",
1655
"statement : LEX_RETURN",
1656
"statement : LEX_RETURN opt_exp statement_term",
1657
"statement : LEX_DELETE NAME '[' expression_list ']' statement_term",
1658
"statement : exp statement_term",
1659
"print : LEX_PRINT",
1660
"print : LEX_PRINTF",
1661
"if_statement : LEX_IF '(' exp r_paren opt_nls statement",
1662
"if_statement : LEX_IF '(' exp r_paren opt_nls statement LEX_ELSE opt_nls statement",
1664
"nls : nls NEWLINE",
1665
"opt_nls : /* empty */",
1667
"input_redir : /* empty */",
1668
"input_redir : '<' simp_exp",
1669
"output_redir : /* empty */",
1670
"output_redir : '>' exp",
1671
"output_redir : APPEND_OP exp",
1672
"output_redir : '|' exp",
1673
"opt_param_list : /* empty */",
1674
"opt_param_list : param_list",
1675
"param_list : NAME",
1676
"param_list : param_list comma NAME",
1677
"param_list : error",
1678
"param_list : param_list error",
1679
"param_list : param_list comma error",
1680
"opt_exp : /* empty */",
1682
"opt_rexpression_list : /* empty */",
1683
"opt_rexpression_list : rexpression_list",
1684
"rexpression_list : rexp",
1685
"rexpression_list : rexpression_list comma rexp",
1686
"rexpression_list : error",
1687
"rexpression_list : rexpression_list error",
1688
"rexpression_list : rexpression_list error rexp",
1689
"rexpression_list : rexpression_list comma error",
1690
"opt_expression_list : /* empty */",
1691
"opt_expression_list : expression_list",
1692
"expression_list : exp",
1693
"expression_list : expression_list comma exp",
1694
"expression_list : error",
1695
"expression_list : expression_list error",
1696
"expression_list : expression_list error exp",
1697
"expression_list : expression_list comma error",
1698
"exp : variable ASSIGNOP",
1699
"exp : variable ASSIGNOP exp",
1700
"exp : '(' expression_list r_paren LEX_IN NAME",
1701
"exp : exp '|' LEX_GETLINE opt_variable",
1702
"exp : LEX_GETLINE opt_variable input_redir",
1703
"exp : exp LEX_AND exp",
1704
"exp : exp LEX_OR exp",
1705
"exp : exp MATCHOP exp",
1708
"exp : exp LEX_IN NAME",
1709
"exp : exp RELOP exp",
1710
"exp : exp '<' exp",
1711
"exp : exp '>' exp",
1712
"exp : exp '?' exp ':' exp",
1715
"rexp : variable ASSIGNOP",
1716
"rexp : variable ASSIGNOP rexp",
1717
"rexp : rexp LEX_AND rexp",
1718
"rexp : rexp LEX_OR rexp",
1719
"rexp : LEX_GETLINE opt_variable input_redir",
1721
"rexp : '!' regexp",
1722
"rexp : rexp MATCHOP rexp",
1723
"rexp : rexp LEX_IN NAME",
1724
"rexp : rexp RELOP rexp",
1725
"rexp : rexp '?' rexp ':' rexp",
1728
"simp_exp : non_post_simp_exp",
1729
"simp_exp : post_inc_dec_exp",
1730
"simp_exp : simp_exp '^' simp_exp",
1731
"simp_exp : simp_exp '*' simp_exp",
1732
"simp_exp : simp_exp '/' simp_exp",
1733
"simp_exp : simp_exp '%' simp_exp",
1734
"simp_exp : simp_exp '+' simp_exp",
1735
"simp_exp : simp_exp '-' simp_exp",
1736
"non_post_simp_exp : '!' simp_exp",
1737
"non_post_simp_exp : '(' exp r_paren",
1738
"non_post_simp_exp : LEX_BUILTIN '(' opt_expression_list r_paren",
1739
"non_post_simp_exp : LEX_LENGTH '(' opt_expression_list r_paren",
1740
"non_post_simp_exp : LEX_LENGTH",
1741
"non_post_simp_exp : FUNC_CALL '(' opt_expression_list r_paren",
1742
"non_post_simp_exp : INCREMENT variable",
1743
"non_post_simp_exp : DECREMENT variable",
1744
"non_post_simp_exp : YNUMBER",
1745
"non_post_simp_exp : YSTRING",
1746
"non_post_simp_exp : '-' simp_exp",
1747
"non_post_simp_exp : '+' simp_exp",
1748
"post_inc_dec_exp : variable INCREMENT",
1749
"post_inc_dec_exp : variable DECREMENT",
1750
"post_inc_dec_exp : variable",
1751
"opt_variable : /* empty */",
1752
"opt_variable : variable",
1754
"variable : NAME '[' expression_list ']'",
1755
"variable : '$' non_post_simp_exp",
1756
"variable : '$' variable",
1757
"l_brace : '{' opt_nls",
1758
"r_brace : '}' opt_nls",
1760
"opt_semi : /* empty */",
1763
"comma : ',' opt_nls",
1765
#endif /* YYDEBUG */
1766
#line 1 "/usr/lib/yaccpar"
1767
/* @(#)yaccpar 1.10 89/04/04 SMI; from S5R3 1.10 */
1770
** Skeleton parser driver for yacc output
1774
** yacc user known macros and defines
1776
#define YYERROR goto yyerrlab
1777
#define YYACCEPT { free(yys); free(yyv); return(0); }
1778
#define YYABORT { free(yys); free(yyv); return(1); }
1779
#define YYBACKUP( newtoken, newvalue )\
1781
if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
1783
yyerror( "syntax error - cannot backup" );\
1791
#define YYRECOVERING() (!!yyerrflag)
1793
# define YYDEBUG 1 /* make debugging available */
1797
** user known globals
1799
int yydebug; /* set to 1 to get debugging */
1802
** driver internal defines
1804
#define YYFLAG (-1000)
1807
** static variables used by the parser
1809
static YYSTYPE *yyv; /* value stack */
1810
static int *yys; /* state stack */
1812
static YYSTYPE *yypv; /* top of value stack */
1813
static int *yyps; /* top of state stack */
1815
static int yystate; /* current state */
1816
static int yytmp; /* extra var (lasts between blocks) */
1818
int yynerrs; /* number of errors */
1820
int yyerrflag; /* error recovery flag */
1821
int yychar; /* current input token number */
1825
** yyparse - return 0 if worked, 1 if syntax error not recovered from
1830
register YYSTYPE *yypvt; /* top of value stack for $vars */
1831
unsigned yymaxdepth = YYMAXDEPTH;
1834
** Initialize externals - yyparse may be called more than once
1836
yyv = (YYSTYPE*)malloc(yymaxdepth*sizeof(YYSTYPE));
1837
yys = (int*)malloc(yymaxdepth*sizeof(int));
1840
yyerror( "out of memory" );
1853
register YYSTYPE *yy_pv; /* top of value stack */
1854
register int *yy_ps; /* top of state stack */
1855
register int yy_state; /* current state */
1856
register int yy_n; /* internal state number info */
1859
** get globals into registers.
1860
** branch to here only if YYBACKUP was called.
1869
** get globals into registers.
1870
** either we just started, or we just finished a reduction
1878
** top of for (;;) loop while no reductions done
1882
** put a state and value onto the stacks
1886
** if debugging, look up token value in list of value vs.
1887
** name pairs. 0 and negative (-1) are special values.
1888
** Note: linear search is used since time is not a real
1889
** consideration while debugging.
1895
(void)printf( "State %d, token ", yy_state );
1897
(void)printf( "end-of-file\n" );
1898
else if ( yychar < 0 )
1899
(void)printf( "-none-\n" );
1902
for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
1905
if ( yytoks[yy_i].t_val == yychar )
1908
(void)printf( "%s\n", yytoks[yy_i].t_name );
1911
#endif /* YYDEBUG */
1912
if ( ++yy_ps >= &yys[ yymaxdepth ] ) /* room on stack? */
1915
** reallocate and recover. Note that pointers
1916
** have to be reset, or bad things will happen
1918
int yyps_index = (yy_ps - yys);
1919
int yypv_index = (yy_pv - yyv);
1920
int yypvt_index = (yypvt - yyv);
1921
yymaxdepth += YYMAXDEPTH;
1922
yyv = (YYSTYPE*)realloc((char*)yyv,
1923
yymaxdepth * sizeof(YYSTYPE));
1924
yys = (int*)realloc((char*)yys,
1925
yymaxdepth * sizeof(int));
1928
yyerror( "yacc stack overflow" );
1931
yy_ps = yys + yyps_index;
1932
yy_pv = yyv + yypv_index;
1933
yypvt = yyv + yypvt_index;
1939
** we have a new state - find out what to do
1942
if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
1943
goto yydefault; /* simple state */
1946
** if debugging, need to mark whether new token grabbed
1950
if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
1951
yychar = 0; /* reached EOF */
1953
if ( yydebug && yytmp )
1957
(void)printf( "Received token " );
1959
(void)printf( "end-of-file\n" );
1960
else if ( yychar < 0 )
1961
(void)printf( "-none-\n" );
1964
for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
1967
if ( yytoks[yy_i].t_val == yychar )
1970
(void)printf( "%s\n", yytoks[yy_i].t_name );
1973
#endif /* YYDEBUG */
1974
if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
1976
if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar ) /*valid shift*/
1981
if ( yyerrflag > 0 )
1987
if ( ( yy_n = yydef[ yy_state ] ) == -2 )
1992
if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
1993
yychar = 0; /* reached EOF */
1995
if ( yydebug && yytmp )
1999
(void)printf( "Received token " );
2001
(void)printf( "end-of-file\n" );
2002
else if ( yychar < 0 )
2003
(void)printf( "-none-\n" );
2007
yytoks[yy_i].t_val >= 0;
2010
if ( yytoks[yy_i].t_val
2016
(void)printf( "%s\n", yytoks[yy_i].t_name );
2019
#endif /* YYDEBUG */
2021
** look through exception table
2024
register int *yyxi = yyexca;
2026
while ( ( *yyxi != -1 ) ||
2027
( yyxi[1] != yy_state ) )
2031
while ( ( *(yyxi += 2) >= 0 ) &&
2032
( *yyxi != yychar ) )
2034
if ( ( yy_n = yyxi[1] ) < 0 )
2040
** check for syntax error
2042
if ( yy_n == 0 ) /* have an error */
2044
/* no worry about speed here! */
2045
switch ( yyerrflag )
2047
case 0: /* new error */
2048
yyerror( "syntax error" );
2052
** get globals into registers.
2053
** we have a user generated syntax type error
2061
case 2: /* incompletely recovered error */
2065
** find state where "error" is a legal
2068
while ( yy_ps >= yys )
2070
yy_n = yypact[ *yy_ps ] + YYERRCODE;
2071
if ( yy_n >= 0 && yy_n < YYLAST &&
2072
yychk[yyact[yy_n]] == YYERRCODE) {
2074
** simulate shift of "error"
2076
yy_state = yyact[ yy_n ];
2080
** current state has no shift on
2081
** "error", pop stack
2084
# define _POP_ "Error recovery pops state %d, uncovers state %d\n"
2086
(void)printf( _POP_, *yy_ps,
2094
** there is no state on stack with "error" as
2095
** a valid shift. give up.
2098
case 3: /* no shift yet; eat a token */
2101
** if debugging, look up token in list of
2102
** pairs. 0 and negative shouldn't occur,
2103
** but since timing doesn't matter when
2104
** debugging, it doesn't hurt to leave the
2111
(void)printf( "Error recovery discards " );
2113
(void)printf( "token end-of-file\n" );
2114
else if ( yychar < 0 )
2115
(void)printf( "token -none-\n" );
2119
yytoks[yy_i].t_val >= 0;
2122
if ( yytoks[yy_i].t_val
2128
(void)printf( "token %s\n",
2129
yytoks[yy_i].t_name );
2132
#endif /* YYDEBUG */
2133
if ( yychar == 0 ) /* reached EOF. quit */
2138
}/* end if ( yy_n == 0 ) */
2140
** reduction by production yy_n
2141
** put stack tops, etc. so things right after switch
2145
** if debugging, print the string that is the user's
2146
** specification of the reduction which is just about
2150
(void)printf( "Reduce by (%d) \"%s\"\n",
2151
yy_n, yyreds[ yy_n ] );
2153
yytmp = yy_n; /* value to switch over */
2154
yypvt = yy_pv; /* $vars top of value stack */
2156
** Look in goto table for next state
2157
** Sorry about using yy_state here as temporary
2158
** register variable, but why not, if it works...
2159
** If yyr2[ yy_n ] doesn't have the low order bit
2160
** set, then there is no action to be done for
2161
** this reduction. So, no saving & unsaving of
2162
** registers done. The only difference between the
2163
** code just after the if and the body of the if is
2164
** the goto yy_stack in the body. This way the test
2165
** can be made before the choice of what to do is needed.
2168
/* length of production doubled with extra bit */
2169
register int yy_len = yyr2[ yy_n ];
2171
if ( !( yy_len & 01 ) )
2174
yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
2175
yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
2176
*( yy_ps -= yy_len ) + 1;
2177
if ( yy_state >= YYLAST ||
2179
yyact[ yy_state ] ] != -yy_n )
2181
yy_state = yyact[ yypgo[ yy_n ] ];
2186
yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
2187
yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
2188
*( yy_ps -= yy_len ) + 1;
2189
if ( yy_state >= YYLAST ||
2190
yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
2192
yy_state = yyact[ yypgo[ yy_n ] ];
2195
/* save until reenter driver code */
2201
** code supplied by user is placed in this switch
2208
{ expression_value = yypvt[-1].nodeval; } break;
2212
if (yypvt[-0].nodeval != NULL)
2213
yyval.nodeval = yypvt[-0].nodeval;
2215
yyval.nodeval = NULL;
2221
if (yypvt[-0].nodeval == NULL)
2222
yyval.nodeval = yypvt[-1].nodeval;
2223
else if (yypvt[-1].nodeval == NULL)
2224
yyval.nodeval = yypvt[-0].nodeval;
2226
if (yypvt[-1].nodeval->type != Node_rule_list)
2227
yypvt[-1].nodeval = node(yypvt[-1].nodeval, Node_rule_list,
2229
yyval.nodeval = append_right (yypvt[-1].nodeval,
2230
node(yypvt[-0].nodeval, Node_rule_list,(NODE *) NULL));
2236
{ yyval.nodeval = NULL; } break;
2239
{ yyval.nodeval = NULL; } break;
2242
{ io_allowed = 0; } break;
2247
if (begin_block->type != Node_rule_list)
2248
begin_block = node(begin_block, Node_rule_list,
2250
(void) append_right (begin_block, node(
2251
node((NODE *)NULL, Node_rule_node, yypvt[-0].nodeval),
2252
Node_rule_list, (NODE *)NULL) );
2254
begin_block = node((NODE *)NULL, Node_rule_node, yypvt[-0].nodeval);
2255
yyval.nodeval = NULL;
2261
{ io_allowed = 0; } break;
2266
if (end_block->type != Node_rule_list)
2267
end_block = node(end_block, Node_rule_list,
2269
(void) append_right (end_block, node(
2270
node((NODE *)NULL, Node_rule_node, yypvt[-0].nodeval),
2271
Node_rule_list, (NODE *)NULL));
2273
end_block = node((NODE *)NULL, Node_rule_node, yypvt[-0].nodeval);
2274
yyval.nodeval = NULL;
2281
warning("BEGIN blocks must have an action part");
2288
warning("END blocks must have an action part");
2294
{ yyval.nodeval = node (yypvt[-1].nodeval, Node_rule_node, yypvt[-0].nodeval); yyerrok; } break;
2297
{ yyval.nodeval = node ((NODE *)NULL, Node_rule_node, yypvt[-0].nodeval); yyerrok; } break;
2301
yyval.nodeval = node (yypvt[-1].nodeval,
2303
node(node(node(make_number(0.0),
2306
Node_expression_list,
2315
func_install(yypvt[-1].nodeval, yypvt[-0].nodeval);
2316
yyval.nodeval = NULL;
2321
{ yyval.sval = yypvt[-0].sval; } break;
2324
{ yyval.sval = yypvt[-0].sval; } break;
2333
yyval.nodeval = append_right(make_param(yypvt[-4].sval), yypvt[-2].nodeval);
2339
yyval.nodeval = yypvt[-2].nodeval;
2344
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2347
{ yyval.nodeval = mkrangenode ( node(yypvt[-2].nodeval, Node_cond_pair, yypvt[-0].nodeval) ); } break;
2350
{ ++want_regexp; } break;
2357
n->type = Node_regex;
2358
n->re_exp = make_string(yypvt[-1].sval, strlen(yypvt[-1].sval));
2359
n->re_reg = mk_re_parse(yypvt[-1].sval, 0);
2361
n->re_flags = CONST;
2367
{ yyval.nodeval = yypvt[-2].nodeval ; } break;
2370
{ yyval.nodeval = NULL; } break;
2373
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2377
if (yypvt[-1].nodeval == NULL || yypvt[-1].nodeval->type != Node_statement_list)
2378
yypvt[-1].nodeval = node(yypvt[-1].nodeval, Node_statement_list,(NODE *)NULL);
2379
yyval.nodeval = append_right(yypvt[-1].nodeval,
2380
node( yypvt[-0].nodeval, Node_statement_list, (NODE *)NULL));
2385
{ yyval.nodeval = NULL; } break;
2388
{ yyval.nodeval = NULL; } break;
2391
{ yyval.nodeval = NULL; } break;
2394
{ yyval.nodeval = NULL; } break;
2397
{ yyval.nodeval = yypvt[-1].nodeval; } break;
2400
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2403
{ yyval.nodeval = node (yypvt[-3].nodeval, Node_K_while, yypvt[-0].nodeval); } break;
2406
{ yyval.nodeval = node (yypvt[-2].nodeval, Node_K_do, yypvt[-5].nodeval); } break;
2410
yyval.nodeval = node (yypvt[-0].nodeval, Node_K_arrayfor, make_for_loop(variable(yypvt[-5].sval,1),
2411
(NODE *)NULL, variable(yypvt[-3].sval,1)));
2416
yyval.nodeval = node(yypvt[-0].nodeval, Node_K_for, (NODE *)make_for_loop(yypvt[-7].nodeval, yypvt[-5].nodeval, yypvt[-3].nodeval));
2421
yyval.nodeval = node (yypvt[-0].nodeval, Node_K_for,
2422
(NODE *)make_for_loop(yypvt[-6].nodeval, (NODE *)NULL, yypvt[-3].nodeval));
2426
{ yyval.nodeval = node ((NODE *)NULL, Node_K_break, (NODE *)NULL); } break;
2429
{ yyval.nodeval = node ((NODE *)NULL, Node_K_continue, (NODE *)NULL); } break;
2432
{ yyval.nodeval = node (yypvt[-3].nodeval, yypvt[-5].nodetypeval, yypvt[-1].nodeval); } break;
2436
if (yypvt[-3].nodetypeval == Node_K_print && yypvt[-2].nodeval == NULL)
2437
yypvt[-2].nodeval = node(node(make_number(0.0),
2440
Node_expression_list,
2443
yyval.nodeval = node (yypvt[-2].nodeval, yypvt[-3].nodetypeval, yypvt[-1].nodeval);
2447
{ if (! io_allowed) yyerror("next used in BEGIN or END action"); } break;
2450
{ yyval.nodeval = node ((NODE *)NULL, Node_K_next, (NODE *)NULL); } break;
2453
{ yyval.nodeval = node (yypvt[-1].nodeval, Node_K_exit, (NODE *)NULL); } break;
2456
{ if (! can_return) yyerror("return used outside function context"); } break;
2459
{ yyval.nodeval = node (yypvt[-1].nodeval, Node_K_return, (NODE *)NULL); } break;
2462
{ yyval.nodeval = node (variable(yypvt[-4].sval,1), Node_K_delete, yypvt[-2].nodeval); } break;
2465
{ yyval.nodeval = yypvt[-1].nodeval; } break;
2468
{ yyval.nodetypeval = yypvt[-0].nodetypeval; } break;
2471
{ yyval.nodetypeval = yypvt[-0].nodetypeval; } break;
2475
yyval.nodeval = node(yypvt[-3].nodeval, Node_K_if,
2476
node(yypvt[-0].nodeval, Node_if_branches, (NODE *)NULL));
2480
{ yyval.nodeval = node (yypvt[-6].nodeval, Node_K_if,
2481
node (yypvt[-3].nodeval, Node_if_branches, yypvt[-0].nodeval)); } break;
2484
{ want_assign = 0; } break;
2487
{ yyval.nodeval = NULL; } break;
2490
{ yyval.nodeval = node (yypvt[-0].nodeval, Node_redirect_input, (NODE *)NULL); } break;
2493
{ yyval.nodeval = NULL; } break;
2496
{ yyval.nodeval = node (yypvt[-0].nodeval, Node_redirect_output, (NODE *)NULL); } break;
2499
{ yyval.nodeval = node (yypvt[-0].nodeval, Node_redirect_append, (NODE *)NULL); } break;
2502
{ yyval.nodeval = node (yypvt[-0].nodeval, Node_redirect_pipe, (NODE *)NULL); } break;
2505
{ yyval.nodeval = NULL; } break;
2508
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2511
{ yyval.nodeval = make_param(yypvt[-0].sval); } break;
2514
{ yyval.nodeval = append_right(yypvt[-2].nodeval, make_param(yypvt[-0].sval)); yyerrok; } break;
2517
{ yyval.nodeval = NULL; } break;
2520
{ yyval.nodeval = NULL; } break;
2523
{ yyval.nodeval = NULL; } break;
2526
{ yyval.nodeval = NULL; } break;
2529
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2532
{ yyval.nodeval = NULL; } break;
2535
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2538
{ yyval.nodeval = node (yypvt[-0].nodeval, Node_expression_list, (NODE *)NULL); } break;
2542
yyval.nodeval = append_right(yypvt[-2].nodeval,
2543
node( yypvt[-0].nodeval, Node_expression_list, (NODE *)NULL));
2548
{ yyval.nodeval = NULL; } break;
2551
{ yyval.nodeval = NULL; } break;
2554
{ yyval.nodeval = NULL; } break;
2557
{ yyval.nodeval = NULL; } break;
2560
{ yyval.nodeval = NULL; } break;
2563
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2566
{ yyval.nodeval = node (yypvt[-0].nodeval, Node_expression_list, (NODE *)NULL); } break;
2570
yyval.nodeval = append_right(yypvt[-2].nodeval,
2571
node( yypvt[-0].nodeval, Node_expression_list, (NODE *)NULL));
2576
{ yyval.nodeval = NULL; } break;
2579
{ yyval.nodeval = NULL; } break;
2582
{ yyval.nodeval = NULL; } break;
2585
{ yyval.nodeval = NULL; } break;
2588
{ want_assign = 0; } break;
2591
{ yyval.nodeval = node (yypvt[-3].nodeval, yypvt[-2].nodetypeval, yypvt[-0].nodeval); } break;
2594
{ yyval.nodeval = node (variable(yypvt[-0].sval,1), Node_in_array, yypvt[-3].nodeval); } break;
2598
yyval.nodeval = node (yypvt[-0].nodeval, Node_K_getline,
2599
node (yypvt[-3].nodeval, Node_redirect_pipein, (NODE *)NULL));
2604
if (do_lint && ! io_allowed && yypvt[-0].nodeval == NULL)
2605
warning("non-redirected getline undefined inside BEGIN or END action");
2606
yyval.nodeval = node (yypvt[-1].nodeval, Node_K_getline, yypvt[-0].nodeval);
2610
{ yyval.nodeval = node (yypvt[-2].nodeval, Node_and, yypvt[-0].nodeval); } break;
2613
{ yyval.nodeval = node (yypvt[-2].nodeval, Node_or, yypvt[-0].nodeval); } break;
2617
if (yypvt[-2].nodeval->type == Node_regex)
2618
warning("Regular expression on left of MATCH operator.");
2619
yyval.nodeval = node (yypvt[-2].nodeval, yypvt[-1].nodetypeval, mk_rexp(yypvt[-0].nodeval));
2623
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2627
yyval.nodeval = node(node(make_number(0.0),
2635
{ yyval.nodeval = node (variable(yypvt[-0].sval,1), Node_in_array, yypvt[-2].nodeval); } break;
2638
{ yyval.nodeval = node (yypvt[-2].nodeval, yypvt[-1].nodetypeval, yypvt[-0].nodeval); } break;
2641
{ yyval.nodeval = node (yypvt[-2].nodeval, Node_less, yypvt[-0].nodeval); } break;
2644
{ yyval.nodeval = node (yypvt[-2].nodeval, Node_greater, yypvt[-0].nodeval); } break;
2647
{ yyval.nodeval = node(yypvt[-4].nodeval, Node_cond_exp, node(yypvt[-2].nodeval, Node_if_branches, yypvt[-0].nodeval));} break;
2650
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2653
{ yyval.nodeval = node (yypvt[-1].nodeval, Node_concat, yypvt[-0].nodeval); } break;
2656
{ want_assign = 0; } break;
2659
{ yyval.nodeval = node (yypvt[-3].nodeval, yypvt[-2].nodetypeval, yypvt[-0].nodeval); } break;
2662
{ yyval.nodeval = node (yypvt[-2].nodeval, Node_and, yypvt[-0].nodeval); } break;
2665
{ yyval.nodeval = node (yypvt[-2].nodeval, Node_or, yypvt[-0].nodeval); } break;
2669
if (do_lint && ! io_allowed && yypvt[-0].nodeval == NULL)
2670
warning("non-redirected getline undefined inside BEGIN or END action");
2671
yyval.nodeval = node (yypvt[-1].nodeval, Node_K_getline, yypvt[-0].nodeval);
2675
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2678
{ yyval.nodeval = node((NODE *) NULL, Node_nomatch, yypvt[-0].nodeval); } break;
2681
{ yyval.nodeval = node (yypvt[-2].nodeval, yypvt[-1].nodetypeval, mk_rexp(yypvt[-0].nodeval)); } break;
2684
{ yyval.nodeval = node (variable(yypvt[-0].sval,1), Node_in_array, yypvt[-2].nodeval); } break;
2687
{ yyval.nodeval = node (yypvt[-2].nodeval, yypvt[-1].nodetypeval, yypvt[-0].nodeval); } break;
2690
{ yyval.nodeval = node(yypvt[-4].nodeval, Node_cond_exp, node(yypvt[-2].nodeval, Node_if_branches, yypvt[-0].nodeval));} break;
2693
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2696
{ yyval.nodeval = node (yypvt[-1].nodeval, Node_concat, yypvt[-0].nodeval); } break;
2699
{ yyval.nodeval = node (yypvt[-2].nodeval, Node_exp, yypvt[-0].nodeval); } break;
2702
{ yyval.nodeval = node (yypvt[-2].nodeval, Node_times, yypvt[-0].nodeval); } break;
2705
{ yyval.nodeval = node (yypvt[-2].nodeval, Node_quotient, yypvt[-0].nodeval); } break;
2708
{ yyval.nodeval = node (yypvt[-2].nodeval, Node_mod, yypvt[-0].nodeval); } break;
2711
{ yyval.nodeval = node (yypvt[-2].nodeval, Node_plus, yypvt[-0].nodeval); } break;
2714
{ yyval.nodeval = node (yypvt[-2].nodeval, Node_minus, yypvt[-0].nodeval); } break;
2717
{ yyval.nodeval = node (yypvt[-0].nodeval, Node_not,(NODE *) NULL); } break;
2720
{ yyval.nodeval = yypvt[-1].nodeval; } break;
2723
{ yyval.nodeval = snode (yypvt[-1].nodeval, Node_builtin, (int) yypvt[-3].lval); } break;
2726
{ yyval.nodeval = snode (yypvt[-1].nodeval, Node_builtin, (int) yypvt[-3].lval); } break;
2729
{ yyval.nodeval = snode ((NODE *)NULL, Node_builtin, (int) yypvt[-0].lval); } break;
2733
yyval.nodeval = node (yypvt[-1].nodeval, Node_func_call, make_string(yypvt[-3].sval, strlen(yypvt[-3].sval)));
2737
{ yyval.nodeval = node (yypvt[-0].nodeval, Node_preincrement, (NODE *)NULL); } break;
2740
{ yyval.nodeval = node (yypvt[-0].nodeval, Node_predecrement, (NODE *)NULL); } break;
2743
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2746
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2749
{ if (yypvt[-0].nodeval->type == Node_val) {
2750
yypvt[-0].nodeval->numbr = -(force_number(yypvt[-0].nodeval));
2751
yyval.nodeval = yypvt[-0].nodeval;
2753
yyval.nodeval = node (yypvt[-0].nodeval, Node_unary_minus, (NODE *)NULL);
2757
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2760
{ yyval.nodeval = node (yypvt[-1].nodeval, Node_postincrement, (NODE *)NULL); } break;
2763
{ yyval.nodeval = node (yypvt[-1].nodeval, Node_postdecrement, (NODE *)NULL); } break;
2766
{ yyval.nodeval = NULL; } break;
2769
{ yyval.nodeval = yypvt[-0].nodeval; } break;
2772
{ yyval.nodeval = variable(yypvt[-0].sval,1); } break;
2776
if (yypvt[-1].nodeval->rnode == NULL) {
2777
yyval.nodeval = node (variable(yypvt[-3].sval,1), Node_subscript, yypvt[-1].nodeval->lnode);
2778
freenode(yypvt[-1].nodeval);
2780
yyval.nodeval = node (variable(yypvt[-3].sval,1), Node_subscript, yypvt[-1].nodeval);
2784
{ yyval.nodeval = node (yypvt[-0].nodeval, Node_field_spec, (NODE *)NULL); } break;
2787
{ yyval.nodeval = node (yypvt[-0].nodeval, Node_field_spec, (NODE *)NULL); } break;
2796
{ yyerrok; want_assign = 0; } break;
2801
goto yystack; /* reset registers in driver code */