summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 12:35:31 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 12:35:31 +0300
commit8ceb5f934787eb7be5fb452fb39179df66119954 (patch)
tree56a80fc5c118f7c2ebad7ab44bd8be048b2f7ec2
parent2f83a4e72166e811a9f0b4726c19a3d5a0b17dcb (diff)
downloadgawk-8ceb5f934787eb7be5fb452fb39179df66119954.tar.gz
Move to gawk-2.15.6.gawk-2.15.6
-rw-r--r--ACKNOWLEDGMENT21
-rw-r--r--FUTURES2
-rw-r--r--Makefile.in9
-rw-r--r--NEWS108
-rw-r--r--README.FIRST21
-rw-r--r--README.pc65
-rw-r--r--README.yacc7
-rw-r--r--awk.h13
-rw-r--r--awk.y246
-rw-r--r--awktab.c1879
-rw-r--r--builtin.c24
-rw-r--r--config/cray603
-rw-r--r--config/gnu6
-rw-r--r--config/lynxos10
-rw-r--r--config/sgi4051
-rw-r--r--config/vms-posix1
-rw-r--r--dfa.c1
-rw-r--r--eval.c77
-rw-r--r--field.c19
-rw-r--r--gawk.137
-rw-r--r--io.c26
-rw-r--r--iop.c11
-rw-r--r--main.c36
-rw-r--r--msg.c16
-rw-r--r--node.c8
-rw-r--r--patchlevel.h2
-rw-r--r--re.c20
-rw-r--r--regex.c12
-rw-r--r--regex.h5
-rw-r--r--test/Makefile44
-rw-r--r--test/arrayparm.awk21
-rw-r--r--test/arrayparm.good1
-rw-r--r--test/convfmt.awk10
-rw-r--r--test/convfmt.good3
-rw-r--r--test/nonl.awk1
-rw-r--r--test/nonl.good1
-rw-r--r--test/paramdup.awk8
-rw-r--r--test/paramdup.good2
-rw-r--r--vms/descrip.mms2
-rw-r--r--vms/gawk.hlp53
-rw-r--r--vms/vms_args.c34
-rw-r--r--vms/vms_fwrite.c6
-rw-r--r--vms/vmsbuild.com2
43 files changed, 1785 insertions, 1089 deletions
diff --git a/ACKNOWLEDGMENT b/ACKNOWLEDGMENT
index cb4021f7..a17a2eba 100644
--- a/ACKNOWLEDGMENT
+++ b/ACKNOWLEDGMENT
@@ -3,22 +3,31 @@ many people who have contributed to the development through bug reports
and fixes and suggestions. Unfortunately, we have not been organized
enough to keep track of all the names -- for that we apologize.
-Another group of people have assisted even more by porting Gawk to new
-platforms and providing a great deal of feedback. They are:
+The following people were involved in porting gawk to different platforms.
- Hal Peterson <hrp@pecan.cray.com> (Cray)
- Pat Rankin <gawk.rankin@EQL.Caltech.Edu> (VMS)
- Michal Jaegermann <michal@gortel.phys.UAlberta.CA> (Atari, NeXT, DEC 3100)
Mike Lijewski <mjlx@eagle.cnsf.cornell.edu> (IBM RS6000)
- Scott Deifik <scottd@amgen.com> (MSDOS 2.14 and 2.15)
Kent Williams (MSDOS 2.11)
Conrad Kwok (MSDOS earlier versions)
Scott Garfinkle (MSDOS earlier versions)
+
+This group of people comprise the "GAWK crack portability team", who
+test the pre-releases and ensure portability of gawk.
+
+ Hal Peterson <hrp@pecan.cray.com> (Cray)
+ Pat Rankin <gawk.rankin@EQL.Caltech.Edu> (VMS)
+ Michal Jaegermann <michal@gortel.phys.UAlberta.CA>
+ (Atari, NeXT, DEC 3100)
+ Scott Deifik <scottd@amgen.com> (MSDOS 2.14 and 2.15)
Kai Uwe Rommel <rommel@ars.muc.de> (OS/2)
Darrel Hankerson <hankedr@mail.auburn.edu> (OS/2)
Mark Moraes <Mark-Moraes@deshaw.com> (Code Center, Purify)
Kaveh Ghazi <ghazi@noc.rutgers.edu> (Lots of Unix variants)
+Michal, Scott and Darrel go out of their way to make sure that gawk
+works on non-32 bit systems, and keep me on track where portability is
+concerned. Indeed, all of these folks are incredibly helpful; gawk would
+not be the fine program it is now without them.
+
Last, but far from least, we would like to thank Brian Kernighan who
has helped to clear up many dark corners of the language and provided a
restraining touch when we have been overly tempted by "feeping
diff --git a/FUTURES b/FUTURES
index 6250584f..87fda5df 100644
--- a/FUTURES
+++ b/FUTURES
@@ -16,8 +16,6 @@ x Generalize IGNORECASE
any value makes it work, not just numeric non-zero
make it apply to *all* string comparisons
-x Fix FILENAME to have an initial value of "", not "-"
-
In 2.17
=======
x Allow RS to be a regexp.
diff --git a/Makefile.in b/Makefile.in
index b7d7c0ab..a676ebe9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,6 +1,6 @@
# Makefile for GNU Awk.
#
-# Copyright (C) 1986, 1988-1993 the Free Software Foundation, Inc.
+# Copyright (C) 1986, 1988-1995 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Progamming Language.
@@ -83,7 +83,8 @@ VFLAGS=
##MAKE_Apollo## LIBS = -A sys,any
# SGI IRIX 4.0.5 cc flags
-##MAKE_SGI## VFLAGS = -cckr
+##MAKE_SGI## VFLAGS = -cckr -signed
+##MAKE_SGI_GCC## VFLAGS = -fsigned-char
##MAKE_NeXT## VFLAGS = -DGFMT_WORKAROUND
@@ -151,7 +152,7 @@ main.o: patchlevel.h
awktab.c: awk.y
$(PARSER) -v awk.y
-##MAKE_VMS-Posix## mv ytab.c awktab.c
+##MAKE_VMS-Posix## sed '/^\#module/d' ytab.c >awktab.c && rm ytab.c
##MAKE_VMS-Posix## dummy.awk_tab.target:
sed '/^extern char .malloc(), .realloc();$$/d' y.tab.c >awktab.c
rm y.tab.c
@@ -164,7 +165,7 @@ config.h: config.in
@echo or copy config.in to config.h and edit it.; exit 1
install: gawk gawk.info
- cp gawk $(bindir) && chmod 755 $(bindir)/gawk
+ cp gawk $(bindir)/gawk && chmod 755 $(bindir)/gawk
cp gawk.1 $(mandir)/gawk$(manext) && chmod 644 $(mandir)/gawk$(manext)
cp gawk.info* $(infodir) && chmod 644 $(infodir)/gawk.info*
diff --git a/NEWS b/NEWS
index 4df69e7d..85f7d155 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,111 @@
+Changes from 2.15.5 to 2.15.6
+-----------------------------
+
+Copyrights updated on all changed files.
+
+test directory enhanced with four new tests.
+
+Gawk now generates a warning for \x without following hexadecimal digits.
+In this case, it returns 'x', not \0.
+
+Several fixes in main.c related to variable initialization:
+ CONVFMT has a default value
+ resetup is called before initializing variables
+ the varinit table fixed up a bit (see the comments)
+
+gawk.1 updated with new BUG REPORTS section.
+
+A plain `print' inside a BEGIN or END now generates a lint warning (awk.y).
+
+Small fix in iop.c:get_a_record to avoid reading uninitialized memory.
+
+awk.y:yylex now does a better job of handling things if the source file
+does not end in a newline. Probably there is more work to be done.
+
+Memory leaks fixed in awk.y, particularly in cases of duplicate function
+parameters. Also, calling a function doesn't leak memory during parsing.
+
+Empty function bodies are now allowed (awk.y).
+
+Gawk now detects duplicate parameter names in functions (awk.y).
+
+New function `error' in msg.c added for use from awk.y.
+
+eval.c:r_get_lhs now checks if its argument is a parameter on the stack,
+and pulls down the real variable. This catches more 'using an array as
+a scalar' kinds of errors.
+
+main.c recovers C alloca space after parsing, this is important for
+bison-based parsers. re.c recovers C alloca space after doing an research.
+[Changes from Pat Rankin]
+
+builtin.c now declares the random() related functions based on
+RANDOM_MISSING from config.h. [Suggested by Pat Rankin]
+
+awk.h now handles alloca correctly for HP-UX. [Kaveh Ghazi]
+
+regex.h and config/cray60 updated for Unicos 8.0. [Hal Peterson]
+
+Fixed re.c and dfa.c so that gawk no longer leaks memory when using
+lots of dynamic regexps.
+
+Removed dependency on signed chars from `idx' variable in awk.h. Gawk
+now passes its test suite if compiled with `gcc -fno-signed-char'.
+
+Fixed warning on close in io.c to go under lint control. Too many people
+have complained about the spurious message, particularly when closing a
+child pipeline early.
+
+Gawk now correctly handles RS = "" when input is from a terminal
+(iop.c:get_a_record).
+
+Config file added for GNU.
+
+gawk 'BEGIN { exit 1 } ; END { exit }' now exits 1, as it should
+(eval.c:interpret).
+
+sub and gsub now follow posix, \ escapes both & and \. Each \ must
+be doubled initially in the program to get it into the string.
+Thanks to Mike Brennan for pointing this out (builtin.c:sub_common).
+
+If FS is "", gawk behaves like mawk and nawk, making the whole record be $1.
+Yet Another Dark Corner. Sigh (field.c:def_parse_field).
+
+Gawk now correctly recomputes string values for numbers if CONVFMT has
+changed (awk.h:force_string, node.c:r_force_string).
+
+A regexp of the form `/* this looks like a comment but is not */' will
+now generate a warning from --lint (awk.y).
+
+Gawk will no longer core dump if given an empty input file (awk.y:get_src_buf,
+iop.c:optimal_bufsize).
+
+A printf format of the form %lf is handled correctly. The `l' generates
+a lint warning (builtin.c:format_tree) [Thanks to Mark Moraes].
+
+Lynxos config file added.
+
+`continue' outside a loop treated as `next' only in compatibility mode,
+instead of by default; recent att nawk chokes on this now. `break'
+outside a loop now treated as `next' in compatibility mode (eval.c).
+
+Bug fix in string concatenation, an arbitrary number of expressions
+are allowed (eval.c).
+
+$1 += $2 now works correctly (eval.c).
+
+Changing IGNORECASE no longer resets field-splitting to FS if it was
+using FIELDWIDTHS (eval.c, field.c).
+
+Major enhancement: $0 and NF for last record read are now preserved
+into the END rule (io.c).
+
+Regexp fixes:
+ /./ now matches a newline (regex.h)
+ ^ and $ match beginning and end of string only, not any embedded
+ newlines (re.c)
+ regex.c should compile and work ok on 64-bit mips/sgi machines
+
Changes from 2.15.4 to 2.15.5
-----------------------------
diff --git a/README.FIRST b/README.FIRST
new file mode 100644
index 00000000..25c987ba
--- /dev/null
+++ b/README.FIRST
@@ -0,0 +1,21 @@
+Sat Feb 18 23:07:55 EST 1995
+
+Starting with 2.15.6, gawk will preserve the value of NF and $0 for
+the last record read into the END rule(s). This is important to you
+if your program uses
+
+ print
+
+in an END rule to mean
+
+ print ""
+
+(i.e., print nothing). Examine your awk programs carefully to make sure
+that they use `print ""' instead of `print', otherwise you will get
+strange results.
+
+If you send me email about this, without having read this
+file, I will yell at you.
+
+Arnold Robbins
+arnold@skeeve.atl.ga.us
diff --git a/README.pc b/README.pc
index 9cac2a69..74b452da 100644
--- a/README.pc
+++ b/README.pc
@@ -1,7 +1,7 @@
This is the README for GNU awk 2.15 under OS/2 and MS-DOS.
Gawk has been compiled and tested under OS/2 1.x--2.x and MS-DOS
-using MSC 5.1, MSC 6.00A, and EMX/gcc 0.8g.
+using MSC 5.1, MSC 6.00A, and EMX/gcc 0.8[gh].
Compiling for DOS from a DOS (or OS/2) host
@@ -10,7 +10,7 @@ Compiling for DOS from a DOS (or OS/2) host
Move the stuff in the pc directory to the directory with the rest
of the gawk sources. The files Makefile.emx (for EMX/gcc) and
Makefile.msc (for MSC 5.1 or 6.00A) should work with any Unix-like
-make, including Ndmake 4.5 and dmake 3.8.
+make, including Ndmake 4.5 and dmake.
An alternative makegawk.bat file exists for compiling with MSC 5.1
or 6.00A. You may need to put CRs at the end of each line in the
@@ -31,7 +31,7 @@ this file.
Compiling for OS/2 or DOS from an OS/2 host
-------------------------------------------
- Move the files in the pc dirctory to the directory with the rest
+ Move the files in the pc directory to the directory with the rest
of the gawk sources. Makefile.os2 has been tested with dmake 3.8
and GNU make 3.68. Enter "make -f Makefile.os2" to see a list of
targets. As an example, an OS/2 and DOS 32-bit executable using
@@ -40,28 +40,40 @@ EMX/gcc can be created with the command "make -f Makefile.os2 emxbnd".
If using MSC 5.1, you will also have to copy the Microsoft library
routine setargv.obj to the gawk directory for the link to work.
-
Notes
-----
1. The usual shells for OS/2 and DOS (command.com for DOS and cmd.exe
for OS/2) do not handle command-lines very well. Stewartson's sh (OS/2
-and DOS) and GNU bash (OS/2 2.x) are good choices. Stewartson's shell
-2.2 is in beta (as of 17-Sep-93). Earlier versions can be found at
+and DOS) is a good choice, and can be found at:
+
+ oak.oakland.edu:SimTel/msdos/sysutil/ms_sh23[bs].zip
+ ftp-os2.cdrom.com:pub/os2/16bit/unix/ms_sh23[bs].zip
+ ftp.leo.org:pub/comp/os/os2/shells/ms_sh23b.zip
+
+An earlier version can be found at
- ftp.informatik.tu-muenchen.de:pub/comp/os/os2/shells/sh164-2.zip
- oak.oakland.edu:pub/msdos/sysutl/ms_sh21b.zip
- ftp-os2.cdrom.com:pub/os2/all/unix/shells/ms_sh21c.zip
+ ftp.leo.org:pub/comp/os/os2/shells/sh164-2.zip
-OS/2 HPFS users should obtain ms_sh21c.zip over ms_sh21b.zip.
The Korn shell (ksh) may be another possibility:
+
+ ftp-os2.cdrom.com:pub/os2/32bit/unix/ksh49.zip
+ ftp.leo.org:pub/comp/os/os2/shells/ksh513rt.zip
- ftp.informatik.tu-muenchen.de:pub/comp/os/os2/shells/ksh48.zip
+Bash (OS/2 2.x) should be a good choice; however, there has been some
+trouble getting a solid version for OS/2. As of Feb-95, there are two
+bash ports, available in:
-Bash for OS/2 2.x can be found at
+ ftp.leo.org:pub/comp/os/os2/shells/gnu/gnubash.zip
+ ftp.leo.org:pub/comp/os/os2/shells/gnu/bash-112.zip
+ ftp-os2.cdrom.com:pub/os2/32bit/unix/bash_112.zip
- ftp.informatik.tu-muenchen.de:pub/comp/os/os2/shells/gnu/gnubash.zip
- ftp-os2.cdrom.com:pub/os2/2_x/unix/shells/bash.zip
+Hamilton's C Shell is another possibility, available for a number of
+platforms. A demo is available at ftp.leo.org.
+
+The site ftp.leo.org (ftp.informatik.tu-muenchen.de) is maintained
+by Kai Uwe Rommel (rommel@leo.org), and is also accessible at
+http://www.leo.org/archiv/os2/ via WWW.
2. Stewartson's shell contains sources for a setargv-replacement
@@ -70,31 +82,21 @@ to gawk. See Makefile.os2.
3. dmake is by Dennis Vadura (dvadura@watdragon.uwaterloo.ca), CS Dept.,
-University of Waterloo. An OS/2 and DOS version can be found at
+University of Waterloo. OS/2 and DOS versions can be found at
- ftp.informatik.tu-muenchen.de:pub/comp/os/os2/devtools/dmake38.zip
- ftp-os2.cdrom.com:pub/os2/all/program/dmake38x.zip
+ ftp.leo.org:pub/comp/os/os2/devtools/utils/dmake38.zip
+ ftp.leo.org:pub/comp/os/os2/devtools/utils/dmake40os2.zip
+ ftp-os2.cdrom.com:pub/os2/16bit/program/dmake38x.zip
Ndmake is by D.G. Kneller. This ShareWare program was later released
as Opus Make (which is available for OS/2 and DOS). Ndmake 4.5 is
available at
- oak.oakland.edu:pub/msdos/c/ndmake45.zip
+ oak.oakland.edu:SimTel/msdos/c/ndmake45.zip
GNU make is from the FSF. An OS/2 2.x version can be found at
- ftp.informatik.tu-muenchen.de:pub/comp/os/os2/devtools/gnumake.zip
-
-The "lookup" feature of ncftp reports:
-
- ncftp>lookup ftp.informatik.tu-muenchen.de
- hpsystem2.informatik.tu-muenchen.de 131.159.0.198
-
- ncftp>lookup ftp-os2.cdrom.com
- wcarchive.cdrom.com 192.153.46.2
-
- ncftp>lookup oak.oakland.edu
- rigel.acs.oakland.edu 141.210.10.117
+ ftp.leo.org:pub/comp/os/os2/devtools/gnu/gnumake.zip
4. Known bugs. The MSC 5.1 bound version has not received extensive
@@ -102,6 +104,9 @@ testing. When running under OS/2 2.1, there is a bug which may be
related to the 20-file limit. It can be observed in the "manyfiles"
test of test/Makefile. This does not occur when running under DOS.
+The 16-bit DOS version can exhaust memory on scripts such as Henry
+Spencer's "awf". Use the 32-bit version if possible.
+
----
diff --git a/README.yacc b/README.yacc
new file mode 100644
index 00000000..9c5de13a
--- /dev/null
+++ b/README.yacc
@@ -0,0 +1,7 @@
+Sat Jan 28 22:07:17 EST 1995
+
+Some older versions of yacc (notably Ultrix's) have limits on the depth
+of the parse stack. This only shows up when gawk is dealing with deeply
+nested control structures, such as those in `awf'.
+
+The problem goes away if you use either bison or Berkeley yacc.
diff --git a/awk.h b/awk.h
index 27118f9f..9dd97caa 100644
--- a/awk.h
+++ b/awk.h
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -116,7 +116,11 @@ extern char *alloca();
#if defined(_MSC_VER)
#include <malloc.h>
#else
+#ifdef __hpux
+void *alloca ();
+#else
extern char *alloca();
+#endif /* __hpux */
#endif /* _MSC_VER */
#endif
#endif /* sparc */
@@ -365,7 +369,7 @@ typedef struct exp_node {
char *sp;
size_t slen;
unsigned char sref;
- char idx;
+ int idx;
} val;
struct {
struct exp_node *next;
@@ -632,7 +636,7 @@ extern double _msc51bug;
#else /* not MSDOS */
#define force_number(n) (_t = (n),(_t->flags & NUM) ? _t->numbr : r_force_number(_t))
#endif /* MSDOS */
-#define force_string(s) (_t = (s),(_t->flags & STR) ? _t : r_force_string(_t))
+#define force_string(s) (_t = (s),((_t->flags & STR) && (_t->stfmt == -1 || _t->stfmt == CONVFMTidx))? _t : r_force_string(_t))
#endif /* not DEBUG */
#define STREQ(a,b) (*(a) == *(b) && strcmp((a), (b)) == 0)
@@ -700,6 +704,7 @@ extern void set_NF P((void));
extern NODE **get_field P((int num, Func_ptr *assign));
extern NODE *do_split P((NODE *tree));
extern void set_FS P((void));
+extern void set_FS_if_not_FIELDWIDTHS P((void));
extern void set_RS P((void));
extern void set_FIELDWIDTHS P((void));
/* io.c */
@@ -728,10 +733,12 @@ extern SIGTYPE catchsig P((int sig, int code));
extern void err P((const char *s, const char *emsg, va_list argp));
#if _MSC_VER == 510
extern void msg P((va_list va_alist, ...));
+extern void error P((va_list va_alist, ...));
extern void warning P((va_list va_alist, ...));
extern void fatal P((va_list va_alist, ...));
#else
extern void msg ();
+extern void error ();
extern void warning ();
extern void fatal ();
#endif
diff --git a/awk.y b/awk.y
index 175cea90..006b3df1 100644
--- a/awk.y
+++ b/awk.y
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -43,6 +43,7 @@ static void pop_var P((NODE *np, int freeit));
static void pop_params P((NODE *params));
static NODE *make_param P((char *name));
static NODE *mk_rexp P((NODE *exp));
+static int dup_parms P((NODE *func));
static int want_assign; /* lexical scanning kludge */
static int want_regexp; /* lexical scanning kludge */
@@ -264,6 +265,9 @@ function_prologue
{
$$ = append_right(make_param($3), $5);
can_return = 1;
+ /* check for duplicate parameter names */
+ if (dup_parms($$))
+ errcount++;
}
;
@@ -273,6 +277,11 @@ function_body
$$ = $2;
can_return = 0;
}
+ | l_brace r_brace opt_semi opt_nls
+ {
+ $$ = node((NODE *) NULL, Node_K_return, (NODE *) NULL);
+ can_return = 0;
+ }
;
@@ -373,13 +382,22 @@ statement
{ $$ = node ($3, $1, $5); }
| print opt_rexpression_list output_redir statement_term
{
- if ($1 == Node_K_print && $2 == NULL)
+ if ($1 == Node_K_print && $2 == NULL) {
+ static int warned = 0;
+
$2 = node(node(make_number(0.0),
Node_field_spec,
(NODE *) NULL),
Node_expression_list,
(NODE *) NULL);
+ if (do_lint && ! io_allowed && ! warned) {
+ warned = 1;
+ warning(
+ "plain `print' in BEGIN or END rule should probably be `print \"\"'");
+ }
+ }
+
$$ = node ($2, $1, $3);
}
| LEX_NEXT opt_exp statement_term
@@ -394,12 +412,12 @@ statement
* the source line
*/
errcount++;
- msg("`next file' is a gawk extension");
+ error("`next file' is a gawk extension");
}
if (! io_allowed) {
/* same thing */
errcount++;
- msg("`next file' used in BEGIN or END action");
+ error("`next file' used in BEGIN or END action");
}
type = Node_K_nextfile;
} else {
@@ -427,7 +445,7 @@ statement
* the source line
*/
errcount++;
- msg("`delete array' is a gawk extension");
+ error("`delete array' is a gawk extension");
}
$$ = node (variable($2,1), Node_K_delete, (NODE *) NULL);
}
@@ -596,7 +614,15 @@ exp : variable ASSIGNOP
$$ = node ($1, $2, mk_rexp($3));
}
| regexp
- { $$ = $1; }
+ {
+ $$ = $1;
+ if (do_lint && tokstart[0] == '*') {
+ /* possible C comment */
+ int n = strlen(tokstart) - 1;
+ if (tokstart[n] == '*')
+ warning("regexp looks like a C comment, but is not");
+ }
+ }
| '!' regexp %prec UNARY
{
$$ = node(node(make_number(0.0),
@@ -700,6 +726,7 @@ non_post_simp_exp
| FUNC_CALL '(' opt_expression_list r_paren
{
$$ = node ($3, Node_func_call, make_string($1, strlen($1)));
+ free($1);
}
| variable
| INCREMENT variable
@@ -1014,9 +1041,10 @@ again:
if (n == 0) {
samefile = 0;
nextfile++;
- *lexeme = '\0';
+ if (lexeme)
+ *lexeme = '\0';
len = 0;
- return get_src_buf();
+ goto again;
}
lexptr = buf + SLOP;
lexend = lexptr + n;
@@ -1045,12 +1073,16 @@ tokexpand()
#if DEBUG
char
nextc() {
+ int c;
+
if (lexptr && lexptr < lexend)
- return *lexptr++;
+ c = *lexptr++;
else if (get_src_buf())
- return *lexptr++;
+ c = *lexptr++;
else
- return '\0';
+ c = '\0';
+
+ return c;
}
#else
#define nextc() ((lexptr && lexptr < lexend) ? \
@@ -1074,9 +1106,19 @@ yylex()
int low, mid, high;
static int did_newline = 0;
char *tokkey;
-
- if (!nextc())
+ static int lasttok = 0, eof_warned = 0;
+
+ if (!nextc()) {
+ if (lasttok != NEWLINE) {
+ lasttok = NEWLINE;
+ if (do_lint && ! eof_warned) {
+ warning("source file does not end in newline");
+ eof_warned = 1;
+ }
+ return NEWLINE; /* fake it */
+ }
return 0;
+ }
pushback();
#ifdef OS2
/*
@@ -1119,7 +1161,7 @@ yylex()
pushback();
tokadd('\0');
yylval.sval = tokstart;
- return REGEXP;
+ return lasttok = REGEXP;
case '\n':
pushback();
yyerror("unterminated regexp");
@@ -1140,19 +1182,37 @@ retry:
switch (c) {
case 0:
+ if (lasttok != NEWLINE) {
+ lasttok = NEWLINE;
+ if (do_lint && ! eof_warned) {
+ warning("source file does not end in newline");
+ eof_warned = 1;
+ }
+ return NEWLINE; /* fake it */
+ }
return 0;
case '\n':
sourceline++;
- return NEWLINE;
+ return lasttok = NEWLINE;
case '#': /* it's a comment */
while ((c = nextc()) != '\n') {
- if (c == '\0')
+ if (c == '\0') {
+ if (lasttok != NEWLINE) {
+ lasttok = NEWLINE;
+ if (do_lint && ! eof_warned) {
+ warning(
+ "source file does not end in newline");
+ eof_warned = 1;
+ }
+ return NEWLINE; /* fake it */
+ }
return 0;
+ }
}
sourceline++;
- return NEWLINE;
+ return lasttok = NEWLINE;
case '\\':
#ifdef RELAXED_CONTINUATION
@@ -1182,7 +1242,7 @@ retry:
case '$':
want_assign = 1;
- return '$';
+ return lasttok = '$';
case ')':
case ']':
@@ -1193,15 +1253,15 @@ retry:
case '?':
case '{':
case ',':
- return c;
+ return lasttok = c;
case '*':
if ((c = nextc()) == '=') {
yylval.nodetypeval = Node_assign_times;
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
} else if (do_posix) {
pushback();
- return '*';
+ return lasttok = '*';
} else if (c == '*') {
/* make ** and **= aliases for ^ and ^= */
static int did_warn_op = 0, did_warn_assgn = 0;
@@ -1212,36 +1272,36 @@ retry:
warning("**= is not allowed by POSIX");
}
yylval.nodetypeval = Node_assign_exp;
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
} else {
pushback();
if (do_lint && ! did_warn_op) {
did_warn_op = 1;
warning("** is not allowed by POSIX");
}
- return '^';
+ return lasttok = '^';
}
}
pushback();
- return '*';
+ return lasttok = '*';
case '/':
if (want_assign) {
if (nextc() == '=') {
yylval.nodetypeval = Node_assign_quotient;
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
}
pushback();
}
- return '/';
+ return lasttok = '/';
case '%':
if (nextc() == '=') {
yylval.nodetypeval = Node_assign_mod;
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
}
pushback();
- return '%';
+ return lasttok = '%';
case '^':
{
@@ -1254,73 +1314,73 @@ retry:
warning("operator `^=' is not supported in old awk");
}
yylval.nodetypeval = Node_assign_exp;
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
}
pushback();
if (do_lint && ! did_warn_op) {
did_warn_op = 1;
warning("operator `^' is not supported in old awk");
}
- return '^';
+ return lasttok = '^';
}
case '+':
if ((c = nextc()) == '=') {
yylval.nodetypeval = Node_assign_plus;
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
}
if (c == '+')
- return INCREMENT;
+ return lasttok = INCREMENT;
pushback();
- return '+';
+ return lasttok = '+';
case '!':
if ((c = nextc()) == '=') {
yylval.nodetypeval = Node_notequal;
- return RELOP;
+ return lasttok = RELOP;
}
if (c == '~') {
yylval.nodetypeval = Node_nomatch;
want_assign = 0;
- return MATCHOP;
+ return lasttok = MATCHOP;
}
pushback();
- return '!';
+ return lasttok = '!';
case '<':
if (nextc() == '=') {
yylval.nodetypeval = Node_leq;
- return RELOP;
+ return lasttok = RELOP;
}
yylval.nodetypeval = Node_less;
pushback();
- return '<';
+ return lasttok = '<';
case '=':
if (nextc() == '=') {
yylval.nodetypeval = Node_equal;
- return RELOP;
+ return lasttok = RELOP;
}
yylval.nodetypeval = Node_assign;
pushback();
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
case '>':
if ((c = nextc()) == '=') {
yylval.nodetypeval = Node_geq;
- return RELOP;
+ return lasttok = RELOP;
} else if (c == '>') {
yylval.nodetypeval = Node_redirect_append;
- return APPEND_OP;
+ return lasttok = APPEND_OP;
}
yylval.nodetypeval = Node_greater;
pushback();
- return '>';
+ return lasttok = '>';
case '~':
yylval.nodetypeval = Node_match;
want_assign = 0;
- return MATCHOP;
+ return lasttok = MATCHOP;
case '}':
/*
@@ -1329,11 +1389,11 @@ retry:
*/
if (did_newline) {
did_newline = 0;
- return c;
+ return lasttok = c;
}
did_newline++;
--lexptr; /* pick up } next time */
- return NEWLINE;
+ return lasttok = NEWLINE;
case '"':
esc_seen = 0;
@@ -1360,23 +1420,23 @@ retry:
yylval.nodeval = make_str_node(tokstart,
tok - tokstart, esc_seen ? SCAN : 0);
yylval.nodeval->flags |= PERM;
- return YSTRING;
+ return lasttok = YSTRING;
case '-':
if ((c = nextc()) == '=') {
yylval.nodetypeval = Node_assign_minus;
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
}
if (c == '-')
- return DECREMENT;
+ return lasttok = DECREMENT;
pushback();
- return '-';
+ return lasttok = '-';
case '.':
c = nextc();
pushback();
if (!isdigit(c))
- return '.';
+ return lasttok = '.';
else
c = '.'; /* FALL THROUGH */
case '0':
@@ -1432,10 +1492,16 @@ retry:
break;
c = nextc();
}
- pushback();
+ if (c != 0)
+ pushback();
+ else if (do_lint && ! eof_warned) {
+ warning("source file does not end in newline");
+ eof_warned = 1;
+ }
+ tokadd('\0');
yylval.nodeval = make_number(atof(tokstart));
yylval.nodeval->flags |= PERM;
- return YNUMBER;
+ return lasttok = YNUMBER;
case '&':
if ((c = nextc()) == '&') {
@@ -1458,10 +1524,10 @@ retry:
}
}
want_assign = 0;
- return LEX_AND;
+ return lasttok = LEX_AND;
}
pushback();
- return '&';
+ return lasttok = '&';
case '|':
if ((c = nextc()) == '|') {
@@ -1484,10 +1550,10 @@ retry:
}
}
want_assign = 0;
- return LEX_OR;
+ return lasttok = LEX_OR;
}
pushback();
- return '|';
+ return lasttok = '|';
}
if (c != '_' && ! isalpha(c))
@@ -1502,7 +1568,12 @@ retry:
tokadd('\0');
emalloc(tokkey, char *, tok - tokstart, "yylex");
memcpy(tokkey, tokstart, tok - tokstart);
- pushback();
+ if (c != 0)
+ pushback();
+ else if (do_lint && ! eof_warned) {
+ warning("source file does not end in newline");
+ eof_warned = 1;
+ }
/* See if it is a special token. */
low = 0;
@@ -1541,16 +1612,16 @@ retry:
yylval.nodetypeval = tokentab[mid].value;
free(tokkey);
- return tokentab[mid].class;
+ return lasttok = tokentab[mid].class;
}
}
yylval.sval = tokkey;
if (*lexptr == '(')
- return FUNC_CALL;
+ return lasttok = FUNC_CALL;
else {
want_assign = 1;
- return NAME;
+ return lasttok = NAME;
}
}
@@ -1758,6 +1829,45 @@ NODE *list, *new;
return oldlist;
}
+/* return 1 if there are duplicate parameters, 0 means all ok */
+static int
+dup_parms(func)
+NODE *func;
+{
+ register NODE *np;
+ char *fname, **names;
+ int count, i, j, dups;
+ NODE *params;
+
+ fname = func->param;
+ count = func->param_cnt;
+ params = func->rnode;
+
+ if (count == 0) /* no args, no problem */
+ return 0;
+
+ emalloc(names, char **, count * sizeof(char *), "dup_parms");
+
+ i = 0;
+ for (np = params; np != NULL; np = np->rnode)
+ names[i++] = np->param;
+
+ dups = 0;
+ for (i = 1; i < count; i++) {
+ for (j = 0; j < i; j++) {
+ if (strcmp(names[i], names[j]) == 0) {
+ dups++;
+ error(
+ "function `%s': parameter #%d, `%s', duplicates parameter #%d",
+ fname, i+1, names[j], j+1);
+ }
+ }
+ }
+
+ free(names);
+ return (dups > 0);
+}
+
/*
* check if name is already installed; if so, it had better have Null value,
* in which case def is added as the value. Otherwise, install name with def
@@ -1803,14 +1913,18 @@ int freeit;
}
}
+/*
+ * pop parameters out of the symbol table. do this in reverse order to
+ * avoid reading freed memory if there were duplicated parameters.
+ */
static void
pop_params(params)
NODE *params;
{
- register NODE *np;
-
- for (np = params; np != NULL; np = np->rnode)
- pop_var(np, 1);
+ if (params == NULL)
+ return;
+ pop_params(params->rnode);
+ pop_var(params, 1);
}
static NODE *
@@ -1827,7 +1941,7 @@ char *name;
return (install(name, r));
}
-/* Name points to a variable name. Make sure its in the symbol table */
+/* Name points to a variable name. Make sure it's in the symbol table */
NODE *
variable(name, can_free)
char *name;
diff --git a/awktab.c b/awktab.c
index 19e4a38b..6198e850 100644
--- a/awktab.c
+++ b/awktab.c
@@ -1,5 +1,6 @@
-/* A Bison parser, made from awk.y */
+/* A Bison parser, made from awk.y with Bison version GNU Bison version 1.22
+ */
#define YYBISON 1 /* Identify Bison output. */
@@ -62,6 +63,7 @@ static void pop_var P((NODE *np, int freeit));
static void pop_params P((NODE *params));
static NODE *make_param P((char *name));
static NODE *mk_rexp P((NODE *exp));
+static int dup_parms P((NODE *func));
static int want_assign; /* lexical scanning kludge */
static int want_regexp; /* lexical scanning kludge */
@@ -89,7 +91,7 @@ extern int errcount;
extern NODE *begin_block;
extern NODE *end_block;
-#line 74 "awk.y"
+#line 75 "awk.y"
typedef union {
long lval;
AWKNUM fval;
@@ -117,13 +119,15 @@ typedef
#include <stdio.h>
+#ifndef __cplusplus
#ifndef __STDC__
#define const
#endif
+#endif
-#define YYFINAL 307
+#define YYFINAL 310
#define YYFLAG -32768
#define YYNTBASE 61
@@ -166,24 +170,22 @@ static const char yytranslate[] = { 0,
static const short yyprhs[] = { 0,
0, 4, 6, 9, 11, 14, 15, 16, 20, 21,
25, 28, 31, 34, 36, 39, 42, 44, 46, 48,
- 50, 52, 53, 61, 66, 68, 72, 73, 78, 84,
- 89, 91, 94, 96, 99, 101, 104, 107, 110, 114,
- 116, 123, 132, 141, 152, 162, 165, 168, 175, 180,
- 184, 188, 189, 194, 201, 205, 208, 210, 212, 219,
- 229, 231, 234, 235, 237, 238, 241, 242, 245, 248,
- 251, 252, 254, 256, 260, 262, 265, 269, 270, 272,
- 273, 275, 277, 281, 283, 286, 290, 294, 295, 297,
- 299, 303, 305, 308, 312, 316, 317, 322, 328, 333,
- 337, 341, 345, 349, 351, 354, 358, 362, 366, 370,
- 376, 378, 381, 382, 387, 391, 395, 399, 401, 404,
- 408, 412, 416, 422, 424, 427, 429, 433, 437, 441,
- 445, 449, 453, 456, 459, 462, 466, 471, 476, 478,
- 483, 485, 488, 491, 493, 495, 498, 501, 502, 504,
- 506, 511, 514, 517, 520, 522, 523, 525, 527
+ 50, 52, 53, 61, 66, 71, 73, 77, 78, 83,
+ 89, 94, 96, 99, 101, 104, 106, 109, 112, 115,
+ 119, 121, 128, 137, 146, 157, 167, 170, 173, 180,
+ 185, 189, 193, 194, 199, 206, 210, 213, 215, 217,
+ 224, 234, 236, 239, 240, 242, 243, 246, 247, 250,
+ 253, 256, 257, 259, 261, 265, 267, 270, 274, 275,
+ 277, 278, 280, 282, 286, 288, 291, 295, 299, 300,
+ 302, 304, 308, 310, 313, 317, 321, 322, 327, 333,
+ 338, 342, 346, 350, 354, 356, 359, 363, 367, 371,
+ 375, 381, 383, 386, 387, 392, 396, 400, 404, 406,
+ 409, 413, 417, 421, 427, 429, 432, 434, 438, 442,
+ 446, 450, 454, 458, 461, 464, 467, 471, 476, 481,
+ 483, 488, 490, 493, 496, 498, 500, 503, 506, 507,
+ 509, 511, 516, 519, 522, 525, 527, 528, 530, 532
};
-#endif
-
static const short yyrhs[] = { 82,
62, 82, 0, 63, 0, 62, 63, 0, 1, 0,
62, 1, 0, 0, 0, 15, 64, 74, 0, 0,
@@ -191,73 +193,76 @@ static const short yyrhs[] = { 82,
71, 74, 0, 74, 0, 71, 76, 0, 68, 70,
0, 4, 0, 3, 0, 67, 0, 37, 0, 38,
0, 0, 30, 69, 66, 54, 85, 102, 82, 0,
- 100, 75, 101, 103, 0, 92, 0, 92, 41, 92,
- 0, 0, 48, 73, 5, 48, 0, 100, 75, 101,
- 103, 82, 0, 100, 101, 103, 82, 0, 77, 0,
- 75, 77, 0, 1, 0, 75, 1, 0, 81, 0,
- 104, 82, 0, 104, 82, 0, 100, 101, 0, 100,
- 75, 101, 0, 80, 0, 21, 54, 92, 102, 82,
- 77, 0, 22, 82, 77, 21, 54, 92, 102, 82,
- 0, 23, 54, 4, 32, 4, 102, 82, 77, 0,
- 23, 54, 87, 104, 92, 104, 87, 102, 82, 77,
- 0, 23, 54, 87, 104, 104, 87, 102, 82, 77,
- 0, 24, 76, 0, 25, 76, 0, 79, 54, 91,
- 102, 84, 76, 0, 79, 88, 84, 76, 0, 28,
- 87, 76, 0, 29, 87, 76, 0, 0, 19, 78,
- 87, 76, 0, 20, 4, 56, 91, 57, 76, 0,
- 20, 4, 76, 0, 92, 76, 0, 26, 0, 27,
- 0, 17, 54, 92, 102, 82, 77, 0, 17, 54,
- 92, 102, 82, 77, 18, 82, 77, 0, 13, 0,
- 81, 13, 0, 0, 81, 0, 0, 42, 96, 0,
- 0, 43, 92, 0, 10, 92, 0, 44, 92, 0,
- 0, 86, 0, 4, 0, 86, 105, 4, 0, 1,
- 0, 86, 1, 0, 86, 105, 1, 0, 0, 92,
- 0, 0, 89, 0, 94, 0, 89, 105, 94, 0,
- 1, 0, 89, 1, 0, 89, 1, 94, 0, 89,
- 105, 1, 0, 0, 91, 0, 92, 0, 91, 105,
- 92, 0, 1, 0, 91, 1, 0, 91, 1, 92,
- 0, 91, 105, 1, 0, 0, 99, 11, 93, 92,
- 0, 54, 91, 102, 32, 4, 0, 92, 44, 31,
- 98, 0, 31, 98, 83, 0, 92, 33, 92, 0,
- 92, 34, 92, 0, 92, 12, 92, 0, 72, 0,
- 50, 72, 0, 92, 32, 4, 0, 92, 9, 92,
- 0, 92, 42, 92, 0, 92, 43, 92, 0, 92,
- 39, 92, 40, 92, 0, 96, 0, 92, 96, 0,
- 0, 99, 11, 95, 94, 0, 94, 33, 94, 0,
- 94, 34, 94, 0, 31, 98, 83, 0, 72, 0,
- 50, 72, 0, 94, 12, 94, 0, 94, 32, 4,
- 0, 94, 9, 94, 0, 94, 39, 94, 40, 94,
- 0, 96, 0, 94, 96, 0, 97, 0, 96, 52,
- 96, 0, 96, 47, 96, 0, 96, 48, 96, 0,
- 96, 49, 96, 0, 96, 45, 96, 0, 96, 46,
- 96, 0, 99, 35, 0, 99, 36, 0, 50, 96,
- 0, 54, 92, 102, 0, 37, 54, 90, 102, 0,
- 38, 54, 90, 102, 0, 38, 0, 3, 54, 90,
- 102, 0, 99, 0, 35, 99, 0, 36, 99, 0,
- 7, 0, 8, 0, 46, 96, 0, 45, 96, 0,
- 0, 99, 0, 4, 0, 4, 56, 91, 57, 0,
- 53, 97, 0, 58, 82, 0, 59, 82, 0, 55,
- 0, 0, 104, 0, 60, 0, 41, 82, 0
+ 100, 75, 101, 103, 0, 100, 101, 103, 82, 0,
+ 92, 0, 92, 41, 92, 0, 0, 48, 73, 5,
+ 48, 0, 100, 75, 101, 103, 82, 0, 100, 101,
+ 103, 82, 0, 77, 0, 75, 77, 0, 1, 0,
+ 75, 1, 0, 81, 0, 104, 82, 0, 104, 82,
+ 0, 100, 101, 0, 100, 75, 101, 0, 80, 0,
+ 21, 54, 92, 102, 82, 77, 0, 22, 82, 77,
+ 21, 54, 92, 102, 82, 0, 23, 54, 4, 32,
+ 4, 102, 82, 77, 0, 23, 54, 87, 104, 92,
+ 104, 87, 102, 82, 77, 0, 23, 54, 87, 104,
+ 104, 87, 102, 82, 77, 0, 24, 76, 0, 25,
+ 76, 0, 79, 54, 91, 102, 84, 76, 0, 79,
+ 88, 84, 76, 0, 28, 87, 76, 0, 29, 87,
+ 76, 0, 0, 19, 78, 87, 76, 0, 20, 4,
+ 56, 91, 57, 76, 0, 20, 4, 76, 0, 92,
+ 76, 0, 26, 0, 27, 0, 17, 54, 92, 102,
+ 82, 77, 0, 17, 54, 92, 102, 82, 77, 18,
+ 82, 77, 0, 13, 0, 81, 13, 0, 0, 81,
+ 0, 0, 42, 96, 0, 0, 43, 92, 0, 10,
+ 92, 0, 44, 92, 0, 0, 86, 0, 4, 0,
+ 86, 105, 4, 0, 1, 0, 86, 1, 0, 86,
+ 105, 1, 0, 0, 92, 0, 0, 89, 0, 94,
+ 0, 89, 105, 94, 0, 1, 0, 89, 1, 0,
+ 89, 1, 94, 0, 89, 105, 1, 0, 0, 91,
+ 0, 92, 0, 91, 105, 92, 0, 1, 0, 91,
+ 1, 0, 91, 1, 92, 0, 91, 105, 1, 0,
+ 0, 99, 11, 93, 92, 0, 54, 91, 102, 32,
+ 4, 0, 92, 44, 31, 98, 0, 31, 98, 83,
+ 0, 92, 33, 92, 0, 92, 34, 92, 0, 92,
+ 12, 92, 0, 72, 0, 50, 72, 0, 92, 32,
+ 4, 0, 92, 9, 92, 0, 92, 42, 92, 0,
+ 92, 43, 92, 0, 92, 39, 92, 40, 92, 0,
+ 96, 0, 92, 96, 0, 0, 99, 11, 95, 94,
+ 0, 94, 33, 94, 0, 94, 34, 94, 0, 31,
+ 98, 83, 0, 72, 0, 50, 72, 0, 94, 12,
+ 94, 0, 94, 32, 4, 0, 94, 9, 94, 0,
+ 94, 39, 94, 40, 94, 0, 96, 0, 94, 96,
+ 0, 97, 0, 96, 52, 96, 0, 96, 47, 96,
+ 0, 96, 48, 96, 0, 96, 49, 96, 0, 96,
+ 45, 96, 0, 96, 46, 96, 0, 99, 35, 0,
+ 99, 36, 0, 50, 96, 0, 54, 92, 102, 0,
+ 37, 54, 90, 102, 0, 38, 54, 90, 102, 0,
+ 38, 0, 3, 54, 90, 102, 0, 99, 0, 35,
+ 99, 0, 36, 99, 0, 7, 0, 8, 0, 46,
+ 96, 0, 45, 96, 0, 0, 99, 0, 4, 0,
+ 4, 56, 91, 57, 0, 53, 97, 0, 58, 82,
+ 0, 59, 82, 0, 55, 0, 0, 104, 0, 60,
+ 0, 41, 82, 0
};
+#endif
+
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 135, 140, 148, 164, 165, 166, 170, 172, 186, 188,
- 202, 208, 214, 216, 218, 231, 240, 242, 244, 254,
- 255, 259, 263, 271, 280, 282, 291, 293, 311, 313,
- 318, 320, 328, 330, 335, 336, 340, 342, 344, 346,
- 348, 350, 352, 357, 361, 366, 369, 372, 374, 385,
- 412, 414, 416, 418, 420, 434, 439, 441, 446, 451,
- 458, 460, 464, 465, 469, 471, 476, 478, 480, 482,
- 487, 489, 494, 496, 498, 500, 502, 508, 510, 515,
- 517, 522, 524, 530, 532, 534, 536, 541, 543, 548,
- 550, 556, 558, 560, 562, 567, 570, 575, 577, 582,
- 588, 590, 592, 598, 600, 608, 610, 616, 618, 620,
- 622, 624, 629, 632, 633, 635, 637, 643, 645, 647,
- 649, 651, 653, 655, 657, 662, 664, 666, 668, 670,
- 672, 674, 676, 678, 683, 685, 687, 690, 692, 700,
- 704, 705, 707, 709, 711, 714, 721, 730, 732, 737,
- 739, 747, 752, 756, 760, 764, 765, 769, 772
+ 136, 141, 149, 165, 166, 167, 171, 173, 187, 189,
+ 203, 209, 215, 217, 219, 232, 241, 243, 245, 255,
+ 256, 260, 264, 275, 280, 289, 291, 300, 302, 320,
+ 322, 327, 329, 337, 339, 344, 345, 349, 351, 353,
+ 355, 357, 359, 361, 366, 370, 375, 378, 381, 383,
+ 403, 430, 432, 434, 436, 438, 452, 457, 459, 464,
+ 469, 476, 478, 482, 483, 487, 489, 494, 496, 498,
+ 500, 505, 507, 512, 514, 516, 518, 520, 526, 528,
+ 533, 535, 540, 542, 548, 550, 552, 554, 559, 561,
+ 566, 568, 574, 576, 578, 580, 585, 588, 593, 595,
+ 600, 606, 608, 610, 616, 626, 634, 636, 642, 644,
+ 646, 648, 650, 655, 658, 659, 661, 663, 669, 671,
+ 673, 675, 677, 679, 681, 683, 688, 690, 692, 694,
+ 696, 698, 700, 702, 704, 709, 711, 713, 716, 718,
+ 726, 731, 732, 734, 736, 738, 741, 748, 757, 759,
+ 764, 766, 774, 779, 783, 787, 791, 792, 796, 799
};
static const char * const yytname[] = { "$","error","$illegal.","FUNC_CALL",
@@ -280,507 +285,493 @@ static const char * const yytname[] = { "$","error","$illegal.","FUNC_CALL",
static const short yyr1[] = { 0,
61, 62, 62, 62, 62, 62, 64, 63, 65, 63,
63, 63, 63, 63, 63, 63, 66, 66, 66, 67,
- 67, 69, 68, 70, 71, 71, 73, 72, 74, 74,
- 75, 75, 75, 75, 76, 76, 77, 77, 77, 77,
+ 67, 69, 68, 70, 70, 71, 71, 73, 72, 74,
+ 74, 75, 75, 75, 75, 76, 76, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
- 77, 78, 77, 77, 77, 77, 79, 79, 80, 80,
- 81, 81, 82, 82, 83, 83, 84, 84, 84, 84,
- 85, 85, 86, 86, 86, 86, 86, 87, 87, 88,
- 88, 89, 89, 89, 89, 89, 89, 90, 90, 91,
- 91, 91, 91, 91, 91, 93, 92, 92, 92, 92,
+ 77, 77, 78, 77, 77, 77, 77, 79, 79, 80,
+ 80, 81, 81, 82, 82, 83, 83, 84, 84, 84,
+ 84, 85, 85, 86, 86, 86, 86, 86, 87, 87,
+ 88, 88, 89, 89, 89, 89, 89, 89, 90, 90,
+ 91, 91, 91, 91, 91, 91, 93, 92, 92, 92,
92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
- 92, 92, 95, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 96, 96, 96, 96, 96,
- 96, 96, 96, 96, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 98, 98, 99,
- 99, 99, 100, 101, 102, 103, 103, 104, 105
+ 92, 92, 92, 95, 94, 94, 94, 94, 94, 94,
+ 94, 94, 94, 94, 94, 94, 96, 96, 96, 96,
+ 96, 96, 96, 96, 96, 97, 97, 97, 97, 97,
+ 97, 97, 97, 97, 97, 97, 97, 97, 98, 98,
+ 99, 99, 99, 100, 101, 102, 103, 103, 104, 105
};
static const short yyr2[] = { 0,
3, 1, 2, 1, 2, 0, 0, 3, 0, 3,
2, 2, 2, 1, 2, 2, 1, 1, 1, 1,
- 1, 0, 7, 4, 1, 3, 0, 4, 5, 4,
- 1, 2, 1, 2, 1, 2, 2, 2, 3, 1,
- 6, 8, 8, 10, 9, 2, 2, 6, 4, 3,
- 3, 0, 4, 6, 3, 2, 1, 1, 6, 9,
- 1, 2, 0, 1, 0, 2, 0, 2, 2, 2,
- 0, 1, 1, 3, 1, 2, 3, 0, 1, 0,
- 1, 1, 3, 1, 2, 3, 3, 0, 1, 1,
- 3, 1, 2, 3, 3, 0, 4, 5, 4, 3,
- 3, 3, 3, 1, 2, 3, 3, 3, 3, 5,
- 1, 2, 0, 4, 3, 3, 3, 1, 2, 3,
- 3, 3, 5, 1, 2, 1, 3, 3, 3, 3,
- 3, 3, 2, 2, 2, 3, 4, 4, 1, 4,
- 1, 2, 2, 1, 1, 2, 2, 0, 1, 1,
- 4, 2, 2, 2, 1, 0, 1, 1, 2
+ 1, 0, 7, 4, 4, 1, 3, 0, 4, 5,
+ 4, 1, 2, 1, 2, 1, 2, 2, 2, 3,
+ 1, 6, 8, 8, 10, 9, 2, 2, 6, 4,
+ 3, 3, 0, 4, 6, 3, 2, 1, 1, 6,
+ 9, 1, 2, 0, 1, 0, 2, 0, 2, 2,
+ 2, 0, 1, 1, 3, 1, 2, 3, 0, 1,
+ 0, 1, 1, 3, 1, 2, 3, 3, 0, 1,
+ 1, 3, 1, 2, 3, 3, 0, 4, 5, 4,
+ 3, 3, 3, 3, 1, 2, 3, 3, 3, 3,
+ 5, 1, 2, 0, 4, 3, 3, 3, 1, 2,
+ 3, 3, 3, 5, 1, 2, 1, 3, 3, 3,
+ 3, 3, 3, 2, 2, 2, 3, 4, 4, 1,
+ 4, 1, 2, 2, 1, 1, 2, 2, 0, 1,
+ 1, 4, 2, 2, 2, 1, 0, 1, 1, 2
};
-static const short yydefact[] = { 63,
- 61, 64, 0, 62, 4, 0, 150, 144, 145, 7,
- 9, 22, 148, 0, 0, 0, 139, 0, 0, 27,
- 0, 0, 0, 63, 0, 2, 0, 0, 104, 14,
- 25, 111, 126, 141, 0, 0, 0, 158, 0, 11,
- 35, 63, 0, 12, 0, 65, 149, 142, 143, 0,
- 0, 0, 0, 147, 141, 146, 0, 105, 135, 152,
- 141, 92, 0, 90, 153, 5, 3, 1, 16, 0,
+static const short yydefact[] = { 64,
+ 62, 65, 0, 63, 4, 0, 151, 145, 146, 7,
+ 9, 22, 149, 0, 0, 0, 140, 0, 0, 28,
+ 0, 0, 0, 64, 0, 2, 0, 0, 105, 14,
+ 26, 112, 127, 142, 0, 0, 0, 159, 0, 11,
+ 36, 64, 0, 12, 0, 66, 150, 143, 144, 0,
+ 0, 0, 0, 148, 142, 147, 0, 106, 136, 153,
+ 142, 93, 0, 91, 154, 5, 3, 1, 16, 0,
13, 15, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 112, 0, 0, 0, 0, 0, 0, 96,
- 133, 134, 33, 0, 52, 0, 0, 63, 0, 0,
- 0, 57, 58, 78, 78, 63, 0, 31, 0, 40,
- 0, 0, 156, 63, 0, 0, 90, 0, 8, 36,
- 10, 18, 17, 20, 21, 0, 19, 0, 100, 0,
- 0, 0, 0, 93, 63, 155, 0, 0, 136, 0,
- 107, 103, 106, 101, 102, 0, 26, 108, 109, 148,
- 131, 132, 128, 129, 130, 127, 0, 0, 78, 0,
- 0, 0, 78, 46, 47, 0, 79, 0, 154, 34,
- 32, 156, 84, 148, 0, 0, 118, 67, 0, 82,
- 124, 141, 56, 0, 38, 63, 157, 37, 140, 151,
- 0, 66, 137, 138, 28, 94, 159, 0, 95, 91,
- 156, 0, 99, 97, 0, 0, 0, 55, 0, 0,
- 150, 0, 50, 51, 63, 65, 119, 0, 0, 0,
- 0, 0, 85, 0, 0, 0, 0, 0, 0, 0,
- 125, 113, 39, 30, 75, 73, 0, 0, 98, 24,
- 110, 63, 53, 0, 63, 0, 0, 0, 29, 117,
- 67, 69, 68, 70, 49, 86, 87, 83, 122, 120,
- 121, 115, 116, 0, 0, 63, 76, 0, 0, 0,
- 0, 0, 0, 0, 78, 0, 0, 114, 23, 77,
- 74, 59, 54, 41, 0, 63, 78, 0, 48, 123,
- 63, 63, 0, 0, 63, 0, 42, 43, 63, 0,
- 60, 0, 45, 44, 0, 0, 0
+ 0, 0, 113, 0, 0, 0, 0, 0, 0, 97,
+ 134, 135, 34, 0, 53, 0, 0, 64, 0, 0,
+ 0, 58, 59, 79, 79, 64, 0, 32, 0, 41,
+ 0, 0, 157, 64, 0, 0, 91, 0, 8, 37,
+ 10, 18, 17, 20, 21, 0, 19, 0, 101, 0,
+ 0, 0, 0, 94, 64, 156, 0, 0, 137, 0,
+ 157, 108, 104, 107, 102, 103, 0, 27, 109, 110,
+ 149, 132, 133, 129, 130, 131, 128, 0, 0, 79,
+ 0, 0, 0, 79, 47, 48, 0, 80, 0, 155,
+ 35, 33, 157, 85, 149, 0, 0, 119, 68, 0,
+ 83, 125, 142, 57, 0, 39, 64, 158, 38, 141,
+ 152, 0, 67, 138, 139, 29, 95, 160, 0, 96,
+ 92, 157, 64, 0, 100, 98, 0, 0, 0, 56,
+ 0, 0, 151, 0, 51, 52, 64, 66, 120, 0,
+ 0, 0, 0, 0, 86, 0, 0, 0, 0, 0,
+ 0, 0, 126, 114, 40, 31, 76, 74, 0, 0,
+ 99, 24, 25, 111, 64, 54, 0, 64, 0, 0,
+ 0, 30, 118, 68, 70, 69, 71, 50, 87, 88,
+ 84, 123, 121, 122, 116, 117, 0, 0, 64, 77,
+ 0, 0, 0, 0, 0, 0, 0, 79, 0, 0,
+ 115, 23, 78, 75, 60, 55, 42, 0, 64, 79,
+ 0, 49, 124, 64, 64, 0, 0, 64, 0, 43,
+ 44, 64, 0, 61, 0, 46, 45, 0, 0, 0
};
-static const short yydefgoto[] = { 305,
+static const short yydefgoto[] = { 308,
25, 26, 39, 43, 126, 127, 27, 45, 69, 28,
- 29, 57, 30, 107, 40, 108, 159, 109, 110, 2,
- 3, 129, 222, 237, 238, 166, 178, 179, 115, 116,
- 111, 157, 180, 265, 32, 33, 46, 34, 112, 113,
- 139, 186, 42, 138
+ 29, 57, 30, 107, 40, 108, 160, 109, 110, 2,
+ 3, 129, 224, 239, 240, 167, 179, 180, 115, 116,
+ 111, 158, 181, 268, 32, 33, 46, 34, 112, 113,
+ 139, 187, 42, 138
};
-static const short yypact[] = { 6,
--32768, 10, 874,-32768,-32768, -33, -16,-32768,-32768, 4,
- 4,-32768, 31, 31, 31, 14, 44, 1749, 1749,-32768,
- 1743, 1749, 1158, 6, 930,-32768, 46, 0,-32768,-32768,
- 1327, 284,-32768, 18, 654, 433, 1158,-32768, 46,-32768,
- 10, 6, 46,-32768, 88, 65,-32768,-32768,-32768, 433,
- 433, 1749, 1539, 59, 58, 59, 111,-32768, 59,-32768,
--32768,-32768, 40, 1274,-32768,-32768,-32768,-32768,-32768, 790,
--32768,-32768, 1539, 1539, 117, 1539, 1539, 1539, 1539, 1539,
- 1539, 99, 284, 1749, 1749, 1749, 1749, 1749, 1749,-32768,
--32768,-32768,-32768, 69,-32768, 132, 79, 6, 83, 4,
- 4,-32768,-32768, 1539, 1539, 6, 742,-32768, 848,-32768,
- 1036, 654, 80, 6, 84, 42, 1423, 8,-32768,-32768,
--32768,-32768,-32768,-32768,-32768, 90,-32768, 1749,-32768, 84,
- 84, 1274, 97, 1539, 6,-32768, 106, 1178,-32768, 742,
- 1810, 1797,-32768, 1559, 1471, 1375, 1423, 1810, 1810, 31,
- 129, 129, 59, 59, 59, 59, 1539, 1539, 1539, 50,
- 1539, 978, 1667,-32768,-32768, 4, 1423, 4,-32768,-32768,
--32768, 80,-32768, 31, 1743, 1158,-32768, 75, 1, 1607,
- 284, 92,-32768, 742,-32768, 6,-32768,-32768,-32768,-32768,
- 11, 284,-32768,-32768,-32768, 1423,-32768, 145,-32768, 1423,
- 80, 1539,-32768, 1423, 1274, 4, 1158,-32768, 1274, 138,
- 57, 80,-32768,-32768, 6, 65,-32768, 40, 1539, 1539,
- 1539, 4, 1723, 1226, 1723, 1723, 146, 1723, 1723, 1723,
- 284,-32768,-32768,-32768,-32768,-32768, 84, 45,-32768,-32768,
- 1423, 6,-32768, 15, 6, 110, 149, 1110,-32768,-32768,
- 75, 1423, 1423, 1423,-32768, 1607,-32768, 1607, 549, 139,
--32768, 1687, 1647, 1519, 1723, 6,-32768, 35, 978, 4,
- 978, 1539, 84, 1090, 1539, 4, 1723, 1607,-32768,-32768,
--32768, 147,-32768,-32768, 1274, 6, 1539, 84,-32768, 1607,
- 6, 6, 978, 84, 6, 978,-32768,-32768, 6, 978,
--32768, 978,-32768,-32768, 172, 180,-32768
+static const short yypact[] = { 2,
+-32768, 15, 842,-32768,-32768, -44, -27,-32768,-32768, 6,
+ 6,-32768, 3, 3, 3, -15, -9, 1684, 1684,-32768,
+ 1678, 1684, 1093, 2, 898,-32768, 32, 46,-32768,-32768,
+ 1262, 197,-32768, 49, 665, 1072, 1093,-32768, 32,-32768,
+ 15, 2, 32,-32768, 96, 7,-32768,-32768,-32768, 1072,
+ 1072, 1684, 1474, -21, -11, -21, 86,-32768, -21,-32768,
+-32768,-32768, 0, 1209,-32768,-32768,-32768,-32768,-32768, 665,
+-32768,-32768, 1474, 1474, 89, 1474, 1474, 1474, 1474, 1474,
+ 1474, 63, 197, 1684, 1684, 1684, 1684, 1684, 1684,-32768,
+-32768,-32768,-32768, 55,-32768, 99, 56, 2, 66, 6,
+ 6,-32768,-32768, 1474, 1474, 2, 756,-32768, 816,-32768,
+ 518, 665, 61, 2, 68, 41, 1358, 11,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768, 71,-32768, 1684,-32768, 68,
+ 68, 1209, 79, 1474, 2,-32768, 98, 1141,-32768, 756,
+ 61, 1745, 1732,-32768, 1494, 1406, 1310, 1358, 1745, 1745,
+ 3, 90, 90, -21, -21, -21, -21, 1474, 1474, 1474,
+ 59, 1474, 946, 1602,-32768,-32768, 6, 1358, 6,-32768,
+-32768,-32768, 61,-32768, 3, 1678, 1093,-32768, 44, 85,
+ 1542, 197, 111,-32768, 756,-32768, 2,-32768,-32768,-32768,
+-32768, 26, 197,-32768,-32768,-32768, 1358,-32768, 128,-32768,
+ 1358, 61, 2, 1474,-32768, 1358, 1209, 6, 1093,-32768,
+ 1209, 119, -24, 61,-32768,-32768, 2, 7,-32768, 0,
+ 1474, 1474, 1474, 6, 1658, 1161, 1658, 1658, 137, 1658,
+ 1658, 1658, 197,-32768,-32768,-32768,-32768,-32768, 68, 42,
+-32768,-32768,-32768, 1358, 2,-32768, 12, 2, 94, 139,
+ 1024,-32768,-32768, 44, 1358, 1358, 1358,-32768, 1542,-32768,
+ 1542, 415, 1222,-32768, 1622, 1582, 1454, 1658, 2,-32768,
+ 22, 946, 6, 946, 1474, 68, 1004, 1474, 6, 1658,
+ 1542,-32768,-32768,-32768, 131,-32768,-32768, 1209, 2, 1474,
+ 68,-32768, 1542, 2, 2, 946, 68, 2, 946,-32768,
+-32768, 2, 946,-32768, 946,-32768,-32768, 151, 153,-32768
};
static const short yypgoto[] = {-32768,
--32768, 157,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
- 78,-32768, 81, 17, 94, -50,-32768,-32768,-32768, 41,
- -18, -26, -60,-32768,-32768, -104,-32768,-32768, 64, -19,
- -3,-32768, -198,-32768, 363, 174, -42, 148, 183, -102,
- 324, -164, 458, -176
+-32768, 125,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+ 84,-32768, -22, -54, 334, -96,-32768,-32768,-32768, 202,
+ 38, -58, -92,-32768,-32768, -103,-32768,-32768, -14, -19,
+ -3,-32768, -114,-32768, 368, 145, -137, 150, 183, -61,
+ -23, -138, 469, -175
};
-#define YYLAST 1864
+#define YYLAST 1799
static const short yytable[] = { 31,
- 168, 223, 224, 63, 172, 65, 68, 215, 134, 185,
- -81, 235, 1, -81, 236, 134, 1, 118, 1, 64,
- 36, 31, 4, 120, 256, 258, 259, 260, 90, 262,
- 263, 264, 117, 117, 7, 280, 240, 201, 281, 37,
- 134, 135, 134, -81, -81, 267, 117, 117, 135, 132,
- 41, 41, 91, 92, 206, 135, 171, 24, 212, 38,
- -81, 268, 1, 38, 190, -71, 278, 50, 41, 141,
- 142, 270, 144, 145, 146, 147, 148, 149, 290, 162,
- 135, 233, 135, 22, 219, 135, 140, 169, 247, 171,
- 122, 123, 91, 92, 136, 188, -89, 51, 58, -72,
- 167, 167, 232, 24, 44, 207, 128, 203, 71, 38,
- 89, 210, 37, 130, 131, 133, 197, 220, 221, 119,
- 143, 72, 158, 121, 124, 125, 91, 92, 184, 150,
- 196, 216, 161, 171, 200, 160, 163, 198, 136, 38,
- 41, 41, 7, 191, 195, 8, 9, 225, 239, 261,
--32768, 41, 273, 204, 205, 167, 218, 209, 246, 167,
- 47, 48, 49, 272, 291, 55, 55, 234, 55, 61,
- 288, 306, 64, 14, 15, 86, 87, 88, 55, 307,
- 89, 67, 294, 18, 19, 35, 177, 244, 52, 250,
- 276, 22, 53, 164, 165, 60, 249, 0, 241, 55,
- 41, 0, 0, 117, 183, 0, 41, 35, 41, 70,
- 35, 55, 0, 0, 0, 252, 253, 254, 282, 0,
- 284, 35, 0, 269, 0, 35, 271, 0, 0, 0,
- 0, 55, 55, 55, 55, 55, 55, 0, 0, 0,
- 0, 0, 298, 0, 274, 301, 41, 279, 0, 303,
- 0, 304, 217, 208, 0, 0, 182, 0, 55, 213,
- 0, 214, 41, 0, 55, 0, 0, 293, 285, 0,
- 0, 167, 296, 297, 0, 55, 300, 0, 0, 55,
- 302, 0, 0, 167, 0, 0, 0, 0, 55, 55,
- 0, 55, 55, 55, 55, 55, 55, 47, 0, 243,
- 177, 177, 177, 177, 0, 177, 177, 177, 0, 0,
- 41, 0, 0, 0, 55, 255, 41, 0, 0, 0,
- 0, 47, 55, 0, 0, 0, 0, 55, 84, 85,
- 86, 87, 88, 0, 0, 89, 0, 0, 0, 0,
- 0, 0, 177, 55, 0, 0, 0, 55, 0, 0,
- 0, 55, 55, 0, 177, 0, 55, 0, 0, 0,
- 0, 0, 0, 283, 0, 0, 0, 0, 0, 289,
- 182, 182, 182, 182, 0, 182, 182, 182, 0, 0,
- 54, 56, 0, 59, 0, 0, 137, 0, 55, 0,
- 0, 0, 0, 83, 0, 0, 0, 0, 0, 55,
- 55, 55, 0, 55, 0, 55, 55, 55, 0, 55,
- 55, 55, 182, 0, 59, 0, 0, 0, 0, 0,
- 0, 55, 0, 0, 182, 55, 83, 0, 0, 0,
- 0, 0, 55, 62, 0, 6, 7, 55, 189, 8,
- 9, 0, 0, 0, 0, 0, 151, 152, 153, 154,
- 155, 156, 0, 193, 194, 0, 0, 0, 0, 0,
- 0, 0, 0, 13, 0, 0, 0, 14, 15, 16,
- 17, 181, 0, 83, 0, 0, 0, 18, 19, 83,
- 20, 0, 21, 0, 0, 22, 23, -88, 0, 0,
- 192, 0, 114, 0, 83, 0, 0, 0, 0, 0,
- 0, 0, 0, 83, 83, 0, 83, 83, 83, 83,
- 83, 83, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 114, 242, 83,
- 0, 0, 245, 0, 0, 0, 0, 59, 0, 0,
- 0, 251, 231, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 7, 0, 0, 8, 9,-32768, 83, 0,
- 266, 0, 83, 0, 114, 0, 83, 83, 0, 114,
- 187, 83, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 14, 15, 181, 181, 181, 181, 0,
- 181, 181, 181, 18, 19, 0, 286, 114, 52, 0,
- 0, 22, 53, 83, 0, 0, 0, 0, 292, 0,
- 0, 295, 0, 0, 83, 83, 83, 299, 231, 114,
- 231, 231, 231, 0, 231, 231, 231, 181, 0, 187,
- 0, 0, 0, 0, 0, 0, 83, 0, 0, 181,
- 231, 114, 0, 0, 0, 0, 0, 83, 0, 0,
- 0, 0, 231, 0, 93, 0, 6, 7, 187, 0,
- 8, 9, 0, 0, 0, 0, 0, 0, 0, 248,
- 94, 0, 95, 96, 97, 98, 99, 100, 101, 102,
- 103, 104, 105, 0, 13, 0, 0, 0, 14, 15,
- 16, 17, 0, 0, 0, 0, 0, 0, 18, 19,
- 0, 20, 0, 21, 0, 275, 22, 23, 0, 0,
- 0, 24, 106, 38, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 114, 0, 114, 0,
- 0, 287, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 170, 0, 6, 7, 0, 0, 8, 9,
- 114, 0, 0, 114, 0, 0, 0, 114, 94, 114,
- 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- 105, 0, 13, 0, 0, 0, 14, 15, 16, 17,
- 0, 0, 0, 0, 0, 0, 18, 19, 0, 20,
- 93, 21, 6, 7, 22, 23, 8, 9, 0, 24,
- 106, 38, 0, 0, 0, 0, 94, 0, 95, 96,
- 97, 98, 99, 100, 101, 102, 103, 104, 105, 0,
- 13, 0, 0, 0, 14, 15, 16, 17, 0, 0,
- 0, 0, 0, 0, 18, 19, 0, 20, 0, 21,
- 0, 0, 22, 23, 0, 0, 0, 24, 173, 38,
- 6, 7, 0, 0, 8, 9, 0, -80, 0, 0,
- -80, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, -6, 5, 0, 6, 7, 174, 0,
- 8, 9, 14, 15, 16, 17, -6, 0, 10, 11,
- -80, -80, 18, 19, 0, 20, 0, 175, 0, 0,
- 22, 176, 0, 12, 13, 0, 0, -80, 14, 15,
- 16, 17, 0, 0, 0, 0, 0, 0, 18, 19,
- 0, 20, 0, 21, 0, 0, 22, 23, 0, -63,
- 66, 24, 6, 7, 0, 0, 8, 9, 0, 0,
- 0, 0, 1, 0, 10, 11, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
- 13, 0, 0, 0, 14, 15, 16, 17, 0, 0,
- 0, 0, 0, 0, 18, 19, 0, 20, 0, 21,
- 6, 7, 22, 23, 8, 9, 0, 24, 0, 0,
- 0, 0, 0, 0, 94, 0, 95, 96, 97, 98,
- 99, 100, 101, 102, 103, 104, 105, 0, 13, 0,
- 0, 0, 14, 15, 16, 17, 0, 0, 0, 0,
- 0, 0, 18, 19, 0, 20, 0, 21, 0, 0,
- 22, 23, 0, 0, 0, 24, 0, 38, 6, 7,
- 0, 0, 8, 9, 73, 0, 0, 74, 1, 0,
+ 134, 169, 203, 63, 226, 71, 7, 250, 141, 36,
+ 172, 134, 134, 205, 1, 140, 119, 118, 1, 64,
+ 121, 31, 283, 91, 92, 284, 237, 4, 37, 238,
+ 89, 37, 117, 117, 217, 130, 131, 218, 50, 137,
+ 135, 134, 270, 172, 51, 173, 117, 117, 128, 132,
+ 186, 135, 135, 221, 136, 22, 208, 185, 1, 90,
+ 214, 65, 68, 242, 271, 38, 212, 191, 273, 142,
+ 143, 1, 145, 146, 147, 148, 149, 150, 202, 120,
+ -72, 135, 135, 91, 92, 225, 222, 223, 172, 24,
+ 133, 190, 144, 151, -82, -90, -73, -82, 122, 123,
+ 168, 168, 161, 24, 58, 38, 194, 195, 159, 162,
+ 259, 261, 262, 263, 209, 265, 266, 267, 38, 164,
+ 38, 234, 136, 235, 192, 135, 196, -82, -82, 199,
+ 197, 241, 124, 125, 201, 163, 86, 87, 88, 249,
+ 264, 89, 276, 170, -82, 91, 92, 275, 294, 67,
+ 309, 189, 310, 281, 206, 207, 168, 220, 211, 253,
+ 168, 279, 47, 48, 49, 293, 60, 55, 55, 0,
+ 55, 61, 198, 64, 291, 285, 0, 287, 0, 0,
+ 55, 0, 0, 245, 0, 35, 297, 248, 0, 247,
+ 0, 0, 178, 0, 0, 0, 254, 0, 0, 301,
+ 244, 55, 304, 0, 0, 117, 306, 35, 307, 70,
+ 35, 41, 41, 55, 0, 269, 0, 255, 256, 257,
+ 0, 35, 0, 0, 236, 35, 0, 0, 0, 41,
+ 0, 0, 0, 55, 55, 55, 55, 55, 55, 0,
+ 243, 84, 85, 86, 87, 88, 0, 277, 89, 0,
+ 0, 0, 289, 0, 252, 0, 0, 0, 183, 219,
+ 55, 0, 0, 0, 295, 0, 55, 298, 0, 0,
+ 0, 288, 0, 302, 168, 0, 0, 55, 0, 0,
+ 0, 55, 272, 0, 0, 274, 168, 0, 0, 0,
+ 0, 55, 55, 0, 55, 55, 55, 55, 55, 55,
+ 47, 41, 41, 0, 0, 0, 282, 0, 178, 178,
+ 178, 178, 41, 178, 178, 178, 0, 55, 0, 0,
+ 0, 0, 0, 0, 47, 55, 296, 0, 0, 0,
+ 55, 299, 300, 0, 0, 303, 0, 0, 0, 305,
+ 0, 0, 0, 0, 44, 0, 55, 0, 0, 0,
+ 55, 178, 0, 0, 0, 55, 55, 0, 0, 0,
+ 55, 72, 41, 178, 0, 0, 0, 0, 41, 0,
+ 41, 0, 0, 0, 183, 183, 183, 183, 0, 183,
+ 183, 183, 0, 0, 0, 54, 56, 0, 59, 0,
+ 0, 0, 0, 55, 0, 0, 0, 0, 83, 0,
+ 0, 0, 0, 0, 55, 55, 55, 0, 55, 41,
+ 55, 55, 55, 0, 55, 55, 55, 183, 7, 59,
+ 0, 8, 9,-32768, 0, 41, 55, 0, 0, 183,
+ 55, 83, 0, 165, 166, 0, 0, 55, 0, 0,
+ 0, 0, 55, 0, 184, 0, 0, 0, 0, 14,
+ 15, 152, 153, 154, 155, 156, 157, 0, 0, 18,
+ 19, 0, 0, 0, 52, 0, 0, 22, 53, 0,
+ 0, 0, 0, 0, 41, 0, 182, 0, 83, 0,
+ 41, 0, 0, 0, 83, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 210, 193, 0, 0, 0, 83,
+ 215, 0, 216, 114, 0, 0, 0, 0, 0, 83,
+ 83, 0, 83, 83, 83, 83, 83, 83, 0, 0,
+ 6, 7, 0, 0, 8, 9, 73, 0, 0, 74,
+ 1, 0, 0, 0, 0, 83, 0, 0, 114, 0,
+ 0, 246, 0, 59, 0, 0, 0, 0, 233, 75,
+ 76, 77, 14, 15, 16, 17, 78, 258, 0, 80,
+ 81, 82, 18, 19, 83, 0, 0, 52, 83, 0,
+ 22, 53, 0, 83, 83, 114, 0, 38, 83, 0,
+ 114, 188, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 182, 182, 182, 182, 0, 182, 182, 182,
+ 0, 0, 0, 0, 0, 0, 286, 0, 114, 188,
+ 0, 83, 292, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 83, 83, 83, 0, 233, 0, 233, 233,
+ 233, 114, 233, 233, 233, 182, 0, 0, 0, 0,
+ 0, 188, 0, 0, 83, 0, 0, 182, 233, 0,
+ 0, 0, 0, 114, 0, 83, 0, 0, 0, 0,
+ 233, 0, 0, 0, 0, 93, 0, 6, 7, 0,
+ 188, 8, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 94, 251, 95, 96, 97, 98, 99, 100, 101,
+ 102, 103, 104, 105, 0, 13, 0, 0, 0, 14,
+ 15, 16, 17, 0, 0, 0, 0, 0, 0, 18,
+ 19, 0, 20, 0, 21, 0, 0, 22, 23, 278,
+ 0, 0, 24, 106, 38, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 75, 76, 77,
- 14, 15, 16, 17, 78, 0, 0, 80, 81, 82,
- 18, 19, 0, 0, 0, 52, 0, 0, 22, 53,
- 0, 0, 6, 7, 0, 38, 8, 9, 73, 0,
- 0, 74, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 6, 7, 0, 0, 8, 9, 0, 0,
- 0, 75, 76, 77, 14, 15, 16, 17, 78, 0,
- 0, 80, 81, 82, 18, 19, 0, 0, 0, 52,
- 13, 0, 22, 53, 14, 15, 16, 17, 0, 38,
- 0, 0, 0, 0, 18, 19, 0, 20, 62, 21,
- 6, 7, 22, 23, 8, 9, 0, 0, 0, 38,
- 0, 0, 0, 0, 0, 0, 0, 0, 199, 0,
- 6, 7, 0, 0, 8, 9, 0, 0, 13, 0,
- 0, 0, 14, 15, 16, 17, 0, 0, 0, 0,
- 0, 0, 18, 19, 0, 20, 0, 21, 13, 0,
- 22, 23, 14, 15, 16, 17, 0, 0, 0, 0,
- 0, 0, 18, 19, 0, 20, 257, 21, 6, 7,
- 22, 23, 8, 9, 0, 0, 0, 0, 0, 0,
+ 114, 0, 114, 0, 0, 290, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 171, 0, 6, 7,
+ 0, 0, 8, 9, 114, 0, 0, 114, 0, 0,
+ 0, 114, 94, 114, 95, 96, 97, 98, 99, 100,
+ 101, 102, 103, 104, 105, 0, 13, 0, 0, 0,
+ 14, 15, 16, 17, 0, 0, 0, 0, 0, 0,
+ 18, 19, 0, 20, 0, 21, 0, 0, 22, 23,
+ 0, 0, 0, 24, 106, 38, 174, 0, 6, 7,
+ 0, 0, 8, 9, 0, -81, 0, 0, -81, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 174, 0, 0, 0,
+ 0, -6, 5, 0, 6, 7, 175, 0, 8, 9,
+ 14, 15, 16, 17, -6, 0, 10, 11, -81, -81,
+ 18, 19, 0, 20, 0, 176, 0, 0, 22, 177,
+ 0, 12, 13, 0, 0, -81, 14, 15, 16, 17,
+ 0, 0, 0, 0, 0, 0, 18, 19, 0, 20,
+ 0, 21, 0, 0, 22, 23, 0, -64, 66, 24,
+ 6, 7, 0, 0, 8, 9, 0, 0, 0, 0,
+ 1, 0, 10, 11, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 12, 13, 0,
+ 0, 0, 14, 15, 16, 17, 0, 0, 0, 0,
+ 0, 0, 18, 19, 0, 20, 0, 21, 6, 7,
+ 22, 23, 8, 9, 0, 24, 0, 0, 0, 0,
+ 0, 0, 94, 0, 95, 96, 97, 98, 99, 100,
+ 101, 102, 103, 104, 105, 0, 13, 0, 0, 0,
14, 15, 16, 17, 0, 0, 0, 0, 0, 0,
- 18, 19, 0, 20, 0, 175, 6, 7, 22, 53,
+ 18, 19, 0, 20, 0, 21, 0, 0, 22, 23,
+ 0, 0, 0, 24, 0, 38, 6, 7, 0, 0,
8, 9, 73, 0, 0, 74, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 75, 76, 77, 14, 15,
+ 0, 0, 0, 0, 0, 0, 6, 7, 0, 0,
+ 8, 9, 0, 0, 0, 75, 76, 77, 14, 15,
16, 17, 78, 0, 0, 80, 81, 82, 18, 19,
- 0, 0, 0, 52, 0, 0, 22, 53, 136, 6,
- 7, 0, 0, 8, 9, 73, 0, 0, 74, 0,
+ 0, 0, 0, 52, 13, 0, 22, 53, 14, 15,
+ 16, 17, 0, 38, 0, 0, 0, 0, 18, 19,
+ 0, 20, 62, 21, 6, 7, 22, 23, 8, 9,
+ 0, 0, 0, 38, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 62, 0, 6, 7, 0, 0, 8,
+ 9, 0, 13, 0, 0, 0, 14, 15, 16, 17,
+ 0, 0, 0, 0, 0, 0, 18, 19, 0, 20,
+ 0, 21, 0, 13, 22, 23, -89, 14, 15, 16,
+ 17, 0, 0, 0, 0, 0, 0, 18, 19, 0,
+ 20, 200, 21, 6, 7, 22, 23, 8, 9, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
- 77, 14, 15, 16, 17, 78, 0, 79, 80, 81,
- 82, 18, 19, 0, 0, 0, 52, 6, 7, 22,
- 53, 8, 9, 73, 0, 0, 74, 0, 0, 0,
+ 0, 260, 0, 6, 7, 0, 0, 8, 9, 0,
+ 0, 13, 0, 0, 0, 14, 15, 16, 17, 0,
+ 0, 0, 0, 0, 0, 18, 19, 0, 20, 0,
+ 21, 175, 0, 22, 23, 14, 15, 16, 17, 0,
+ 0, 0, 0, 0, 0, 18, 19, 0, 20, 0,
+ 176, 6, 7, 22, 53, 8, 9, 73, 0, 0,
+ 74, 0, 0, 0, 0, 7, 0, 0, 8, 9,
+ 227, 0, 0,-32768, 0, 0, 0, 0, 0, 0,
+ 75, 76, 77, 14, 15, 16, 17, 78, 0, 0,
+ 80, 81, 82, 18, 19, 0, 14, 15, 52, 0,
+ 0, 22, 53, 136, 6, 7, 18, 19, 8, 9,
+ 73, 52, 0, 74, 22, 53, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 75, 76, 77, 14,
- 15, 16, 17, 78, 202, 0, 80, 81, 82, 18,
- 19, 0, 0, 0, 52, 6, 7, 22, 53, 8,
- 9, 73, 0, 0, 74, 0, 0, 0, 0, 0,
+ 0, 0, 0, 75, 76, 77, 14, 15, 16, 17,
+ 78, 0, 79, 80, 81, 82, 18, 19, 0, 0,
+ 0, 52, 6, 7, 22, 53, 8, 9, 73, 0,
+ 0, 74, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 75, 76, 77, 14, 15, 16,
- 17, 78, 0, 0, 80, 81, 82, 18, 19, 0,
- 0, 0, 52, 6, 7, 22, 53, 8, 9, 73,
- 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
+ 0, 75, 76, 77, 14, 15, 16, 17, 78, 204,
+ 0, 80, 81, 82, 18, 19, 0, 0, 0, 52,
+ 6, 7, 22, 53, 8, 9, 73, 0, 0, 74,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 75, 76, 0, 14, 15, 16, 17, 0,
- 0, 0, 80, 81, 82, 18, 19, 0, 0, 0,
- 52, 6, 7, 22, 53, 8, 9, 225, 0, 0,
- 226, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 6, 7, 0, 0, 8, 9, 0, 0, 0,
- 227, 228, 229, 14, 15, 16, 17, 230, 277, 0,
- 0, 6, 7, 18, 19, 8, 9, 73, 52, 13,
- 74, 22, 53, 14, 15, 16, 17, 0, 0, 0,
- 0, 0, 0, 18, 19, 0, 20, 0, 21, 0,
- 75, 22, 23, 14, 15, 16, 17, 0, 0, 0,
- 80, 81, 82, 18, 19, 0, 0, 0, 52, 6,
- 7, 22, 53, 8, 9, 225, 0, 0, 226, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 75,
+ 76, 77, 14, 15, 16, 17, 78, 0, 0, 80,
+ 81, 82, 18, 19, 0, 0, 0, 52, 6, 7,
+ 22, 53, 8, 9, 73, 0, 0, 74, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 227, 228,
- 229, 14, 15, 16, 17, 230, 0, 0, 0, 6,
- 7, 18, 19, 8, 9, 225, 52, 0, 226, 22,
- 53, 0, 0, 0, 0, 0, 0, 0, 0, 6,
- 211, 0, 0, 8, 9, 0, 0, 0, 227, 228,
- 0, 14, 15, 16, 17, 0, 0, 0, 0, 6,
- 7, 18, 19, 8, 9, 225, 52, 13, 226, 22,
- 53, 14, 15, 16, 17, 0, 0, 0, 0, 0,
- 0, 18, 19, 0, 20, 0, 21, 0, 227, 22,
- 23, 14, 15, 16, 17, 6, 7, 0, 0, 8,
- 9, 18, 19, 0, 0, 0, 52, 0, 0, 22,
- 53, 0, 0, 0, 0, 6, 7, 0, 0, 8,
- 9, 6, 7, 174, 0, 8, 9, 14, 15, 16,
- 17, 0, 0, 0, 0, 0, 0, 18, 19, 0,
- 20, 0, 175, 0, 0, 22, 53, 14, 15, 16,
- 17, 0, 0, 14, 15, 16, 17, 18, 19, 0,
- 20, 0, 52, 18, 19, 22, 53, 0, 52, 0,
- 7, 22, 53, 8, 9, 73, 0, 0,-32768, 0,
- 0, 0, 0, 7, 0, 0, 8, 9,-32768, 0,
+ 0, 0, 0, 0, 0, 0, 0, 75, 76, 0,
+ 14, 15, 16, 17, 0, 0, 0, 80, 81, 82,
+ 18, 19, 0, 0, 0, 52, 6, 7, 22, 53,
+ 8, 9, 227, 0, 0, 228, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 6, 7, 0, 0,
+ 8, 9, 0, 0, 0, 229, 230, 231, 14, 15,
+ 16, 17, 232, 280, 0, 0, 6, 7, 18, 19,
+ 8, 9, 73, 52, 13, 74, 22, 53, 14, 15,
+ 16, 17, 0, 0, 0, 0, 0, 0, 18, 19,
+ 0, 20, 0, 21, 0, 75, 22, 23, 14, 15,
+ 16, 17, 0, 0, 0, 80, 81, 82, 18, 19,
+ 0, 0, 0, 52, 6, 7, 22, 53, 8, 9,
+ 227, 0, 0, 228, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 14, 15, 0, 0, 0, 0, 0, 80, 81,
- 82, 18, 19, 0, 14, 15, 52, 0, 0, 22,
- 53,-32768,-32768,-32768, 18, 19, 0, 0, 0, 52,
- 0, 0, 22, 53
+ 0, 0, 0, 229, 230, 231, 14, 15, 16, 17,
+ 232, 0, 0, 0, 6, 7, 18, 19, 8, 9,
+ 227, 52, 0, 228, 22, 53, 0, 0, 0, 0,
+ 0, 0, 0, 0, 6, 213, 0, 0, 8, 9,
+ 0, 0, 0, 229, 230, 0, 14, 15, 16, 17,
+ 0, 0, 0, 0, 6, 7, 18, 19, 8, 9,
+ 227, 52, 13, 228, 22, 53, 14, 15, 16, 17,
+ 0, 0, 0, 0, 0, 0, 18, 19, 0, 20,
+ 0, 21, 0, 229, 22, 23, 14, 15, 16, 17,
+ 6, 7, 0, 0, 8, 9, 18, 19, 0, 0,
+ 0, 52, 0, 0, 22, 53, 0, 0, 0, 0,
+ 6, 7, 0, 0, 8, 9, 6, 7, 175, 0,
+ 8, 9, 14, 15, 16, 17, 0, 0, 0, 0,
+ 0, 0, 18, 19, 0, 20, 0, 176, 0, 0,
+ 22, 53, 14, 15, 16, 17, 0, 0, 14, 15,
+ 16, 17, 18, 19, 0, 20, 0, 52, 18, 19,
+ 22, 53, 0, 52, 0, 7, 22, 53, 8, 9,
+ 73, 0, 0,-32768, 0, 0, 0, 0, 7, 0,
+ 0, 8, 9,-32768, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 14, 15, 0, 0,
+ 0, 0, 0, 80, 81, 82, 18, 19, 0, 14,
+ 15, 52, 0, 0, 22, 53,-32768,-32768,-32768, 18,
+ 19, 0, 0, 0, 52, 0, 0, 22, 53
};
static const short yycheck[] = { 3,
- 105, 1, 179, 23, 107, 24, 25, 172, 1, 112,
- 10, 1, 13, 13, 4, 1, 13, 37, 13, 23,
- 54, 25, 13, 42, 223, 224, 225, 226, 11, 228,
- 229, 230, 36, 37, 4, 1, 201, 140, 4, 56,
- 1, 41, 1, 43, 44, 1, 50, 51, 41, 53,
- 10, 11, 35, 36, 159, 41, 107, 58, 163, 60,
- 60, 238, 13, 60, 57, 55, 265, 54, 28, 73,
- 74, 57, 76, 77, 78, 79, 80, 81, 277, 98,
- 41, 184, 41, 53, 10, 41, 70, 106, 32, 140,
- 3, 4, 35, 36, 55, 114, 55, 54, 21, 55,
- 104, 105, 11, 58, 11, 56, 42, 150, 28, 60,
- 52, 162, 56, 50, 51, 5, 135, 43, 44, 39,
- 4, 28, 54, 43, 37, 38, 35, 36, 112, 31,
- 134, 174, 54, 184, 138, 4, 54, 32, 55, 60,
- 100, 101, 4, 54, 48, 7, 8, 9, 4, 4,
- 12, 111, 4, 157, 158, 159, 176, 161, 21, 163,
- 13, 14, 15, 54, 18, 18, 19, 186, 21, 22,
- 275, 0, 176, 35, 36, 47, 48, 49, 31, 0,
- 52, 25, 287, 45, 46, 3, 109, 207, 50, 216,
- 251, 53, 54, 100, 101, 22, 215, -1, 202, 52,
- 160, -1, -1, 207, 111, -1, 166, 25, 168, 27,
- 28, 64, -1, -1, -1, 219, 220, 221, 269, -1,
- 271, 39, -1, 242, -1, 43, 245, -1, -1, -1,
- -1, 84, 85, 86, 87, 88, 89, -1, -1, -1,
- -1, -1, 293, -1, 248, 296, 206, 266, -1, 300,
- -1, 302, 175, 160, -1, -1, 109, -1, 111, 166,
- -1, 168, 222, -1, 117, -1, -1, 286, 272, -1,
- -1, 275, 291, 292, -1, 128, 295, -1, -1, 132,
- 299, -1, -1, 287, -1, -1, -1, -1, 141, 142,
- -1, 144, 145, 146, 147, 148, 149, 150, -1, 206,
- 223, 224, 225, 226, -1, 228, 229, 230, -1, -1,
- 270, -1, -1, -1, 167, 222, 276, -1, -1, -1,
- -1, 174, 175, -1, -1, -1, -1, 180, 45, 46,
- 47, 48, 49, -1, -1, 52, -1, -1, -1, -1,
- -1, -1, 265, 196, -1, -1, -1, 200, -1, -1,
- -1, 204, 205, -1, 277, -1, 209, -1, -1, -1,
- -1, -1, -1, 270, -1, -1, -1, -1, -1, 276,
- 223, 224, 225, 226, -1, 228, 229, 230, -1, -1,
- 18, 19, -1, 21, -1, -1, 63, -1, 241, -1,
- -1, -1, -1, 31, -1, -1, -1, -1, -1, 252,
- 253, 254, -1, 256, -1, 258, 259, 260, -1, 262,
- 263, 264, 265, -1, 52, -1, -1, -1, -1, -1,
- -1, 274, -1, -1, 277, 278, 64, -1, -1, -1,
- -1, -1, 285, 1, -1, 3, 4, 290, 115, 7,
- 8, -1, -1, -1, -1, -1, 84, 85, 86, 87,
- 88, 89, -1, 130, 131, -1, -1, -1, -1, -1,
- -1, -1, -1, 31, -1, -1, -1, 35, 36, 37,
- 38, 109, -1, 111, -1, -1, -1, 45, 46, 117,
- 48, -1, 50, -1, -1, 53, 54, 55, -1, -1,
- 128, -1, 35, -1, 132, -1, -1, -1, -1, -1,
- -1, -1, -1, 141, 142, -1, 144, 145, 146, 147,
- 148, 149, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 70, 205, 167,
- -1, -1, 209, -1, -1, -1, -1, 175, -1, -1,
- -1, 218, 180, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 4, -1, -1, 7, 8, 9, 196, -1,
- 237, -1, 200, -1, 107, -1, 204, 205, -1, 112,
- 113, 209, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 35, 36, 223, 224, 225, 226, -1,
- 228, 229, 230, 45, 46, -1, 273, 140, 50, -1,
- -1, 53, 54, 241, -1, -1, -1, -1, 285, -1,
- -1, 288, -1, -1, 252, 253, 254, 294, 256, 162,
- 258, 259, 260, -1, 262, 263, 264, 265, -1, 172,
- -1, -1, -1, -1, -1, -1, 274, -1, -1, 277,
- 278, 184, -1, -1, -1, -1, -1, 285, -1, -1,
- -1, -1, 290, -1, 1, -1, 3, 4, 201, -1,
- 7, 8, -1, -1, -1, -1, -1, -1, -1, 212,
- 17, -1, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, -1, 31, -1, -1, -1, 35, 36,
- 37, 38, -1, -1, -1, -1, -1, -1, 45, 46,
- -1, 48, -1, 50, -1, 248, 53, 54, -1, -1,
- -1, 58, 59, 60, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 269, -1, 271, -1,
- -1, 274, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 1, -1, 3, 4, -1, -1, 7, 8,
- 293, -1, -1, 296, -1, -1, -1, 300, 17, 302,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, -1, 31, -1, -1, -1, 35, 36, 37, 38,
- -1, -1, -1, -1, -1, -1, 45, 46, -1, 48,
- 1, 50, 3, 4, 53, 54, 7, 8, -1, 58,
- 59, 60, -1, -1, -1, -1, 17, -1, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28, 29, -1,
- 31, -1, -1, -1, 35, 36, 37, 38, -1, -1,
- -1, -1, -1, -1, 45, 46, -1, 48, -1, 50,
- -1, -1, 53, 54, -1, -1, -1, 58, 1, 60,
- 3, 4, -1, -1, 7, 8, -1, 10, -1, -1,
- 13, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 0, 1, -1, 3, 4, 31, -1,
- 7, 8, 35, 36, 37, 38, 13, -1, 15, 16,
- 43, 44, 45, 46, -1, 48, -1, 50, -1, -1,
- 53, 54, -1, 30, 31, -1, -1, 60, 35, 36,
- 37, 38, -1, -1, -1, -1, -1, -1, 45, 46,
- -1, 48, -1, 50, -1, -1, 53, 54, -1, 0,
- 1, 58, 3, 4, -1, -1, 7, 8, -1, -1,
- -1, -1, 13, -1, 15, 16, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 30,
- 31, -1, -1, -1, 35, 36, 37, 38, -1, -1,
- -1, -1, -1, -1, 45, 46, -1, 48, -1, 50,
- 3, 4, 53, 54, 7, 8, -1, 58, -1, -1,
- -1, -1, -1, -1, 17, -1, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, -1, 31, -1,
- -1, -1, 35, 36, 37, 38, -1, -1, -1, -1,
- -1, -1, 45, 46, -1, 48, -1, 50, -1, -1,
- 53, 54, -1, -1, -1, 58, -1, 60, 3, 4,
- -1, -1, 7, 8, 9, -1, -1, 12, 13, -1,
+ 1, 105, 141, 23, 180, 28, 4, 32, 70, 54,
+ 107, 1, 1, 151, 13, 70, 39, 37, 13, 23,
+ 43, 25, 1, 35, 36, 4, 1, 13, 56, 4,
+ 52, 56, 36, 37, 173, 50, 51, 175, 54, 63,
+ 41, 1, 1, 140, 54, 107, 50, 51, 42, 53,
+ 112, 41, 41, 10, 55, 53, 160, 112, 13, 11,
+ 164, 24, 25, 202, 240, 60, 163, 57, 57, 73,
+ 74, 13, 76, 77, 78, 79, 80, 81, 140, 42,
+ 55, 41, 41, 35, 36, 1, 43, 44, 185, 58,
+ 5, 115, 4, 31, 10, 55, 55, 13, 3, 4,
+ 104, 105, 4, 58, 21, 60, 130, 131, 54, 54,
+ 225, 226, 227, 228, 56, 230, 231, 232, 60, 54,
+ 60, 11, 55, 185, 54, 41, 48, 43, 44, 32,
+ 134, 4, 37, 38, 138, 98, 47, 48, 49, 21,
+ 4, 52, 4, 106, 60, 35, 36, 54, 18, 25,
+ 0, 114, 0, 268, 158, 159, 160, 177, 162, 218,
+ 164, 254, 13, 14, 15, 280, 22, 18, 19, -1,
+ 21, 22, 135, 177, 278, 272, -1, 274, -1, -1,
+ 31, -1, -1, 207, -1, 3, 290, 211, -1, 209,
+ -1, -1, 109, -1, -1, -1, 220, -1, -1, 296,
+ 204, 52, 299, -1, -1, 209, 303, 25, 305, 27,
+ 28, 10, 11, 64, -1, 239, -1, 221, 222, 223,
+ -1, 39, -1, -1, 187, 43, -1, -1, -1, 28,
+ -1, -1, -1, 84, 85, 86, 87, 88, 89, -1,
+ 203, 45, 46, 47, 48, 49, -1, 251, 52, -1,
+ -1, -1, 276, -1, 217, -1, -1, -1, 109, 176,
+ 111, -1, -1, -1, 288, -1, 117, 291, -1, -1,
+ -1, 275, -1, 297, 278, -1, -1, 128, -1, -1,
+ -1, 132, 245, -1, -1, 248, 290, -1, -1, -1,
+ -1, 142, 143, -1, 145, 146, 147, 148, 149, 150,
+ 151, 100, 101, -1, -1, -1, 269, -1, 225, 226,
+ 227, 228, 111, 230, 231, 232, -1, 168, -1, -1,
+ -1, -1, -1, -1, 175, 176, 289, -1, -1, -1,
+ 181, 294, 295, -1, -1, 298, -1, -1, -1, 302,
+ -1, -1, -1, -1, 11, -1, 197, -1, -1, -1,
+ 201, 268, -1, -1, -1, 206, 207, -1, -1, -1,
+ 211, 28, 161, 280, -1, -1, -1, -1, 167, -1,
+ 169, -1, -1, -1, 225, 226, 227, 228, -1, 230,
+ 231, 232, -1, -1, -1, 18, 19, -1, 21, -1,
+ -1, -1, -1, 244, -1, -1, -1, -1, 31, -1,
+ -1, -1, -1, -1, 255, 256, 257, -1, 259, 208,
+ 261, 262, 263, -1, 265, 266, 267, 268, 4, 52,
+ -1, 7, 8, 9, -1, 224, 277, -1, -1, 280,
+ 281, 64, -1, 100, 101, -1, -1, 288, -1, -1,
+ -1, -1, 293, -1, 111, -1, -1, -1, -1, 35,
+ 36, 84, 85, 86, 87, 88, 89, -1, -1, 45,
+ 46, -1, -1, -1, 50, -1, -1, 53, 54, -1,
+ -1, -1, -1, -1, 273, -1, 109, -1, 111, -1,
+ 279, -1, -1, -1, 117, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 161, 128, -1, -1, -1, 132,
+ 167, -1, 169, 35, -1, -1, -1, -1, -1, 142,
+ 143, -1, 145, 146, 147, 148, 149, 150, -1, -1,
+ 3, 4, -1, -1, 7, 8, 9, -1, -1, 12,
+ 13, -1, -1, -1, -1, 168, -1, -1, 70, -1,
+ -1, 208, -1, 176, -1, -1, -1, -1, 181, 32,
+ 33, 34, 35, 36, 37, 38, 39, 224, -1, 42,
+ 43, 44, 45, 46, 197, -1, -1, 50, 201, -1,
+ 53, 54, -1, 206, 207, 107, -1, 60, 211, -1,
+ 112, 113, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 225, 226, 227, 228, -1, 230, 231, 232,
+ -1, -1, -1, -1, -1, -1, 273, -1, 140, 141,
+ -1, 244, 279, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 255, 256, 257, -1, 259, -1, 261, 262,
+ 263, 163, 265, 266, 267, 268, -1, -1, -1, -1,
+ -1, 173, -1, -1, 277, -1, -1, 280, 281, -1,
+ -1, -1, -1, 185, -1, 288, -1, -1, -1, -1,
+ 293, -1, -1, -1, -1, 1, -1, 3, 4, -1,
+ 202, 7, 8, -1, -1, -1, -1, -1, -1, -1,
+ -1, 17, 214, 19, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, -1, 31, -1, -1, -1, 35,
+ 36, 37, 38, -1, -1, -1, -1, -1, -1, 45,
+ 46, -1, 48, -1, 50, -1, -1, 53, 54, 251,
+ -1, -1, 58, 59, 60, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 32, 33, 34,
- 35, 36, 37, 38, 39, -1, -1, 42, 43, 44,
- 45, 46, -1, -1, -1, 50, -1, -1, 53, 54,
- -1, -1, 3, 4, -1, 60, 7, 8, 9, -1,
- -1, 12, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 3, 4, -1, -1, 7, 8, -1, -1,
- -1, 32, 33, 34, 35, 36, 37, 38, 39, -1,
- -1, 42, 43, 44, 45, 46, -1, -1, -1, 50,
- 31, -1, 53, 54, 35, 36, 37, 38, -1, 60,
- -1, -1, -1, -1, 45, 46, -1, 48, 1, 50,
- 3, 4, 53, 54, 7, 8, -1, -1, -1, 60,
- -1, -1, -1, -1, -1, -1, -1, -1, 1, -1,
- 3, 4, -1, -1, 7, 8, -1, -1, 31, -1,
- -1, -1, 35, 36, 37, 38, -1, -1, -1, -1,
- -1, -1, 45, 46, -1, 48, -1, 50, 31, -1,
- 53, 54, 35, 36, 37, 38, -1, -1, -1, -1,
- -1, -1, 45, 46, -1, 48, 1, 50, 3, 4,
- 53, 54, 7, 8, -1, -1, -1, -1, -1, -1,
+ 272, -1, 274, -1, -1, 277, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 1, -1, 3, 4,
+ -1, -1, 7, 8, 296, -1, -1, 299, -1, -1,
+ -1, 303, 17, 305, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, -1, 31, -1, -1, -1,
+ 35, 36, 37, 38, -1, -1, -1, -1, -1, -1,
+ 45, 46, -1, 48, -1, 50, -1, -1, 53, 54,
+ -1, -1, -1, 58, 59, 60, 1, -1, 3, 4,
+ -1, -1, 7, 8, -1, 10, -1, -1, 13, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 31, -1, -1, -1,
+ -1, 0, 1, -1, 3, 4, 31, -1, 7, 8,
+ 35, 36, 37, 38, 13, -1, 15, 16, 43, 44,
+ 45, 46, -1, 48, -1, 50, -1, -1, 53, 54,
+ -1, 30, 31, -1, -1, 60, 35, 36, 37, 38,
+ -1, -1, -1, -1, -1, -1, 45, 46, -1, 48,
+ -1, 50, -1, -1, 53, 54, -1, 0, 1, 58,
+ 3, 4, -1, -1, 7, 8, -1, -1, -1, -1,
+ 13, -1, 15, 16, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 30, 31, -1,
+ -1, -1, 35, 36, 37, 38, -1, -1, -1, -1,
+ -1, -1, 45, 46, -1, 48, -1, 50, 3, 4,
+ 53, 54, 7, 8, -1, 58, -1, -1, -1, -1,
+ -1, -1, 17, -1, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, -1, 31, -1, -1, -1,
35, 36, 37, 38, -1, -1, -1, -1, -1, -1,
- 45, 46, -1, 48, -1, 50, 3, 4, 53, 54,
+ 45, 46, -1, 48, -1, 50, -1, -1, 53, 54,
+ -1, -1, -1, 58, -1, 60, 3, 4, -1, -1,
7, 8, 9, -1, -1, 12, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 32, 33, 34, 35, 36,
+ -1, -1, -1, -1, -1, -1, 3, 4, -1, -1,
+ 7, 8, -1, -1, -1, 32, 33, 34, 35, 36,
37, 38, 39, -1, -1, 42, 43, 44, 45, 46,
- -1, -1, -1, 50, -1, -1, 53, 54, 55, 3,
- 4, -1, -1, 7, 8, 9, -1, -1, 12, -1,
+ -1, -1, -1, 50, 31, -1, 53, 54, 35, 36,
+ 37, 38, -1, 60, -1, -1, -1, -1, 45, 46,
+ -1, 48, 1, 50, 3, 4, 53, 54, 7, 8,
+ -1, -1, -1, 60, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 1, -1, 3, 4, -1, -1, 7,
+ 8, -1, 31, -1, -1, -1, 35, 36, 37, 38,
+ -1, -1, -1, -1, -1, -1, 45, 46, -1, 48,
+ -1, 50, -1, 31, 53, 54, 55, 35, 36, 37,
+ 38, -1, -1, -1, -1, -1, -1, 45, 46, -1,
+ 48, 1, 50, 3, 4, 53, 54, 7, 8, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 32, 33,
- 34, 35, 36, 37, 38, 39, -1, 41, 42, 43,
- 44, 45, 46, -1, -1, -1, 50, 3, 4, 53,
- 54, 7, 8, 9, -1, -1, 12, -1, -1, -1,
+ -1, 1, -1, 3, 4, -1, -1, 7, 8, -1,
+ -1, 31, -1, -1, -1, 35, 36, 37, 38, -1,
+ -1, -1, -1, -1, -1, 45, 46, -1, 48, -1,
+ 50, 31, -1, 53, 54, 35, 36, 37, 38, -1,
+ -1, -1, -1, -1, -1, 45, 46, -1, 48, -1,
+ 50, 3, 4, 53, 54, 7, 8, 9, -1, -1,
+ 12, -1, -1, -1, -1, 4, -1, -1, 7, 8,
+ 9, -1, -1, 12, -1, -1, -1, -1, -1, -1,
+ 32, 33, 34, 35, 36, 37, 38, 39, -1, -1,
+ 42, 43, 44, 45, 46, -1, 35, 36, 50, -1,
+ -1, 53, 54, 55, 3, 4, 45, 46, 7, 8,
+ 9, 50, -1, 12, 53, 54, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, -1, 42, 43, 44, 45,
- 46, -1, -1, -1, 50, 3, 4, 53, 54, 7,
- 8, 9, -1, -1, 12, -1, -1, -1, -1, -1,
+ -1, -1, -1, 32, 33, 34, 35, 36, 37, 38,
+ 39, -1, 41, 42, 43, 44, 45, 46, -1, -1,
+ -1, 50, 3, 4, 53, 54, 7, 8, 9, -1,
+ -1, 12, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 32, 33, 34, 35, 36, 37,
- 38, 39, -1, -1, 42, 43, 44, 45, 46, -1,
- -1, -1, 50, 3, 4, 53, 54, 7, 8, 9,
- -1, -1, 12, -1, -1, -1, -1, -1, -1, -1,
+ -1, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ -1, 42, 43, 44, 45, 46, -1, -1, -1, 50,
+ 3, 4, 53, 54, 7, 8, 9, -1, -1, 12,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 32, 33, -1, 35, 36, 37, 38, -1,
- -1, -1, 42, 43, 44, 45, 46, -1, -1, -1,
- 50, 3, 4, 53, 54, 7, 8, 9, -1, -1,
- 12, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 3, 4, -1, -1, 7, 8, -1, -1, -1,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, -1,
- -1, 3, 4, 45, 46, 7, 8, 9, 50, 31,
- 12, 53, 54, 35, 36, 37, 38, -1, -1, -1,
- -1, -1, -1, 45, 46, -1, 48, -1, 50, -1,
- 32, 53, 54, 35, 36, 37, 38, -1, -1, -1,
- 42, 43, 44, 45, 46, -1, -1, -1, 50, 3,
- 4, 53, 54, 7, 8, 9, -1, -1, 12, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 32,
+ 33, 34, 35, 36, 37, 38, 39, -1, -1, 42,
+ 43, 44, 45, 46, -1, -1, -1, 50, 3, 4,
+ 53, 54, 7, 8, 9, -1, -1, 12, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 32, 33,
- 34, 35, 36, 37, 38, 39, -1, -1, -1, 3,
- 4, 45, 46, 7, 8, 9, 50, -1, 12, 53,
- 54, -1, -1, -1, -1, -1, -1, -1, -1, 3,
- 4, -1, -1, 7, 8, -1, -1, -1, 32, 33,
- -1, 35, 36, 37, 38, -1, -1, -1, -1, 3,
- 4, 45, 46, 7, 8, 9, 50, 31, 12, 53,
- 54, 35, 36, 37, 38, -1, -1, -1, -1, -1,
- -1, 45, 46, -1, 48, -1, 50, -1, 32, 53,
- 54, 35, 36, 37, 38, 3, 4, -1, -1, 7,
- 8, 45, 46, -1, -1, -1, 50, -1, -1, 53,
- 54, -1, -1, -1, -1, 3, 4, -1, -1, 7,
- 8, 3, 4, 31, -1, 7, 8, 35, 36, 37,
- 38, -1, -1, -1, -1, -1, -1, 45, 46, -1,
- 48, -1, 50, -1, -1, 53, 54, 35, 36, 37,
- 38, -1, -1, 35, 36, 37, 38, 45, 46, -1,
- 48, -1, 50, 45, 46, 53, 54, -1, 50, -1,
- 4, 53, 54, 7, 8, 9, -1, -1, 12, -1,
- -1, -1, -1, 4, -1, -1, 7, 8, 9, -1,
+ -1, -1, -1, -1, -1, -1, -1, 32, 33, -1,
+ 35, 36, 37, 38, -1, -1, -1, 42, 43, 44,
+ 45, 46, -1, -1, -1, 50, 3, 4, 53, 54,
+ 7, 8, 9, -1, -1, 12, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 3, 4, -1, -1,
+ 7, 8, -1, -1, -1, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40, -1, -1, 3, 4, 45, 46,
+ 7, 8, 9, 50, 31, 12, 53, 54, 35, 36,
+ 37, 38, -1, -1, -1, -1, -1, -1, 45, 46,
+ -1, 48, -1, 50, -1, 32, 53, 54, 35, 36,
+ 37, 38, -1, -1, -1, 42, 43, 44, 45, 46,
+ -1, -1, -1, 50, 3, 4, 53, 54, 7, 8,
+ 9, -1, -1, 12, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 35, 36, -1, -1, -1, -1, -1, 42, 43,
- 44, 45, 46, -1, 35, 36, 50, -1, -1, 53,
- 54, 42, 43, 44, 45, 46, -1, -1, -1, 50,
- -1, -1, 53, 54
+ -1, -1, -1, 32, 33, 34, 35, 36, 37, 38,
+ 39, -1, -1, -1, 3, 4, 45, 46, 7, 8,
+ 9, 50, -1, 12, 53, 54, -1, -1, -1, -1,
+ -1, -1, -1, -1, 3, 4, -1, -1, 7, 8,
+ -1, -1, -1, 32, 33, -1, 35, 36, 37, 38,
+ -1, -1, -1, -1, 3, 4, 45, 46, 7, 8,
+ 9, 50, 31, 12, 53, 54, 35, 36, 37, 38,
+ -1, -1, -1, -1, -1, -1, 45, 46, -1, 48,
+ -1, 50, -1, 32, 53, 54, 35, 36, 37, 38,
+ 3, 4, -1, -1, 7, 8, 45, 46, -1, -1,
+ -1, 50, -1, -1, 53, 54, -1, -1, -1, -1,
+ 3, 4, -1, -1, 7, 8, 3, 4, 31, -1,
+ 7, 8, 35, 36, 37, 38, -1, -1, -1, -1,
+ -1, -1, 45, 46, -1, 48, -1, 50, -1, -1,
+ 53, 54, 35, 36, 37, 38, -1, -1, 35, 36,
+ 37, 38, 45, 46, -1, 48, -1, 50, 45, 46,
+ 53, 54, -1, 50, -1, 4, 53, 54, 7, 8,
+ 9, -1, -1, 12, -1, -1, -1, -1, 4, -1,
+ -1, 7, 8, 9, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 35, 36, -1, -1,
+ -1, -1, -1, 42, 43, 44, 45, 46, -1, 35,
+ 36, 50, -1, -1, 53, 54, 42, 43, 44, 45,
+ 46, -1, -1, -1, 50, -1, -1, 53, 54
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/local/lib/bison.simple"
@@ -807,7 +798,7 @@ static const short yycheck[] = { 3,
#ifdef __GNUC__
#define alloca __builtin_alloca
#else /* not GNU C. */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
#include <alloca.h>
#else /* not sparc */
#if defined (MSDOS) && !defined (__TURBOC__)
@@ -816,6 +807,16 @@ static const short yycheck[] = { 3,
#if defined(_AIX)
#include <malloc.h>
#pragma alloca
+#else /* not MSDOS, __TURBOC__, or _AIX */
+#ifdef __hpux
+#ifdef __cplusplus
+extern "C" {
+void *alloca (unsigned int);
+};
+#else /* not __cplusplus */
+void *alloca ();
+#endif /* not __cplusplus */
+#endif /* __hpux */
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc. */
@@ -909,6 +910,11 @@ int yydebug; /* nonzero means print parse trace */
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+int yyparse (void);
+#endif
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT)
@@ -949,7 +955,7 @@ __yy_bcopy (char *from, char *to, int count)
#endif
#endif
-#line 169 "/usr/local/lib/bison.simple"
+#line 184 "/usr/local/lib/bison.simple"
int
yyparse()
{
@@ -958,7 +964,7 @@ yyparse()
register short *yyssp;
register YYSTYPE *yyvsp;
int yyerrstatus; /* number of tokens to shift before error messages enabled */
- int yychar1; /* lookahead token as an internal (translated) token number */
+ int yychar1 = 0; /* lookahead token as an internal (translated) token number */
short yyssa[YYINITDEPTH]; /* the state stack */
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
@@ -1005,7 +1011,8 @@ yyparse()
/* Initialize stack pointers.
Waste one element of value and location stack
- so that they stay on the same level as the state stack. */
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
yyssp = yyss - 1;
yyvsp = yyvs;
@@ -1036,13 +1043,20 @@ yynewstate:
#ifdef yyoverflow
/* Each stack pointer address is followed by the size of
the data in use in that stack, in bytes. */
+#ifdef YYLSP_NEEDED
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if yyoverflow is a macro. */
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
-#ifdef YYLSP_NEEDED
&yyls1, size * sizeof (*yylsp),
-#endif
&yystacksize);
+#else
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yystacksize);
+#endif
yyss = yyss1; yyvs = yyvs1;
#ifdef YYLSP_NEEDED
@@ -1088,6 +1102,7 @@ yynewstate:
fprintf(stderr, "Entering state %d\n", yystate);
#endif
+ goto yybackup;
yybackup:
/* Do appropriate processing given the current state. */
@@ -1202,7 +1217,8 @@ yydefault:
/* Do a reduction. yyn is the number of a rule to reduce with. */
yyreduce:
yylen = yyr2[yyn];
- yyval = yyvsp[1-yylen]; /* implement default value of the action */
+ if (yylen > 0)
+ yyval = yyvsp[1-yylen]; /* implement default value of the action */
#if YYDEBUG != 0
if (yydebug)
@@ -1212,7 +1228,7 @@ yyreduce:
fprintf (stderr, "Reducing via rule %d (line %d), ",
yyn, yyrline[yyn]);
- /* Print the symboles being reduced, and their result. */
+ /* Print the symbols being reduced, and their result. */
for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
fprintf (stderr, "%s ", yytname[yyrhs[i]]);
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
@@ -1223,11 +1239,11 @@ yyreduce:
switch (yyn) {
case 1:
-#line 136 "awk.y"
+#line 137 "awk.y"
{ expression_value = yyvsp[-1].nodeval; ;
break;}
case 2:
-#line 141 "awk.y"
+#line 142 "awk.y"
{
if (yyvsp[0].nodeval != NULL)
yyval.nodeval = yyvsp[0].nodeval;
@@ -1237,7 +1253,7 @@ case 2:
;
break;}
case 3:
-#line 150 "awk.y"
+#line 151 "awk.y"
{
if (yyvsp[0].nodeval == NULL)
yyval.nodeval = yyvsp[-1].nodeval;
@@ -1254,23 +1270,23 @@ case 3:
;
break;}
case 4:
-#line 164 "awk.y"
+#line 165 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 5:
-#line 165 "awk.y"
+#line 166 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 6:
-#line 166 "awk.y"
+#line 167 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 7:
-#line 170 "awk.y"
+#line 171 "awk.y"
{ io_allowed = 0; ;
break;}
case 8:
-#line 172 "awk.y"
+#line 173 "awk.y"
{
if (begin_block) {
if (begin_block->type != Node_rule_list)
@@ -1287,11 +1303,11 @@ case 8:
;
break;}
case 9:
-#line 186 "awk.y"
+#line 187 "awk.y"
{ io_allowed = 0; ;
break;}
case 10:
-#line 188 "awk.y"
+#line 189 "awk.y"
{
if (end_block) {
if (end_block->type != Node_rule_list)
@@ -1308,7 +1324,7 @@ case 10:
;
break;}
case 11:
-#line 203 "awk.y"
+#line 204 "awk.y"
{
warning("BEGIN blocks must have an action part");
errcount++;
@@ -1316,7 +1332,7 @@ case 11:
;
break;}
case 12:
-#line 209 "awk.y"
+#line 210 "awk.y"
{
warning("END blocks must have an action part");
errcount++;
@@ -1324,15 +1340,15 @@ case 12:
;
break;}
case 13:
-#line 215 "awk.y"
+#line 216 "awk.y"
{ yyval.nodeval = node (yyvsp[-1].nodeval, Node_rule_node, yyvsp[0].nodeval); yyerrok; ;
break;}
case 14:
-#line 217 "awk.y"
+#line 218 "awk.y"
{ yyval.nodeval = node ((NODE *)NULL, Node_rule_node, yyvsp[0].nodeval); yyerrok; ;
break;}
case 15:
-#line 219 "awk.y"
+#line 220 "awk.y"
{
yyval.nodeval = node (yyvsp[-1].nodeval,
Node_rule_node,
@@ -1347,7 +1363,7 @@ case 15:
;
break;}
case 16:
-#line 232 "awk.y"
+#line 233 "awk.y"
{
func_install(yyvsp[-1].nodeval, yyvsp[0].nodeval);
yyval.nodeval = NULL;
@@ -1355,15 +1371,15 @@ case 16:
;
break;}
case 17:
-#line 241 "awk.y"
+#line 242 "awk.y"
{ yyval.sval = yyvsp[0].sval; ;
break;}
case 18:
-#line 243 "awk.y"
+#line 244 "awk.y"
{ yyval.sval = yyvsp[0].sval; ;
break;}
case 19:
-#line 245 "awk.y"
+#line 246 "awk.y"
{
yyerror("%s() is a built-in function, it cannot be redefined",
tokstart);
@@ -1372,20 +1388,23 @@ case 19:
;
break;}
case 22:
-#line 260 "awk.y"
+#line 261 "awk.y"
{
param_counter = 0;
;
break;}
case 23:
-#line 264 "awk.y"
+#line 265 "awk.y"
{
yyval.nodeval = append_right(make_param(yyvsp[-4].sval), yyvsp[-2].nodeval);
can_return = 1;
+ /* check for duplicate parameter names */
+ if (dup_parms(yyval.nodeval))
+ errcount++;
;
break;}
case 24:
-#line 272 "awk.y"
+#line 276 "awk.y"
{
yyval.nodeval = yyvsp[-2].nodeval;
can_return = 0;
@@ -1393,18 +1412,25 @@ case 24:
break;}
case 25:
#line 281 "awk.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
+{
+ yyval.nodeval = node((NODE *) NULL, Node_K_return, (NODE *) NULL);
+ can_return = 0;
+ ;
break;}
case 26:
-#line 283 "awk.y"
-{ yyval.nodeval = mkrangenode ( node(yyvsp[-2].nodeval, Node_cond_pair, yyvsp[0].nodeval) ); ;
+#line 290 "awk.y"
+{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 27:
#line 292 "awk.y"
-{ ++want_regexp; ;
+{ yyval.nodeval = mkrangenode ( node(yyvsp[-2].nodeval, Node_cond_pair, yyvsp[0].nodeval) ); ;
break;}
case 28:
-#line 294 "awk.y"
+#line 301 "awk.y"
+{ ++want_regexp; ;
+ break;}
+case 29:
+#line 303 "awk.y"
{
NODE *n;
size_t len;
@@ -1420,20 +1446,20 @@ case 28:
yyval.nodeval = n;
;
break;}
-case 29:
-#line 312 "awk.y"
+case 30:
+#line 321 "awk.y"
{ yyval.nodeval = yyvsp[-3].nodeval ; ;
break;}
-case 30:
-#line 314 "awk.y"
+case 31:
+#line 323 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
-case 31:
-#line 319 "awk.y"
+case 32:
+#line 328 "awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 32:
-#line 321 "awk.y"
+case 33:
+#line 330 "awk.y"
{
if (yyvsp[-1].nodeval == NULL || yyvsp[-1].nodeval->type != Node_statement_list)
yyvsp[-1].nodeval = node(yyvsp[-1].nodeval, Node_statement_list,(NODE *)NULL);
@@ -1442,85 +1468,94 @@ case 32:
yyerrok;
;
break;}
-case 33:
-#line 329 "awk.y"
-{ yyval.nodeval = NULL; ;
- break;}
case 34:
-#line 331 "awk.y"
+#line 338 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
-case 37:
-#line 341 "awk.y"
+case 35:
+#line 340 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 38:
-#line 343 "awk.y"
+#line 350 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 39:
-#line 345 "awk.y"
-{ yyval.nodeval = yyvsp[-1].nodeval; ;
+#line 352 "awk.y"
+{ yyval.nodeval = NULL; ;
break;}
case 40:
-#line 347 "awk.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
+#line 354 "awk.y"
+{ yyval.nodeval = yyvsp[-1].nodeval; ;
break;}
case 41:
-#line 349 "awk.y"
-{ yyval.nodeval = node (yyvsp[-3].nodeval, Node_K_while, yyvsp[0].nodeval); ;
+#line 356 "awk.y"
+{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 42:
-#line 351 "awk.y"
-{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_K_do, yyvsp[-5].nodeval); ;
+#line 358 "awk.y"
+{ yyval.nodeval = node (yyvsp[-3].nodeval, Node_K_while, yyvsp[0].nodeval); ;
break;}
case 43:
-#line 353 "awk.y"
+#line 360 "awk.y"
+{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_K_do, yyvsp[-5].nodeval); ;
+ break;}
+case 44:
+#line 362 "awk.y"
{
yyval.nodeval = node (yyvsp[0].nodeval, Node_K_arrayfor, make_for_loop(variable(yyvsp[-5].sval,1),
(NODE *)NULL, variable(yyvsp[-3].sval,1)));
;
break;}
-case 44:
-#line 358 "awk.y"
+case 45:
+#line 367 "awk.y"
{
yyval.nodeval = node(yyvsp[0].nodeval, Node_K_for, (NODE *)make_for_loop(yyvsp[-7].nodeval, yyvsp[-5].nodeval, yyvsp[-3].nodeval));
;
break;}
-case 45:
-#line 362 "awk.y"
+case 46:
+#line 371 "awk.y"
{
yyval.nodeval = node (yyvsp[0].nodeval, Node_K_for,
(NODE *)make_for_loop(yyvsp[-6].nodeval, (NODE *)NULL, yyvsp[-3].nodeval));
;
break;}
-case 46:
-#line 368 "awk.y"
+case 47:
+#line 377 "awk.y"
{ yyval.nodeval = node ((NODE *)NULL, Node_K_break, (NODE *)NULL); ;
break;}
-case 47:
-#line 371 "awk.y"
+case 48:
+#line 380 "awk.y"
{ yyval.nodeval = node ((NODE *)NULL, Node_K_continue, (NODE *)NULL); ;
break;}
-case 48:
-#line 373 "awk.y"
+case 49:
+#line 382 "awk.y"
{ yyval.nodeval = node (yyvsp[-3].nodeval, yyvsp[-5].nodetypeval, yyvsp[-1].nodeval); ;
break;}
-case 49:
-#line 375 "awk.y"
+case 50:
+#line 384 "awk.y"
{
- if (yyvsp[-3].nodetypeval == Node_K_print && yyvsp[-2].nodeval == NULL)
+ if (yyvsp[-3].nodetypeval == Node_K_print && yyvsp[-2].nodeval == NULL) {
+ static int warned = 0;
+
yyvsp[-2].nodeval = node(node(make_number(0.0),
Node_field_spec,
(NODE *) NULL),
Node_expression_list,
(NODE *) NULL);
+ if (do_lint && ! io_allowed && ! warned) {
+ warned = 1;
+ warning(
+ "plain `print' in BEGIN or END rule should probably be `print \"\"'");
+ }
+ }
+
yyval.nodeval = node (yyvsp[-2].nodeval, yyvsp[-3].nodetypeval, yyvsp[-1].nodeval);
;
break;}
-case 50:
-#line 386 "awk.y"
+case 51:
+#line 404 "awk.y"
{ NODETYPE type;
if (yyvsp[-1].nodeval && yyvsp[-1].nodeval == lookup("file")) {
@@ -1532,12 +1567,12 @@ case 50:
* the source line
*/
errcount++;
- msg("`next file' is a gawk extension");
+ error("`next file' is a gawk extension");
}
if (! io_allowed) {
/* same thing */
errcount++;
- msg("`next file' used in BEGIN or END action");
+ error("`next file' used in BEGIN or END action");
}
type = Node_K_nextfile;
} else {
@@ -1548,24 +1583,24 @@ case 50:
yyval.nodeval = node ((NODE *)NULL, type, (NODE *)NULL);
;
break;}
-case 51:
-#line 413 "awk.y"
+case 52:
+#line 431 "awk.y"
{ yyval.nodeval = node (yyvsp[-1].nodeval, Node_K_exit, (NODE *)NULL); ;
break;}
-case 52:
-#line 415 "awk.y"
+case 53:
+#line 433 "awk.y"
{ if (! can_return) yyerror("return used outside function context"); ;
break;}
-case 53:
-#line 417 "awk.y"
+case 54:
+#line 435 "awk.y"
{ yyval.nodeval = node (yyvsp[-1].nodeval, Node_K_return, (NODE *)NULL); ;
break;}
-case 54:
-#line 419 "awk.y"
+case 55:
+#line 437 "awk.y"
{ yyval.nodeval = node (variable(yyvsp[-4].sval,1), Node_K_delete, yyvsp[-2].nodeval); ;
break;}
-case 55:
-#line 421 "awk.y"
+case 56:
+#line 439 "awk.y"
{
if (do_lint)
warning("`delete array' is a gawk extension");
@@ -1575,224 +1610,232 @@ case 55:
* the source line
*/
errcount++;
- msg("`delete array' is a gawk extension");
+ error("`delete array' is a gawk extension");
}
yyval.nodeval = node (variable(yyvsp[-1].sval,1), Node_K_delete, (NODE *) NULL);
;
break;}
-case 56:
-#line 435 "awk.y"
-{ yyval.nodeval = yyvsp[-1].nodeval; ;
- break;}
case 57:
-#line 440 "awk.y"
-{ yyval.nodetypeval = yyvsp[0].nodetypeval; ;
+#line 453 "awk.y"
+{ yyval.nodeval = yyvsp[-1].nodeval; ;
break;}
case 58:
-#line 442 "awk.y"
+#line 458 "awk.y"
{ yyval.nodetypeval = yyvsp[0].nodetypeval; ;
break;}
case 59:
-#line 447 "awk.y"
+#line 460 "awk.y"
+{ yyval.nodetypeval = yyvsp[0].nodetypeval; ;
+ break;}
+case 60:
+#line 465 "awk.y"
{
yyval.nodeval = node(yyvsp[-3].nodeval, Node_K_if,
node(yyvsp[0].nodeval, Node_if_branches, (NODE *)NULL));
;
break;}
-case 60:
-#line 453 "awk.y"
+case 61:
+#line 471 "awk.y"
{ yyval.nodeval = node (yyvsp[-6].nodeval, Node_K_if,
node (yyvsp[-3].nodeval, Node_if_branches, yyvsp[0].nodeval)); ;
break;}
-case 61:
-#line 459 "awk.y"
+case 62:
+#line 477 "awk.y"
{ want_assign = 0; ;
break;}
-case 65:
-#line 470 "awk.y"
-{ yyval.nodeval = NULL; ;
- break;}
case 66:
-#line 472 "awk.y"
-{ yyval.nodeval = node (yyvsp[0].nodeval, Node_redirect_input, (NODE *)NULL); ;
+#line 488 "awk.y"
+{ yyval.nodeval = NULL; ;
break;}
case 67:
-#line 477 "awk.y"
-{ yyval.nodeval = NULL; ;
+#line 490 "awk.y"
+{ yyval.nodeval = node (yyvsp[0].nodeval, Node_redirect_input, (NODE *)NULL); ;
break;}
case 68:
-#line 479 "awk.y"
-{ yyval.nodeval = node (yyvsp[0].nodeval, Node_redirect_output, (NODE *)NULL); ;
+#line 495 "awk.y"
+{ yyval.nodeval = NULL; ;
break;}
case 69:
-#line 481 "awk.y"
-{ yyval.nodeval = node (yyvsp[0].nodeval, Node_redirect_append, (NODE *)NULL); ;
+#line 497 "awk.y"
+{ yyval.nodeval = node (yyvsp[0].nodeval, Node_redirect_output, (NODE *)NULL); ;
break;}
case 70:
-#line 483 "awk.y"
-{ yyval.nodeval = node (yyvsp[0].nodeval, Node_redirect_pipe, (NODE *)NULL); ;
+#line 499 "awk.y"
+{ yyval.nodeval = node (yyvsp[0].nodeval, Node_redirect_append, (NODE *)NULL); ;
break;}
case 71:
-#line 488 "awk.y"
-{ yyval.nodeval = NULL; ;
+#line 501 "awk.y"
+{ yyval.nodeval = node (yyvsp[0].nodeval, Node_redirect_pipe, (NODE *)NULL); ;
break;}
case 72:
-#line 490 "awk.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
+#line 506 "awk.y"
+{ yyval.nodeval = NULL; ;
break;}
case 73:
-#line 495 "awk.y"
-{ yyval.nodeval = make_param(yyvsp[0].sval); ;
+#line 508 "awk.y"
+{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 74:
-#line 497 "awk.y"
-{ yyval.nodeval = append_right(yyvsp[-2].nodeval, make_param(yyvsp[0].sval)); yyerrok; ;
+#line 513 "awk.y"
+{ yyval.nodeval = make_param(yyvsp[0].sval); ;
break;}
case 75:
-#line 499 "awk.y"
-{ yyval.nodeval = NULL; ;
+#line 515 "awk.y"
+{ yyval.nodeval = append_right(yyvsp[-2].nodeval, make_param(yyvsp[0].sval)); yyerrok; ;
break;}
case 76:
-#line 501 "awk.y"
+#line 517 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 77:
-#line 503 "awk.y"
+#line 519 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 78:
-#line 509 "awk.y"
+#line 521 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 79:
-#line 511 "awk.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
+#line 527 "awk.y"
+{ yyval.nodeval = NULL; ;
break;}
case 80:
-#line 516 "awk.y"
-{ yyval.nodeval = NULL; ;
+#line 529 "awk.y"
+{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 81:
-#line 518 "awk.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
+#line 534 "awk.y"
+{ yyval.nodeval = NULL; ;
break;}
case 82:
-#line 523 "awk.y"
-{ yyval.nodeval = node (yyvsp[0].nodeval, Node_expression_list, (NODE *)NULL); ;
+#line 536 "awk.y"
+{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 83:
-#line 525 "awk.y"
+#line 541 "awk.y"
+{ yyval.nodeval = node (yyvsp[0].nodeval, Node_expression_list, (NODE *)NULL); ;
+ break;}
+case 84:
+#line 543 "awk.y"
{
yyval.nodeval = append_right(yyvsp[-2].nodeval,
node( yyvsp[0].nodeval, Node_expression_list, (NODE *)NULL));
yyerrok;
;
break;}
-case 84:
-#line 531 "awk.y"
-{ yyval.nodeval = NULL; ;
- break;}
case 85:
-#line 533 "awk.y"
+#line 549 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 86:
-#line 535 "awk.y"
+#line 551 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 87:
-#line 537 "awk.y"
+#line 553 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 88:
-#line 542 "awk.y"
+#line 555 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 89:
-#line 544 "awk.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
+#line 560 "awk.y"
+{ yyval.nodeval = NULL; ;
break;}
case 90:
-#line 549 "awk.y"
-{ yyval.nodeval = node (yyvsp[0].nodeval, Node_expression_list, (NODE *)NULL); ;
+#line 562 "awk.y"
+{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 91:
-#line 551 "awk.y"
+#line 567 "awk.y"
+{ yyval.nodeval = node (yyvsp[0].nodeval, Node_expression_list, (NODE *)NULL); ;
+ break;}
+case 92:
+#line 569 "awk.y"
{
yyval.nodeval = append_right(yyvsp[-2].nodeval,
node( yyvsp[0].nodeval, Node_expression_list, (NODE *)NULL));
yyerrok;
;
break;}
-case 92:
-#line 557 "awk.y"
-{ yyval.nodeval = NULL; ;
- break;}
case 93:
-#line 559 "awk.y"
+#line 575 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 94:
-#line 561 "awk.y"
+#line 577 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 95:
-#line 563 "awk.y"
+#line 579 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
case 96:
-#line 568 "awk.y"
-{ want_assign = 0; ;
+#line 581 "awk.y"
+{ yyval.nodeval = NULL; ;
break;}
case 97:
-#line 570 "awk.y"
+#line 586 "awk.y"
+{ want_assign = 0; ;
+ break;}
+case 98:
+#line 588 "awk.y"
{
if (do_lint && yyvsp[0].nodeval->type == Node_regex)
warning("Regular expression on left of assignment.");
yyval.nodeval = node (yyvsp[-3].nodeval, yyvsp[-2].nodetypeval, yyvsp[0].nodeval);
;
break;}
-case 98:
-#line 576 "awk.y"
+case 99:
+#line 594 "awk.y"
{ yyval.nodeval = node (variable(yyvsp[0].sval,1), Node_in_array, yyvsp[-3].nodeval); ;
break;}
-case 99:
-#line 578 "awk.y"
+case 100:
+#line 596 "awk.y"
{
yyval.nodeval = node (yyvsp[0].nodeval, Node_K_getline,
node (yyvsp[-3].nodeval, Node_redirect_pipein, (NODE *)NULL));
;
break;}
-case 100:
-#line 583 "awk.y"
+case 101:
+#line 601 "awk.y"
{
if (do_lint && ! io_allowed && yyvsp[0].nodeval == NULL)
warning("non-redirected getline undefined inside BEGIN or END action");
yyval.nodeval = node (yyvsp[-1].nodeval, Node_K_getline, yyvsp[0].nodeval);
;
break;}
-case 101:
-#line 589 "awk.y"
+case 102:
+#line 607 "awk.y"
{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_and, yyvsp[0].nodeval); ;
break;}
-case 102:
-#line 591 "awk.y"
+case 103:
+#line 609 "awk.y"
{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_or, yyvsp[0].nodeval); ;
break;}
-case 103:
-#line 593 "awk.y"
+case 104:
+#line 611 "awk.y"
{
if (yyvsp[-2].nodeval->type == Node_regex)
warning("Regular expression on left of MATCH operator.");
yyval.nodeval = node (yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, mk_rexp(yyvsp[0].nodeval));
;
break;}
-case 104:
-#line 599 "awk.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
case 105:
-#line 601 "awk.y"
+#line 617 "awk.y"
+{
+ yyval.nodeval = yyvsp[0].nodeval;
+ if (do_lint && tokstart[0] == '*') {
+ /* possible C comment */
+ int n = strlen(tokstart) - 1;
+ if (tokstart[n] == '*')
+ warning("regexp looks like a C comment, but is not");
+ }
+ ;
+ break;}
+case 106:
+#line 627 "awk.y"
{
yyval.nodeval = node(node(make_number(0.0),
Node_field_spec,
@@ -1801,144 +1844,144 @@ case 105:
yyvsp[0].nodeval);
;
break;}
-case 106:
-#line 609 "awk.y"
+case 107:
+#line 635 "awk.y"
{ yyval.nodeval = node (variable(yyvsp[0].sval,1), Node_in_array, yyvsp[-2].nodeval); ;
break;}
-case 107:
-#line 611 "awk.y"
+case 108:
+#line 637 "awk.y"
{
if (do_lint && yyvsp[0].nodeval->type == Node_regex)
warning("Regular expression on left of comparison.");
yyval.nodeval = node (yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, yyvsp[0].nodeval);
;
break;}
-case 108:
-#line 617 "awk.y"
+case 109:
+#line 643 "awk.y"
{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_less, yyvsp[0].nodeval); ;
break;}
-case 109:
-#line 619 "awk.y"
+case 110:
+#line 645 "awk.y"
{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_greater, yyvsp[0].nodeval); ;
break;}
-case 110:
-#line 621 "awk.y"
+case 111:
+#line 647 "awk.y"
{ yyval.nodeval = node(yyvsp[-4].nodeval, Node_cond_exp, node(yyvsp[-2].nodeval, Node_if_branches, yyvsp[0].nodeval));;
break;}
-case 111:
-#line 623 "awk.y"
+case 112:
+#line 649 "awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 112:
-#line 625 "awk.y"
+case 113:
+#line 651 "awk.y"
{ yyval.nodeval = node (yyvsp[-1].nodeval, Node_concat, yyvsp[0].nodeval); ;
break;}
-case 113:
-#line 630 "awk.y"
+case 114:
+#line 656 "awk.y"
{ want_assign = 0; ;
break;}
-case 114:
-#line 632 "awk.y"
+case 115:
+#line 658 "awk.y"
{ yyval.nodeval = node (yyvsp[-3].nodeval, yyvsp[-2].nodetypeval, yyvsp[0].nodeval); ;
break;}
-case 115:
-#line 634 "awk.y"
+case 116:
+#line 660 "awk.y"
{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_and, yyvsp[0].nodeval); ;
break;}
-case 116:
-#line 636 "awk.y"
+case 117:
+#line 662 "awk.y"
{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_or, yyvsp[0].nodeval); ;
break;}
-case 117:
-#line 638 "awk.y"
+case 118:
+#line 664 "awk.y"
{
if (do_lint && ! io_allowed && yyvsp[0].nodeval == NULL)
warning("non-redirected getline undefined inside BEGIN or END action");
yyval.nodeval = node (yyvsp[-1].nodeval, Node_K_getline, yyvsp[0].nodeval);
;
break;}
-case 118:
-#line 644 "awk.y"
+case 119:
+#line 670 "awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 119:
-#line 646 "awk.y"
+case 120:
+#line 672 "awk.y"
{ yyval.nodeval = node((NODE *) NULL, Node_nomatch, yyvsp[0].nodeval); ;
break;}
-case 120:
-#line 648 "awk.y"
+case 121:
+#line 674 "awk.y"
{ yyval.nodeval = node (yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, mk_rexp(yyvsp[0].nodeval)); ;
break;}
-case 121:
-#line 650 "awk.y"
+case 122:
+#line 676 "awk.y"
{ yyval.nodeval = node (variable(yyvsp[0].sval,1), Node_in_array, yyvsp[-2].nodeval); ;
break;}
-case 122:
-#line 652 "awk.y"
+case 123:
+#line 678 "awk.y"
{ yyval.nodeval = node (yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, yyvsp[0].nodeval); ;
break;}
-case 123:
-#line 654 "awk.y"
+case 124:
+#line 680 "awk.y"
{ yyval.nodeval = node(yyvsp[-4].nodeval, Node_cond_exp, node(yyvsp[-2].nodeval, Node_if_branches, yyvsp[0].nodeval));;
break;}
-case 124:
-#line 656 "awk.y"
+case 125:
+#line 682 "awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 125:
-#line 658 "awk.y"
+case 126:
+#line 684 "awk.y"
{ yyval.nodeval = node (yyvsp[-1].nodeval, Node_concat, yyvsp[0].nodeval); ;
break;}
-case 127:
-#line 665 "awk.y"
-{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_exp, yyvsp[0].nodeval); ;
- break;}
case 128:
-#line 667 "awk.y"
-{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_times, yyvsp[0].nodeval); ;
+#line 691 "awk.y"
+{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_exp, yyvsp[0].nodeval); ;
break;}
case 129:
-#line 669 "awk.y"
-{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_quotient, yyvsp[0].nodeval); ;
+#line 693 "awk.y"
+{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_times, yyvsp[0].nodeval); ;
break;}
case 130:
-#line 671 "awk.y"
-{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_mod, yyvsp[0].nodeval); ;
+#line 695 "awk.y"
+{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_quotient, yyvsp[0].nodeval); ;
break;}
case 131:
-#line 673 "awk.y"
-{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_plus, yyvsp[0].nodeval); ;
+#line 697 "awk.y"
+{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_mod, yyvsp[0].nodeval); ;
break;}
case 132:
-#line 675 "awk.y"
-{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_minus, yyvsp[0].nodeval); ;
+#line 699 "awk.y"
+{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_plus, yyvsp[0].nodeval); ;
break;}
case 133:
-#line 677 "awk.y"
-{ yyval.nodeval = node (yyvsp[-1].nodeval, Node_postincrement, (NODE *)NULL); ;
+#line 701 "awk.y"
+{ yyval.nodeval = node (yyvsp[-2].nodeval, Node_minus, yyvsp[0].nodeval); ;
break;}
case 134:
-#line 679 "awk.y"
-{ yyval.nodeval = node (yyvsp[-1].nodeval, Node_postdecrement, (NODE *)NULL); ;
+#line 703 "awk.y"
+{ yyval.nodeval = node (yyvsp[-1].nodeval, Node_postincrement, (NODE *)NULL); ;
break;}
case 135:
-#line 684 "awk.y"
-{ yyval.nodeval = node (yyvsp[0].nodeval, Node_not,(NODE *) NULL); ;
+#line 705 "awk.y"
+{ yyval.nodeval = node (yyvsp[-1].nodeval, Node_postdecrement, (NODE *)NULL); ;
break;}
case 136:
-#line 686 "awk.y"
-{ yyval.nodeval = yyvsp[-1].nodeval; ;
+#line 710 "awk.y"
+{ yyval.nodeval = node (yyvsp[0].nodeval, Node_not,(NODE *) NULL); ;
break;}
case 137:
-#line 689 "awk.y"
-{ yyval.nodeval = snode (yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); ;
+#line 712 "awk.y"
+{ yyval.nodeval = yyvsp[-1].nodeval; ;
break;}
case 138:
-#line 691 "awk.y"
+#line 715 "awk.y"
{ yyval.nodeval = snode (yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); ;
break;}
case 139:
-#line 693 "awk.y"
+#line 717 "awk.y"
+{ yyval.nodeval = snode (yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); ;
+ break;}
+case 140:
+#line 719 "awk.y"
{
if (do_lint)
warning("call of `length' without parentheses is not portable");
@@ -1947,30 +1990,31 @@ case 139:
warning( "call of `length' without parentheses is deprecated by POSIX");
;
break;}
-case 140:
-#line 701 "awk.y"
+case 141:
+#line 727 "awk.y"
{
yyval.nodeval = node (yyvsp[-1].nodeval, Node_func_call, make_string(yyvsp[-3].sval, strlen(yyvsp[-3].sval)));
+ free(yyvsp[-3].sval);
;
break;}
-case 142:
-#line 706 "awk.y"
-{ yyval.nodeval = node (yyvsp[0].nodeval, Node_preincrement, (NODE *)NULL); ;
- break;}
case 143:
-#line 708 "awk.y"
-{ yyval.nodeval = node (yyvsp[0].nodeval, Node_predecrement, (NODE *)NULL); ;
+#line 733 "awk.y"
+{ yyval.nodeval = node (yyvsp[0].nodeval, Node_preincrement, (NODE *)NULL); ;
break;}
case 144:
-#line 710 "awk.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
+#line 735 "awk.y"
+{ yyval.nodeval = node (yyvsp[0].nodeval, Node_predecrement, (NODE *)NULL); ;
break;}
case 145:
-#line 712 "awk.y"
+#line 737 "awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 146:
-#line 715 "awk.y"
+#line 739 "awk.y"
+{ yyval.nodeval = yyvsp[0].nodeval; ;
+ break;}
+case 147:
+#line 742 "awk.y"
{ if (yyvsp[0].nodeval->type == Node_val) {
yyvsp[0].nodeval->numbr = -(force_number(yyvsp[0].nodeval));
yyval.nodeval = yyvsp[0].nodeval;
@@ -1978,28 +2022,28 @@ case 146:
yyval.nodeval = node (yyvsp[0].nodeval, Node_unary_minus, (NODE *)NULL);
;
break;}
-case 147:
-#line 722 "awk.y"
+case 148:
+#line 749 "awk.y"
{
/* was: $$ = $2 */
/* POSIX semantics: force a conversion to numeric type */
yyval.nodeval = node (make_number(0.0), Node_plus, yyvsp[0].nodeval);
;
break;}
-case 148:
-#line 731 "awk.y"
+case 149:
+#line 758 "awk.y"
{ yyval.nodeval = NULL; ;
break;}
-case 149:
-#line 733 "awk.y"
+case 150:
+#line 760 "awk.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 150:
-#line 738 "awk.y"
+case 151:
+#line 765 "awk.y"
{ yyval.nodeval = variable(yyvsp[0].sval,1); ;
break;}
-case 151:
-#line 740 "awk.y"
+case 152:
+#line 767 "awk.y"
{
if (yyvsp[-1].nodeval->rnode == NULL) {
yyval.nodeval = node (variable(yyvsp[-3].sval,1), Node_subscript, yyvsp[-1].nodeval->lnode);
@@ -2008,29 +2052,29 @@ case 151:
yyval.nodeval = node (variable(yyvsp[-3].sval,1), Node_subscript, yyvsp[-1].nodeval);
;
break;}
-case 152:
-#line 748 "awk.y"
+case 153:
+#line 775 "awk.y"
{ yyval.nodeval = node (yyvsp[0].nodeval, Node_field_spec, (NODE *)NULL); ;
break;}
-case 154:
-#line 756 "awk.y"
+case 155:
+#line 783 "awk.y"
{ yyerrok; ;
break;}
-case 155:
-#line 760 "awk.y"
+case 156:
+#line 787 "awk.y"
{ yyerrok; ;
break;}
-case 158:
-#line 769 "awk.y"
+case 159:
+#line 796 "awk.y"
{ yyerrok; want_assign = 0; ;
break;}
-case 159:
-#line 772 "awk.y"
+case 160:
+#line 799 "awk.y"
{ yyerrok; ;
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 440 "/usr/local/lib/bison.simple"
+#line 465 "/usr/local/lib/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
@@ -2100,7 +2144,9 @@ yyerrlab: /* here on detecting error */
int x, count;
count = 0;
- for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
+ /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
msg = (char *) malloc(size + 15);
@@ -2111,7 +2157,8 @@ yyerrlab: /* here on detecting error */
if (count < 5)
{
count = 0;
- for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
strcat(msg, count == 0 ? ", expecting `" : " or `");
@@ -2131,6 +2178,7 @@ yyerrlab: /* here on detecting error */
yyerror("parse error");
}
+ goto yyerrlab1;
yyerrlab1: /* here on error raised explicitly by an action */
if (yyerrstatus == 3)
@@ -2222,7 +2270,7 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
}
-#line 775 "awk.y"
+#line 802 "awk.y"
struct token {
@@ -2465,9 +2513,10 @@ again:
if (n == 0) {
samefile = 0;
nextfile++;
- *lexeme = '\0';
+ if (lexeme)
+ *lexeme = '\0';
len = 0;
- return get_src_buf();
+ goto again;
}
lexptr = buf + SLOP;
lexend = lexptr + n;
@@ -2496,12 +2545,16 @@ tokexpand()
#if DEBUG
char
nextc() {
+ int c;
+
if (lexptr && lexptr < lexend)
- return *lexptr++;
+ c = *lexptr++;
else if (get_src_buf())
- return *lexptr++;
+ c = *lexptr++;
else
- return '\0';
+ c = '\0';
+
+ return c;
}
#else
#define nextc() ((lexptr && lexptr < lexend) ? \
@@ -2525,9 +2578,19 @@ yylex()
int low, mid, high;
static int did_newline = 0;
char *tokkey;
-
- if (!nextc())
+ static int lasttok = 0, eof_warned = 0;
+
+ if (!nextc()) {
+ if (lasttok != NEWLINE) {
+ lasttok = NEWLINE;
+ if (do_lint && ! eof_warned) {
+ warning("source file does not end in newline");
+ eof_warned = 1;
+ }
+ return NEWLINE; /* fake it */
+ }
return 0;
+ }
pushback();
#ifdef OS2
/*
@@ -2570,7 +2633,7 @@ yylex()
pushback();
tokadd('\0');
yylval.sval = tokstart;
- return REGEXP;
+ return lasttok = REGEXP;
case '\n':
pushback();
yyerror("unterminated regexp");
@@ -2591,19 +2654,37 @@ retry:
switch (c) {
case 0:
+ if (lasttok != NEWLINE) {
+ lasttok = NEWLINE;
+ if (do_lint && ! eof_warned) {
+ warning("source file does not end in newline");
+ eof_warned = 1;
+ }
+ return NEWLINE; /* fake it */
+ }
return 0;
case '\n':
sourceline++;
- return NEWLINE;
+ return lasttok = NEWLINE;
case '#': /* it's a comment */
while ((c = nextc()) != '\n') {
- if (c == '\0')
+ if (c == '\0') {
+ if (lasttok != NEWLINE) {
+ lasttok = NEWLINE;
+ if (do_lint && ! eof_warned) {
+ warning(
+ "source file does not end in newline");
+ eof_warned = 1;
+ }
+ return NEWLINE; /* fake it */
+ }
return 0;
+ }
}
sourceline++;
- return NEWLINE;
+ return lasttok = NEWLINE;
case '\\':
#ifdef RELAXED_CONTINUATION
@@ -2633,7 +2714,7 @@ retry:
case '$':
want_assign = 1;
- return '$';
+ return lasttok = '$';
case ')':
case ']':
@@ -2644,15 +2725,15 @@ retry:
case '?':
case '{':
case ',':
- return c;
+ return lasttok = c;
case '*':
if ((c = nextc()) == '=') {
yylval.nodetypeval = Node_assign_times;
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
} else if (do_posix) {
pushback();
- return '*';
+ return lasttok = '*';
} else if (c == '*') {
/* make ** and **= aliases for ^ and ^= */
static int did_warn_op = 0, did_warn_assgn = 0;
@@ -2663,36 +2744,36 @@ retry:
warning("**= is not allowed by POSIX");
}
yylval.nodetypeval = Node_assign_exp;
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
} else {
pushback();
if (do_lint && ! did_warn_op) {
did_warn_op = 1;
warning("** is not allowed by POSIX");
}
- return '^';
+ return lasttok = '^';
}
}
pushback();
- return '*';
+ return lasttok = '*';
case '/':
if (want_assign) {
if (nextc() == '=') {
yylval.nodetypeval = Node_assign_quotient;
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
}
pushback();
}
- return '/';
+ return lasttok = '/';
case '%':
if (nextc() == '=') {
yylval.nodetypeval = Node_assign_mod;
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
}
pushback();
- return '%';
+ return lasttok = '%';
case '^':
{
@@ -2705,73 +2786,73 @@ retry:
warning("operator `^=' is not supported in old awk");
}
yylval.nodetypeval = Node_assign_exp;
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
}
pushback();
if (do_lint && ! did_warn_op) {
did_warn_op = 1;
warning("operator `^' is not supported in old awk");
}
- return '^';
+ return lasttok = '^';
}
case '+':
if ((c = nextc()) == '=') {
yylval.nodetypeval = Node_assign_plus;
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
}
if (c == '+')
- return INCREMENT;
+ return lasttok = INCREMENT;
pushback();
- return '+';
+ return lasttok = '+';
case '!':
if ((c = nextc()) == '=') {
yylval.nodetypeval = Node_notequal;
- return RELOP;
+ return lasttok = RELOP;
}
if (c == '~') {
yylval.nodetypeval = Node_nomatch;
want_assign = 0;
- return MATCHOP;
+ return lasttok = MATCHOP;
}
pushback();
- return '!';
+ return lasttok = '!';
case '<':
if (nextc() == '=') {
yylval.nodetypeval = Node_leq;
- return RELOP;
+ return lasttok = RELOP;
}
yylval.nodetypeval = Node_less;
pushback();
- return '<';
+ return lasttok = '<';
case '=':
if (nextc() == '=') {
yylval.nodetypeval = Node_equal;
- return RELOP;
+ return lasttok = RELOP;
}
yylval.nodetypeval = Node_assign;
pushback();
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
case '>':
if ((c = nextc()) == '=') {
yylval.nodetypeval = Node_geq;
- return RELOP;
+ return lasttok = RELOP;
} else if (c == '>') {
yylval.nodetypeval = Node_redirect_append;
- return APPEND_OP;
+ return lasttok = APPEND_OP;
}
yylval.nodetypeval = Node_greater;
pushback();
- return '>';
+ return lasttok = '>';
case '~':
yylval.nodetypeval = Node_match;
want_assign = 0;
- return MATCHOP;
+ return lasttok = MATCHOP;
case '}':
/*
@@ -2780,11 +2861,11 @@ retry:
*/
if (did_newline) {
did_newline = 0;
- return c;
+ return lasttok = c;
}
did_newline++;
--lexptr; /* pick up } next time */
- return NEWLINE;
+ return lasttok = NEWLINE;
case '"':
esc_seen = 0;
@@ -2811,23 +2892,23 @@ retry:
yylval.nodeval = make_str_node(tokstart,
tok - tokstart, esc_seen ? SCAN : 0);
yylval.nodeval->flags |= PERM;
- return YSTRING;
+ return lasttok = YSTRING;
case '-':
if ((c = nextc()) == '=') {
yylval.nodetypeval = Node_assign_minus;
- return ASSIGNOP;
+ return lasttok = ASSIGNOP;
}
if (c == '-')
- return DECREMENT;
+ return lasttok = DECREMENT;
pushback();
- return '-';
+ return lasttok = '-';
case '.':
c = nextc();
pushback();
if (!isdigit(c))
- return '.';
+ return lasttok = '.';
else
c = '.'; /* FALL THROUGH */
case '0':
@@ -2883,10 +2964,16 @@ retry:
break;
c = nextc();
}
- pushback();
+ if (c != 0)
+ pushback();
+ else if (do_lint && ! eof_warned) {
+ warning("source file does not end in newline");
+ eof_warned = 1;
+ }
+ tokadd('\0');
yylval.nodeval = make_number(atof(tokstart));
yylval.nodeval->flags |= PERM;
- return YNUMBER;
+ return lasttok = YNUMBER;
case '&':
if ((c = nextc()) == '&') {
@@ -2909,10 +2996,10 @@ retry:
}
}
want_assign = 0;
- return LEX_AND;
+ return lasttok = LEX_AND;
}
pushback();
- return '&';
+ return lasttok = '&';
case '|':
if ((c = nextc()) == '|') {
@@ -2935,10 +3022,10 @@ retry:
}
}
want_assign = 0;
- return LEX_OR;
+ return lasttok = LEX_OR;
}
pushback();
- return '|';
+ return lasttok = '|';
}
if (c != '_' && ! isalpha(c))
@@ -2953,7 +3040,12 @@ retry:
tokadd('\0');
emalloc(tokkey, char *, tok - tokstart, "yylex");
memcpy(tokkey, tokstart, tok - tokstart);
- pushback();
+ if (c != 0)
+ pushback();
+ else if (do_lint && ! eof_warned) {
+ warning("source file does not end in newline");
+ eof_warned = 1;
+ }
/* See if it is a special token. */
low = 0;
@@ -2992,16 +3084,16 @@ retry:
yylval.nodetypeval = tokentab[mid].value;
free(tokkey);
- return tokentab[mid].class;
+ return lasttok = tokentab[mid].class;
}
}
yylval.sval = tokkey;
if (*lexptr == '(')
- return FUNC_CALL;
+ return lasttok = FUNC_CALL;
else {
want_assign = 1;
- return NAME;
+ return lasttok = NAME;
}
}
@@ -3209,6 +3301,45 @@ NODE *list, *new;
return oldlist;
}
+/* return 1 if there are duplicate parameters, 0 means all ok */
+static int
+dup_parms(func)
+NODE *func;
+{
+ register NODE *np;
+ char *fname, **names;
+ int count, i, j, dups;
+ NODE *params;
+
+ fname = func->param;
+ count = func->param_cnt;
+ params = func->rnode;
+
+ if (count == 0) /* no args, no problem */
+ return 0;
+
+ emalloc(names, char **, count * sizeof(char *), "dup_parms");
+
+ i = 0;
+ for (np = params; np != NULL; np = np->rnode)
+ names[i++] = np->param;
+
+ dups = 0;
+ for (i = 1; i < count; i++) {
+ for (j = 0; j < i; j++) {
+ if (strcmp(names[i], names[j]) == 0) {
+ dups++;
+ error(
+ "function `%s': parameter #%d, `%s', duplicates parameter #%d",
+ fname, i+1, names[j], j+1);
+ }
+ }
+ }
+
+ free(names);
+ return (dups > 0);
+}
+
/*
* check if name is already installed; if so, it had better have Null value,
* in which case def is added as the value. Otherwise, install name with def
@@ -3254,14 +3385,18 @@ int freeit;
}
}
+/*
+ * pop parameters out of the symbol table. do this in reverse order to
+ * avoid reading freed memory if there were duplicated parameters.
+ */
static void
pop_params(params)
NODE *params;
{
- register NODE *np;
-
- for (np = params; np != NULL; np = np->rnode)
- pop_var(np, 1);
+ if (params == NULL)
+ return;
+ pop_params(params->rnode);
+ pop_var(params, 1);
}
static NODE *
@@ -3278,7 +3413,7 @@ char *name;
return (install(name, r));
}
-/* Name points to a variable name. Make sure its in the symbol table */
+/* Name points to a variable name. Make sure it's in the symbol table */
NODE *
variable(name, can_free)
char *name;
diff --git a/builtin.c b/builtin.c
index 96411de7..f925ac09 100644
--- a/builtin.c
+++ b/builtin.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -29,7 +29,7 @@
#ifndef SRANDOM_PROTO
extern void srandom P((unsigned int seed));
#endif
-#ifndef linux
+#if defined(RANDOM_MISSING)
extern char *initstate P((unsigned seed, char *state, int n));
extern char *setstate P((char *state));
extern long random P((void));
@@ -441,8 +441,18 @@ check_pos:
case 'l':
if (big)
break;
+ else {
+ static int warned = 0;
+
+ if (do_lint && ! warned) {
+ warning("`l' is meaningless in awk formats; ignored");
+ warned++;
+ }
+ if (do_posix)
+ fatal("'l' is not permitted in POSIX awk formats");
+ }
big++;
- goto check_pos;
+ goto retry;
case 'c':
parse_next_arg();
if (arg->flags & NUMBER) {
@@ -1076,7 +1086,8 @@ int global;
if (*scan == '&') {
repllen--;
ampersands++;
- } else if (*scan == '\\' && *(scan+1) == '&') {
+ } else if (*scan == '\\'
+ && (*(scan+1) == '&' || *(scan+1) == '\\')) {
repllen--;
scan++;
}
@@ -1095,7 +1106,7 @@ int global;
len = matchstart - text + repllen
+ ampersands * (matchend - matchstart);
sofar = bp - buf;
- while ((long)(buflen - sofar - len - 1) < 0) {
+ while (buflen < (sofar + len + 1)) {
buflen *= 2;
erealloc(buf, char *, buflen, "do_sub");
bp = buf + sofar;
@@ -1106,7 +1117,8 @@ int global;
if (*scan == '&')
for (cp = matchstart; cp < matchend; cp++)
*bp++ = *cp;
- else if (*scan == '\\' && *(scan+1) == '&') {
+ else if (*scan == '\\'
+ && (*(scan+1) == '&' || *(scan+1) == '\\')) {
scan++;
*bp++ = *scan;
} else
diff --git a/config/cray60 b/config/cray60
index 7253277b..c9aa5729 100644
--- a/config/cray60
+++ b/config/cray60
@@ -1,7 +1,8 @@
-Cray Research system running Unicos 6.0
+Cray Research system running Unicos 6.0 or later
SIGTYPE void
RANDOM_MISSING 1
STDC_HEADERS 1
+SRANDOM_PROTO 1
CHAR_UNSIGNED 1
GETPGRP_NOARG 1
MAKE_ALLOCA_C
diff --git a/config/gnu b/config/gnu
new file mode 100644
index 00000000..93f0465d
--- /dev/null
+++ b/config/gnu
@@ -0,0 +1,6 @@
+For the GNU operating system.
+
+SIGTYPE void
+HAVE_UNDERSCORE_SETJMP 1
+STDC_HEADERS 1
+GETPGRP_NOARG 1
diff --git a/config/lynxos b/config/lynxos
new file mode 100644
index 00000000..550b2134
--- /dev/null
+++ b/config/lynxos
@@ -0,0 +1,10 @@
+For Lynx version 2.1
+SIGTYPE int
+STDC_HEADERS 1
+HAVE_STRING_H 1
+STRCASE_MISSING 1
+STRERROR_MISSING 1
+STRFTIME_MISSING 1
+TZNAME_MISSING 1
+TZSET_MISSING 1
+TM_ZONE_MISSING 1
diff --git a/config/sgi405 b/config/sgi405
index 93d72a77..49b2be49 100644
--- a/config/sgi405
+++ b/config/sgi405
@@ -2,3 +2,4 @@ SGI Personal Iris (Sys V derived) (this works with gcc)
BLKSIZE_MISSING 1
STDC_HEADERS 1
GETPGRP_NOARG 1
+MAKE_SGI_GCC
diff --git a/config/vms-posix b/config/vms-posix
index 0194e219..f1e0f373 100644
--- a/config/vms-posix
+++ b/config/vms-posix
@@ -8,6 +8,7 @@ MAKE_VMS-Posix
MAKE_CC
#define DEFAULT_FILETYPE ".awk"
#define getopt gnu_getopt
+#define optopt gnu_optopt
#define opterr gnu_opterr
#define regcomp gnu_regcomp
#define regexec gnu_regexec
diff --git a/dfa.c b/dfa.c
index 47ad35e9..11a3fed0 100644
--- a/dfa.c
+++ b/dfa.c
@@ -2035,6 +2035,7 @@ dfafree(d)
if (d->realtrans) free((ptr_t) d->realtrans);
if (d->fails) free((ptr_t) d->fails);
if (d->newlines) free((ptr_t) d->newlines);
+ if (d->success) free((ptr_t) d->success);
for (dm = d->musts; dm; dm = ndm)
{
ndm = dm->next;
diff --git a/eval.c b/eval.c
index 18f67fd2..5006ccf7 100644
--- a/eval.c
+++ b/eval.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -288,17 +288,31 @@ register NODE *volatile tree;
}
case Node_K_break:
- if (loop_tag_valid == 0)
- fatal("unexpected break");
- longjmp(loop_tag, TAG_BREAK);
+ if (loop_tag_valid == 0) {
+ /*
+ * Old AT&T nawk treats break outside of loops like
+ * next. New ones catch it at parse time. Allow it if
+ * do_unix is on, and complain if lint.
+ */
+ static int warned = 0;
+
+ if (do_lint && ! warned) {
+ warning("use of `break' outside of loop is not portable");
+ warned = 1;
+ }
+ if (! do_unix)
+ fatal("use of `break' outside of loop is not allowed");
+ longjmp(rule_tag, TAG_CONTINUE);
+ } else
+ longjmp(loop_tag, TAG_BREAK);
break;
case Node_K_continue:
if (loop_tag_valid == 0) {
/*
- * AT&T nawk treats continue outside of loops like
- * next. Allow it if not posix, and complain if
- * lint.
+ * Old AT&T nawk treats continue outside of loops like
+ * next. New ones catch it at parse time. Allow it if
+ * do_unix is on, and complain if lint.
*/
static int warned = 0;
@@ -306,7 +320,7 @@ register NODE *volatile tree;
warning("use of `continue' outside of loop is not portable");
warned = 1;
}
- if (do_posix)
+ if (! do_unix)
fatal("use of `continue' outside of loop is not allowed");
longjmp(rule_tag, TAG_CONTINUE);
} else
@@ -345,11 +359,11 @@ register NODE *volatile tree;
* are not done. So we immediately break out of the main loop.
*/
exiting = 1;
- if (tree) {
+ if (tree->lnode) {
t = tree_eval(tree->lnode);
exit_val = (int) force_number(t);
+ free_temp(t);
}
- free_temp(t);
longjmp(rule_tag, TAG_BREAK);
break;
@@ -499,14 +513,15 @@ register NODE *tree;
case Node_concat:
{
-#define STACKSIZE 10
- NODE *treelist[STACKSIZE+1];
- NODE *strlist[STACKSIZE+1];
+ NODE **treelist;
+ NODE **strlist;
+ NODE *save_tree;
register NODE **treep;
register NODE **strp;
register size_t len;
char *str;
register char *dest;
+ int count;
/*
* This is an efficiency hack for multiple adjacent string
@@ -516,12 +531,26 @@ register NODE *tree;
* descend to lowest (first) node, accumulating nodes
* to evaluate to strings as we go.
*/
+
+ /*
+ * But first, no arbitrary limits. Count the number of
+ * nodes and malloc the treelist and strlist arrays.
+ * There will be count + 1 items to concatenate. We
+ * also leave room for an extra pointer at the end to
+ * use as a sentinel. Thus, start count at 2.
+ */
+ save_tree = tree;
+ for (count = 2; tree && tree->type == Node_concat; tree = tree->lnode)
+ count++;
+ tree = save_tree;
+ emalloc(treelist, NODE **, sizeof(NODE *) * count, "tree_eval");
+ emalloc(strlist, NODE **, sizeof(NODE *) * count, "tree_eval");
+
+ /* Now, here we go. */
treep = treelist;
- while (tree->type == Node_concat) {
+ while (tree && tree->type == Node_concat) {
*treep++ = tree->rnode;
tree = tree->lnode;
- if (treep == &treelist[STACKSIZE])
- break;
}
*treep = tree;
/*
@@ -549,6 +578,9 @@ register NODE *tree;
}
r = make_str_node(str, len, ALREADY_MALLOCED);
r->flags |= TEMP;
+
+ free(strlist);
+ free(treelist);
}
return r;
@@ -793,6 +825,14 @@ register NODE *tree;
tmp = tree_eval(tree->rnode);
rval = force_number(tmp);
free_temp(tmp);
+
+ /*
+ * Do this again; the lhs and the rhs could both be fields.
+ * Accessing the rhs could cause the lhs to have moved around.
+ * (Yet another special case. Gack.)
+ */
+ lhs = get_lhs(tree->lnode, &after_assign);
+
unref(*lhs);
switch(tree->type) {
case Node_assign_exp:
@@ -1027,6 +1067,9 @@ Func_ptr *assign;
register NODE **aptr = NULL;
register NODE *n;
+ if (ptr->type == Node_param_list)
+ ptr = stack_ptr[ptr->param_cnt];
+
switch (ptr->type) {
case Node_var_array:
fatal("attempt to use array `%s' in a scalar context", ptr->vname);
@@ -1186,7 +1229,7 @@ set_IGNORECASE()
warning("IGNORECASE not supported in compatibility mode");
}
IGNORECASE = (force_number(IGNORECASE_node->var_value) != 0.0);
- set_FS();
+ set_FS_if_not_FIELDWIDTHS();
}
void
diff --git a/field.c b/field.c
index 17dce9b6..fa7dc3e9 100644
--- a/field.c
+++ b/field.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -298,6 +298,16 @@ NODE *n;
if (len == 0)
return nf;
+ /*
+ * Nasty special case. If FS set to "", return whole record
+ * as first field. This is not worth a separate function.
+ */
+ if (fs->stlen == 0) {
+ (*set)(++nf, *buf, len, n);
+ *buf += len;
+ return nf;
+ }
+
/* before doing anything save the char at *end */
sav = *end;
/* because it will be destroyed now: */
@@ -676,3 +686,10 @@ set_FIELDWIDTHS()
}
FIELDWIDTHS[i] = -1;
}
+
+void
+set_FS_if_not_FIELDWIDTHS()
+{
+ if (parse_field != fw_parse_field)
+ set_FS();
+}
diff --git a/gawk.1 b/gawk.1
index a98c99d1..0a6e9241 100644
--- a/gawk.1
+++ b/gawk.1
@@ -1,7 +1,7 @@
.ds PX \s-1POSIX\s+1
.ds UX \s-1UNIX\s+1
.ds AN \s-1ANSI\s+1
-.TH GAWK 1 "Apr 18 1994" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "Nov 24 1994" "Free Software Foundation" "Utility Commands"
.SH NAME
gawk \- pattern scanning and processing language
.SH SYNOPSIS
@@ -1868,9 +1868,11 @@ will issue a warning about its use if
.B "\-W lint"
is specified on the command line.
.PP
-The other feature is the use of the
+The other feature is the use of either the
.B continue
-statement outside the body of a
+or the
+.B break
+statements outside the body of a
.BR while ,
.BR for ,
or
@@ -1881,8 +1883,8 @@ equivalent to the
statement.
.I Gawk
will support this usage if
-.B "\-W posix"
-has not been specified.
+.B "\-W compat"
+has been specified.
.SH ENVIRONMENT VARIABLES
If
.B POSIXLY_CORRECT
@@ -1937,7 +1939,8 @@ the
and
.B \-e
options of the 2.11 version are no longer recognized.
-This fact will not even be documented in the manual page for version 2.16.
+This fact will not even be documented in the manual page for the next
+major version.
.SH AUTHORS
The original version of \*(UX
.I awk
@@ -1957,12 +1960,34 @@ from Arnold Robbins, made
.I gawk
compatible with the new version of \*(UX
.IR awk .
+Arnold Robbins is the current maintainer.
.PP
The initial DOS port was done by Conrad Kwok and Scott Garfinkle.
Scott Deifik is the current DOS maintainer. Pat Rankin did the
port to VMS, and Michal Jaegermann did the port to the Atari ST.
The port to OS/2 was done by Kai Uwe Rommel, with contributions and
help from Darrel Hankerson.
+.SH BUG REPORTS
+If you find a bug in
+.IR gawk ,
+please send electronic mail to
+.BR bug-gnu-utils@prep.ai.mit.edu ,
+.I with
+a carbon copy to
+.BR arnold@gnu.ai.mit.edu .
+Please include your operating system and its revision, the version of
+.IR gawk ,
+what C compiler you used to compile it, and a test program
+and data that are as small as possible for reproducing the problem.
+.PP
+Before sending a bug report, please do two things. First, verify that
+you have the latest version of
+.IR gawk .
+Many bugs (usually subtle ones) are fixed at each release, and if
+your's is out of date, the problem may already have been solved.
+Second, please read this man page and the reference manual carefully to
+be sure that what you think is a bug really is, instead of just a quirk
+in the language.
.SH ACKNOWLEDGEMENTS
Brian Kernighan of Bell Labs
provided valuable assistance during testing and debugging.
diff --git a/io.c b/io.c
index 7fe21ecf..03b73daa 100644
--- a/io.c
+++ b/io.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -75,7 +75,8 @@ extern FILE *fdopen();
#include "popen.h"
#define popen(c,m) os_popen(c,m)
#define pclose(f) os_pclose(f)
-#elif defined (OS2) /* OS/2, but not family mode */
+#else
+#if defined (OS2) /* OS/2, but not family mode */
#if defined (_MSC_VER)
#define popen(c,m) _popen(c,m)
#define pclose(f) _pclose(f)
@@ -83,6 +84,7 @@ extern FILE *fdopen();
#else
extern FILE *popen();
#endif
+#endif
static struct redirect *red_head = NULL;
@@ -188,10 +190,10 @@ IOBUF *iop;
cnt = 0;
retval = 1;
} else {
- NR += 1;
- FNR += 1;
+ NR += 1;
+ FNR += 1;
+ set_record(begin, cnt, 1);
}
- set_record(begin, cnt, 1);
return retval;
}
@@ -524,8 +526,13 @@ int exitwarn;
if (status) {
char *s = strerror(errno);
- warning("failure status (%d) on %s close of \"%s\" (%s)",
- status, what, rp->value, s);
+ /*
+ * Too many people have complained about this.
+ * As of 2.15.6, it is now under lint control.
+ */
+ if (do_lint)
+ warning("failure status (%d) on %s close of \"%s\" (%s)",
+ status, what, rp->value, s);
if (! do_unix) {
/* set ERRNO too so that program can get at it */
@@ -646,7 +653,8 @@ devopen(name, mode)
const char *name, *mode;
{
int openfd = INVALID_HANDLE;
- const char *cp, *ptr;
+ const char *cp;
+ char *ptr;
int flag = 0;
struct stat buf;
extern double strtod();
@@ -806,7 +814,7 @@ const char *name, *mode;
char tbuf[BUFSIZ], *cp;
int i;
#if defined(NGROUPS_MAX) && NGROUPS_MAX > 0
-#if defined(atarist) || defined(__svr4__) || defined(__osf__)
+#if defined(atarist) || defined(__svr4__) || defined(__osf__) || defined(__bsdi__)
gid_t groupset[NGROUPS_MAX];
#else
int groupset[NGROUPS_MAX];
diff --git a/iop.c b/iop.c
index 897daefb..af6ecbc6 100644
--- a/iop.c
+++ b/iop.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -96,9 +96,11 @@ int fd;
#endif
if (fstat(fd, &stb) == -1)
fatal("can't stat fd %d (%s)", fd, strerror(errno));
- if (lseek(fd, (off_t)0, 0) == -1)
+ if (lseek(fd, (off_t)0, 0) == -1) /* not a regular file */
return DEFBLKSIZE;
- return ((int) (stb.st_size < DEFBLKSIZE ? stb.st_size : DEFBLKSIZE));
+ if (stb.st_size > 0 && stb.st_size < DEFBLKSIZE) /* small file */
+ return (stb.st_size);
+ return (DEFBLKSIZE);
#endif /*! TEST */
#endif /*! VMS */
}
@@ -249,6 +251,7 @@ int *errcode;
continue;
} else
eat_whitespace = 0;
+ start = bp; /* skip leading white space */
}
if (saw_newline && *bp == rs) {
bp++;
@@ -284,7 +287,7 @@ int *errcode;
*bp = '\0';
if (grRS == 0) {
/* there could be more newlines left, clean 'em out now */
- while (*(iop->off) == rs && iop->off <= iop->end)
+ while (iop->off <= iop->end && *(iop->off) == rs)
(iop->off)++;
if (*--bp == rs)
diff --git a/main.c b/main.c
index 23e3dc78..c5a7f3a1 100644
--- a/main.c
+++ b/main.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -23,8 +23,8 @@
* the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include "getopt.h"
#include "awk.h"
+#include "getopt.h"
#include "patchlevel.h"
static void usage P((int exitval));
@@ -63,12 +63,15 @@ char *RS;
char *OFS;
char *ORS;
char *OFMT;
-char *CONVFMT;
/*
- * The parse tree and field nodes are stored here. Parse_end is a dummy item
- * used to free up unneeded fields without freeing the program being run
+ * CONVFMT is a convenience pointer for the current number to string format.
+ * We must supply an initial value to avoid recursion problems of
+ * set_CONVFMT -> fmt_index -> r_force_string: gets NULL CONVFMT
+ * Fun, fun, fun, fun.
*/
+char *CONVFMT = "%.6g";
+
int errcount = 0; /* error counter, used by yyerror() */
/* The global null string */
@@ -90,7 +93,7 @@ int exit_val = 0; /* optional exit value */
extern int yydebug;
#endif
-struct src *srcfiles = NULL; /* source file name(s) */
+struct src *srcfiles = NULL; /* source file name(s) */
int numfiles = -1; /* how many source files */
int do_unix = 0; /* turn off gnu extensions */
@@ -105,6 +108,7 @@ int output_is_tty = 0; /* control flushing of output */
extern char *version_string; /* current version, for printing */
+/* The parse tree is stored here. */
NODE *expression_value;
static struct option optab[] = {
@@ -173,6 +177,13 @@ char **argv;
Nnull_string->type = Node_val;
Nnull_string->flags = (PERM|STR|STRING|NUM|NUMBER);
+ /*
+ * Tell the regex routines how they should work.
+ * Do this before initializing variables, since
+ * they could want to do a regexp compile.
+ */
+ resetup();
+
/* Set up the special variables */
/*
* Note that this must be done BEFORE arg parsing else -F
@@ -184,9 +195,6 @@ char **argv;
emalloc(srcfiles, struct src *, argc * sizeof(struct src), "main");
memset(srcfiles, '\0', argc * sizeof(struct src));
- /* Tell the regex routines how they should work. . . */
- resetup();
-
/* we do error messages ourselves on invalid options */
opterr = 0;
@@ -347,6 +355,8 @@ out:
/* Read in the program */
if (yyparse() || errcount)
exit(1);
+ /* recover any space from C based alloca */
+ (void) alloca(0);
/* Set up the field variables */
init_fields();
@@ -494,6 +504,10 @@ char **argv;
/*
* Set all the special variables to their initial values.
+ * Note that some of the variables that have set_FOO routines should
+ * *N*O*T* have those routines called upon initialization, and thus
+ * they have NULL entries in that field. This is notably true of FS
+ * and IGNORECASE.
*/
struct varinit {
NODE **spec;
@@ -504,18 +518,18 @@ struct varinit {
Func_ptr assign;
};
static struct varinit varinit[] = {
+{&CONVFMT_node, "CONVFMT", Node_CONVFMT, "%.6g", 0, set_CONVFMT },
{&NF_node, "NF", Node_NF, 0, -1, set_NF },
{&FIELDWIDTHS_node, "FIELDWIDTHS", Node_FIELDWIDTHS, "", 0, 0 },
{&NR_node, "NR", Node_NR, 0, 0, set_NR },
{&FNR_node, "FNR", Node_FNR, 0, 0, set_FNR },
{&FS_node, "FS", Node_FS, " ", 0, 0 },
{&RS_node, "RS", Node_RS, "\n", 0, set_RS },
-{&IGNORECASE_node, "IGNORECASE", Node_IGNORECASE, 0, 0, set_IGNORECASE },
+{&IGNORECASE_node, "IGNORECASE", Node_IGNORECASE, 0, 0, 0 },
{&FILENAME_node, "FILENAME", Node_var, "", 0, 0 },
{&OFS_node, "OFS", Node_OFS, " ", 0, set_OFS },
{&ORS_node, "ORS", Node_ORS, "\n", 0, set_ORS },
{&OFMT_node, "OFMT", Node_OFMT, "%.6g", 0, set_OFMT },
-{&CONVFMT_node, "CONVFMT", Node_CONVFMT, "%.6g", 0, set_CONVFMT },
{&RLENGTH_node, "RLENGTH", Node_var, 0, 0, 0 },
{&RSTART_node, "RSTART", Node_var, 0, 0, 0 },
{&SUBSEP_node, "SUBSEP", Node_var, "\034", 0, 0 },
diff --git a/msg.c b/msg.c
index 4bd9f901..0ddd0715 100644
--- a/msg.c
+++ b/msg.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -90,6 +90,20 @@ va_dcl
/*VARARGS0*/
void
+error(va_alist)
+va_dcl
+{
+ va_list args;
+ char *mesg;
+
+ va_start(args);
+ mesg = va_arg(args, char *);
+ err("error: ", mesg, args);
+ va_end(args);
+}
+
+/*VARARGS0*/
+void
fatal(va_alist)
va_dcl
{
diff --git a/node.c b/node.c
index dca4ad19..f6134b5e 100644
--- a/node.c
+++ b/node.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -127,7 +127,7 @@ register NODE *s;
#ifdef DEBUG
if (s == NULL) cant_happen();
if (s->type != Node_val) cant_happen();
- if (s->flags & STR) return s;
+ if ((s->flags & STR) && (s->stfmt == -1 || s->stfmt == CONVFMTidx)) return s;
if (!(s->flags & NUM)) cant_happen();
if (s->stref != 0) ; /*cant_happen();*/
#endif
@@ -441,6 +441,10 @@ char **string_ptr;
}
if (do_posix)
return ('x');
+ if (! isxdigit((*string_ptr)[1])) {
+ warning("no hex digits in \\x escape sequence");
+ return ('x');
+ }
i = 0;
while (1) {
if (isxdigit((c = *(*string_ptr)++))) {
diff --git a/patchlevel.h b/patchlevel.h
index c80ca154..e44bc091 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -1 +1 @@
-#define PATCHLEVEL 5
+#define PATCHLEVEL 6
diff --git a/re.c b/re.c
index 4ea22c23..cd11d495 100644
--- a/re.c
+++ b/re.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1991, 1992, 1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -101,6 +101,9 @@ int dfa;
len = dest - temp;
if ((rerr = re_compile_pattern(temp, len, &(rp->pat))) != NULL)
fatal("%s: /%s/", rerr, temp);
+
+ /* gack. this must be done *after* re_compile_pattern */
+ rp->pat.newline_anchor = 0; /* don't get \n in middle of string */
if (dfa && !ignorecase) {
dfacomp(temp, len, &(rp->dfareg), 1);
rp->dfa = 1;
@@ -136,10 +139,13 @@ int need_start;
str[start+len] = save;
}
if (ret) {
- if (need_start || rp->dfa == 0)
- return re_search(&(rp->pat), str, start+len, start,
- len, &(rp->regs));
- else
+ if (need_start || rp->dfa == 0) {
+ int result = re_search(&(rp->pat), str, start+len,
+ start, len, &(rp->regs));
+ /* recover any space from C based alloca */
+ (void) alloca(0);
+ return result;
+ } else
return 1;
} else
return -1;
@@ -151,6 +157,10 @@ Regexp *rp;
{
free(rp->pat.buffer);
free(rp->pat.fastmap);
+ if (rp->regs.start)
+ free(rp->regs.start);
+ if (rp->regs.end)
+ free(rp->regs.end);
if (rp->dfa)
dfafree(&(rp->dfareg));
free(rp);
diff --git a/regex.c b/regex.c
index 6a36f3de..9b508823 100644
--- a/regex.c
+++ b/regex.c
@@ -3,7 +3,7 @@
(Implements POSIX draft P10003.2/D11.2, except for
internationalization features.)
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993-1995 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -817,6 +817,13 @@ print_double_string (where, string1, size1, string2, size2)
}
}
+void
+printchar (c)
+ int c;
+{
+ putc(c, stderr);
+}
+
#else /* not DEBUG */
#undef assert
@@ -3162,7 +3169,8 @@ static int bcmp_translate _RE_ARGS((const char *s1, const char *s2,
(FIRST_STRING_P (ptr) ? (ptr) - string1 : (ptr) - string2 + size1)
/* Registers are set to a sentinel when they haven't yet matched. */
-#define REG_UNSET_VALUE ((char *) -1)
+static char reg_unset_dummy;
+#define REG_UNSET_VALUE (&reg_unset_dummy)
#define REG_UNSET(e) ((e) == REG_UNSET_VALUE)
diff --git a/regex.h b/regex.h
index 757dbacf..ec9598e7 100644
--- a/regex.h
+++ b/regex.h
@@ -1,7 +1,7 @@
/* Definitions for data structures and routines for the regular
expression library, version 0.12.
- Copyright (C) 1985, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1989, 1990-1995 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -157,6 +157,7 @@ extern reg_syntax_t re_syntax_options;
(RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
+ | RE_DOT_NEWLINE \
| RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
#define RE_SYNTAX_GNU_AWK \
@@ -480,9 +481,11 @@ extern void re_set_registers
_RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
unsigned num_regs, regoff_t *starts, regoff_t *ends));
+#ifndef _CRAY
/* 4.2 bsd compatibility. */
extern char *re_comp _RE_ARGS ((const char *));
extern int re_exec _RE_ARGS ((const char *));
+#endif
/* POSIX compatibility. */
extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
diff --git a/test/Makefile b/test/Makefile
index 0cd4397c..1ad2b2c7 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,10 +1,32 @@
+# Makefile for GNU Awk test suite.
+#
+# Copyright (C) 1988-1995 the Free Software Foundation, Inc.
+#
+# This file is part of GAWK, the GNU implementation of the
+# AWK Progamming Language.
+#
+# GAWK is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# GAWK is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GAWK; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
SHELL = /bin/sh
bigtest: basic poundbang gawk.extensions
basic: msg swaplns messages argarray longwrds \
getline fstabplus compare arrayref rs fsrs rand \
- fsbs negexp asgext anchgsub splitargv awkpath nfset reparse
+ fsbs negexp asgext anchgsub splitargv awkpath nfset reparse \
+ convfmt arrayparm paramdup nonl
gawk.extensions: fieldwdth ignrcase posix manyfiles igncfs argtest \
badargs
@@ -28,7 +50,7 @@ swaplns::
messages::
@../gawk -f messages.awk >out2 2>out3
- { cmp out1.good out1 && cmp out2.good out2 && cmp out3.good out3 && rm -f out1 out2 out3; } || { test -c /dev/stdout && echo IT IS OK THAT THIS TEST FAILED; }
+ { cmp out1.good out1 && cmp out2.good out2 && cmp out3.good out3 && rm -f out1 out2 out3; } || { test -d /dev/fd && echo IT IS OK THAT THIS TEST FAILED; }
argarray::
@TEST=test echo just a test | ../gawk -f argarray.awk argarray.awk - >tmp
@@ -139,8 +161,24 @@ argtest::
cmp argtest.good tmp && rm -f tmp
badargs::
- @-../gawk -f 2>&1 | grep -v patchlevel > tmp
+ @-../gawk -f 2>&1 | grep -v patchlevel >tmp
cmp badargs.good tmp && rm -f tmp
+convfmt::
+ @../gawk -f convfmt.awk >tmp
+ cmp convfmt.good tmp && rm -f tmp
+
+arrayparm::
+ @-../gawk -f arrayparm.awk >tmp 2>&1
+ cmp arrayparm.good tmp && rm -f tmp
+
+paramdup::
+ @-../gawk -f paramdup.awk >tmp 2>&1
+ cmp paramdup.good tmp && rm -f tmp
+
+nonl::
+ @-../gawk --lint -f nonl.awk /dev/null >tmp 2>&1
+ cmp nonl.good tmp && rm -f tmp
+
clean:
rm -fr tmp core junk
diff --git a/test/arrayparm.awk b/test/arrayparm.awk
new file mode 100644
index 00000000..d6f34d96
--- /dev/null
+++ b/test/arrayparm.awk
@@ -0,0 +1,21 @@
+#
+# Test program from:
+#
+# Date: Tue, 21 Feb 95 16:09:29 EST
+# From: emory!blackhawk.com!aaron (Aaron Sosnick)
+#
+BEGIN {
+ foo[1]=1;
+ foo[2]=2;
+ bug1(foo);
+}
+function bug1(i) {
+ for (i in foo) {
+ bug2(i);
+ delete foo[i];
+ print i,1,bot[1];
+ }
+}
+function bug2(arg) {
+ bot[arg]=arg;
+}
diff --git a/test/arrayparm.good b/test/arrayparm.good
new file mode 100644
index 00000000..b315f7cf
--- /dev/null
+++ b/test/arrayparm.good
@@ -0,0 +1 @@
+gawk: arrayparm.awk:18: fatal: attempt to use array `foo' in a scalar context
diff --git a/test/convfmt.awk b/test/convfmt.awk
new file mode 100644
index 00000000..90fd204b
--- /dev/null
+++ b/test/convfmt.awk
@@ -0,0 +1,10 @@
+BEGIN {
+ CONVFMT = "%2.2f"
+ a = 123.456
+ b = a "" # give `a' string value also
+ printf "a = %s\n", a
+ CONVFMT = "%.6g"
+ printf "a = %s\n", a
+ a += 0 # make `a' numeric only again
+ printf "a = %s\n", a # use `a' as string
+}
diff --git a/test/convfmt.good b/test/convfmt.good
new file mode 100644
index 00000000..a7b66f78
--- /dev/null
+++ b/test/convfmt.good
@@ -0,0 +1,3 @@
+a = 123.46
+a = 123.456
+a = 123.456
diff --git a/test/nonl.awk b/test/nonl.awk
new file mode 100644
index 00000000..c2270834
--- /dev/null
+++ b/test/nonl.awk
@@ -0,0 +1 @@
+0 \ No newline at end of file
diff --git a/test/nonl.good b/test/nonl.good
new file mode 100644
index 00000000..24bd9b78
--- /dev/null
+++ b/test/nonl.good
@@ -0,0 +1 @@
+gawk: nonl.awk:1: warning: source file does not end in newline
diff --git a/test/paramdup.awk b/test/paramdup.awk
new file mode 100644
index 00000000..1f1cc7a4
--- /dev/null
+++ b/test/paramdup.awk
@@ -0,0 +1,8 @@
+BEGIN { foo(0, 1, 2) }
+
+function foo(a, b, c, b, a)
+{
+ print "a =", a
+ print "b =", b
+ print "c =", c
+}
diff --git a/test/paramdup.good b/test/paramdup.good
new file mode 100644
index 00000000..0308cc8c
--- /dev/null
+++ b/test/paramdup.good
@@ -0,0 +1,2 @@
+gawk: paramdup.awk:4: error: function `foo': parameter #4, `b', duplicates parameter #2
+gawk: paramdup.awk:4: error: function `foo': parameter #5, `a', duplicates parameter #1
diff --git a/vms/descrip.mms b/vms/descrip.mms
index f5872409..6c7910b9 100644
--- a/vms/descrip.mms
+++ b/vms/descrip.mms
@@ -109,7 +109,7 @@ VMSOTHR = $(VMSDIR)Descrip.MMS,$(VMSDIR)vmsbuild.com,$(VMSDIR)version.com,\
# Release of gawk
REL=2.15
-PATCHLVL=5
+PATCHLVL=6
# dummy target to allow building "gawk" in addition to explicit "gawk.exe"
gawk : gawk.exe
diff --git a/vms/gawk.hlp b/vms/gawk.hlp
index c8f4b453..97e0525c 100644
--- a/vms/gawk.hlp
+++ b/vms/gawk.hlp
@@ -2,6 +2,7 @@
! Pat Rankin, Jun'90
! revised, Jun'91
! revised, Jul'92
+! revised, Jan'95
! Online help for GAWK.
!
1 GAWK
@@ -89,6 +90,7 @@
>$vfile create 'vfile' as 'stdout', using RMS attributes appropriate
for a standard text file (variable length records with
implied carriage control)
+ >+bfile create 'bfile' as 'stdout' using binary mode
2>&1 route error messages into the regular output stream
1>&2 send output data to the error destination
<<sentinel error; reading stdin until 'sentinel' not supported
@@ -550,10 +552,10 @@
false (instead of actually re-evaluating it). In this case, the
increment-expression of a for-loop is also skipped.
- 'break' is only allowed within a loop ('for', 'while', or
- 'do-while'). If 'continue' is used outside of a loop, it is
- treated like 'next' (see action-controls). Inside nested loops,
- both 'break' and 'continue' only apply to the innermost loop.
+ Inside nested loops, both 'break' and 'continue' only apply to the
+ innermost loop. When in compatibility mode, 'break' or 'continue'
+ may be used outside of a loop; either will be treated like 'next'
+ (see action-controls).
4 action-controls
There are two special statements for controlling statement execution.
The 'next' statement, when executed, causes the rest of the current
@@ -575,7 +577,8 @@
4 other_statements
The delete statement is used to remove an element from an array.
The syntax is 'delete' keyword followed by array name, followed
- by index value enclosed in square brackets ([]).
+ by index value enclosed in square brackets ([]). Starting with
+ gawk version 2.15.4, 'delete' may also be used on an entire array.
The return statement is used in user-defined functions. The syntax
is the keyword 'return' optionally followed by a string or numeric
@@ -655,13 +658,12 @@
the comma is replaced by SUBSEP and the resulting index
is a concatenation of the values and SUBSEP(s); default
value is "\034"; value may be arbitrary string
- IGNORECASE regular expression matching flag; if true (non-zero)
- matching ignores differences between upper and lower case
- letters; affects the '~' and '!~' operators, the 'index',
- 'match', 'split', 'sub', and 'gsub' functions, and the
- field splitting based on FS; default value is false (0);
- has no effect if GAWK is in strict compatibility mode (via
- the -"W compat" option or /strict)
+ IGNORECASE string and regular expression matching flag; if true
+ (non-zero) matching ignores differences between upper and
+ lower case letters; affects the '~' and '!~' operators,
+ the 'index', 'match', 'split', 'sub', and 'gsub' functions,
+ and the field splitting based on FS; default value is false (0);
+ has no effect if GAWK is in strict compatibility mode
FIELDWIDTHS space or tab separated list of width sizes; takes
precedence over FS when set, but is cleared if FS has a
value assigned to it; [note: the current implementation
@@ -686,6 +688,8 @@
username), ["PATH"] (current default directory), ["HOME"]
(the user's login directory), and "[TERM]" (terminal type
if available) [all info provided by VAXCRTL's environ]
+ ERRNO information about the cause of failure for 'getline' or
+ 'close'; "0" if no such failure has occured.
ARGC number of elements in the ARGV array, counting [0] which is
the program name (ie, "gawk")
ARGV array of command-line arguments (in [0] to [ARGC-1]); the
@@ -696,6 +700,7 @@
can change values of ARGC and ARGV[] during execution in
order to alter which files are processed or which between-
file assignments are made
+ ARGIND current index into ARGV[]
4 arrays
awk supports associative arrays to collect data into tables. Array
elements can be either numeric or string, as can the indices used to
@@ -1050,10 +1055,11 @@
incorporated into the official GNU distribution of version 2.13 in
Spring 1991. (Version 2.12 was never publically released.)
2 release_notes
- GAWK 2.14 tested under VMS V5.5, July, 1992; compatible with VMS
- versions V4.6 and later. Current source code compatible with DEC's
- VAXC v3.x and v2.4 or v2.3; also compiles successfully with GNUC
- (GNU's gcc). VMS POSIX uses c89 and requires VAXC V3.x.
+ GAWK 2.15.6 tested under VAX/VMS V5.5-2, January, 1995; should be
+ compatible with VMS versions V4.6 and later. Current source code
+ compatible with DEC's VAX C v3.x and v2.4, or DEC C v4.x; also
+ compiles successfully with GNU C (GNU's gcc). VMS POSIX uses c89 and
+ requires VAX C V3.x (DEC C might work too, but hasn't been confirmed).
3 AWK_LIBRARY
GAWK uses a built in search path when looking for a program file
specified by the -f option (or the /input qualifier) when that file
@@ -1090,6 +1096,7 @@
Another poor feature without a work-around is that there's no way to
specify "append if possible, create with RMS text attributes if not"
with the current command line I/O redirection. '>>$' isn't supported.
+ Ditto for binary output; '>>+' isn't supported.
4 RS_peculiarities
Changing the record separator to something other than newline ('\n')
will produce anomalous results for ordinary files. For example,
@@ -1139,6 +1146,18 @@
failure. The final exit status will be 1 (VMS success) if 0 is
used, or even (VMS non-success) if non-zero is used.
3 changes
+ Changes between version 2.15.6 and 2.14
+
+ General
+ Many obscure bugs fixed
+ `delete' may operate on an entire array
+ ARGIND and ERRNO builtin variables added
+
+ VMS-specific
+ `>+ file' binary-mode output redirection added
+ /variable=(foo=42) fixed
+ Floating point number formatting improved
+3 prior_changes
Changes between version 2.14 and 2.13.2:
General
@@ -1153,7 +1172,7 @@
Disk I/O throughput enhanced
Pipe emulation improved and incorrect interaction with user-mode
redefinition of SYS$OUTPUT eliminated
-3 prior_changes
+
Changes between version 2.13 and 2.11.1: (2.12 was not released)
General
diff --git a/vms/vms_args.c b/vms/vms_args.c
index c927b9b7..a32e5d0f 100644
--- a/vms/vms_args.c
+++ b/vms/vms_args.c
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 1991-1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -39,6 +39,8 @@
* >$vfile - create 'vfile' as 'stdout', using rms attributes
* appropriate for a standard text file (variable length
* records with implied carriage control)
+ * >+vfile - create 'vfile' as 'stdout' in binary mode (using
+ * variable length records with implied carriage control)
* 2>&1 - special case: direct error messages into output file
* 1>&2 - special case: direct output data to error destination
* <<sentinal - error; reading stdin until 'sentinal' not supported
@@ -76,6 +78,11 @@
* sharing permited, so that others can read our output file to check
* progess. For stream output ('>' or '>>'), sharing is disallowed
* (for performance reasons).
+ *
+ * Sep'94, gawk 2.15.6 [pr]
+ * Add '>+' to force binary mode output, to enable better control
+ * for the user when the output destination is a mailbox or socket.
+ * (ORS = "\r\n" for tcp/ip.) Contributed by Per Steinar Iversen.
*/
#include "awk.h" /* really "../awk.h" */
@@ -158,6 +165,9 @@ vms_arg_fixup( int *pargc, char ***pargv )
else if (*p == '$') /* '>$' => kludge for record format */
rms_rfm = "rfm=var", rms_shr = "shr=get,upi",
rms_mrs = "mrs=32767", p++;
+ else if (*p == '+') /* '>+' => kludge for binary output */
+ out_mode = "wb", rms_rfm = "rfm=var",
+ rms_mrs = "mrs=32767", p++;
else /* '>' => create */
{} /* use default values initialized prior to loop */
p = skipblanks(p);
@@ -244,41 +254,35 @@ ordinary_arg:
/*[ catch 22: we'll also redirect errors encountered doing <in or >out ]*/
if (f_err) { /* define logical name but don't open file */
int len = strlen(f_err);
- if (strncasecmp(f_err, "SYS$OUTPUT", len) == 0
- && (f_err[len] == ':' || f_err[len] == '\0'))
+ if (len >= (sizeof "SYS$OUTPUT" - sizeof "")
+ && strncasecmp(f_err, "SYS$OUTPUT:", len) == 0)
err_to_out_redirect = 1;
else
(void) vms_define("SYS$ERROR", f_err);
}
/* do stdin before stdout, so if we bomb we won't make empty output file */
if (f_in) { /* [re]open file and define logical name */
- stdin = freopen(f_in, "r", stdin,
- "ctx=rec", "shr=get,put,del,upd",
- "mrs=32767", "mbc=32", "mbf=2");
- if (stdin != NULL)
+ if (freopen(f_in, "r", stdin,
+ "ctx=rec", "shr=get,put,del,upd",
+ "mrs=32767", "mbc=32", "mbf=2"))
(void) vms_define("SYS$INPUT", f_in);
else
fatal("<%s (%s)", f_in, strerror(errno));
}
if (f_out) {
- stdout = freopen(f_out, out_mode, stdout,
- rms_rfm, rms_shr, rms_mrs,
- "rat=cr", "mbc=32", "mbf=2");
- if (stdout != NULL)
+ if (freopen(f_out, out_mode, stdout,
+ rms_rfm, rms_shr, rms_mrs,
+ "rat=cr", "mbc=32", "mbf=2"))
(void) vms_define("SYS$OUTPUT", f_out);
else
fatal(">%s%s (%s)", (*out_mode == 'a' ? ">" : ""),
f_out, strerror(errno));
}
if (err_to_out_redirect) { /* special case for ``2>&1'' construct */
- (void) fclose(stderr);
(void) dup2(1, 2); /* make file 2 (stderr) share file 1 (stdout) */
- stderr = stdout;
(void) vms_define("SYS$ERROR", "SYS$OUTPUT:");
} else if (out_to_err_redirect) { /* ``1>&2'' */
- (void) fclose(stdout);
(void) dup2(2, 1); /* make file 1 (stdout) share file 2 (stderr) */
- stdout = stderr;
(void) vms_define("SYS$OUTPUT", "SYS$ERROR:");
}
diff --git a/vms/vms_fwrite.c b/vms/vms_fwrite.c
index 1cd31e6f..7ca8f5c4 100644
--- a/vms/vms_fwrite.c
+++ b/vms/vms_fwrite.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1991-1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -69,7 +69,9 @@ tty_fwrite( const void *buf, size_t size, size_t number, FILE *file )
short chan;
int file_num, result;
- if (!file || !*file)
+ if (!size || !number)
+ return 0;
+ else if (!file || !*file)
return 0 * (errno = EBADF); /* kludge alert! */
else if (file == prev_file)
file_num = prev_file_num;
diff --git a/vms/vmsbuild.com b/vms/vmsbuild.com
index de01cc74..50d2b5a0 100644
--- a/vms/vmsbuild.com
+++ b/vms/vmsbuild.com
@@ -5,7 +5,7 @@ $! gawk 2.14 revised, Sep'92
$! gawk 2.15 revised, Oct'93
$!
$ REL = "2.15" !release version number
-$ PATCHLVL = "5"
+$ PATCHLVL = "6"
$!
$! [ remove "/optimize=noinline" for VAX C V2.x or DEC C ]
$! [ add "/standard=VAXC" for DEC C and "/g_float" for Alpha ]