Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/historical/nawk/dist from http://www.cs.princeton.e...
details: https://anonhg.NetBSD.org/src/rev/45f2bf5fbdb5
branches: trunk
changeset: 783554:45f2bf5fbdb5
user: christos <christos%NetBSD.org@localhost>
date: Sat Dec 29 02:14:50 2012 +0000
description:
from http://www.cs.princeton.edu/~bwk/btl.mirror/
diffstat:
external/historical/nawk/dist/FIXES | 58 +
external/historical/nawk/dist/README | 2 +-
external/historical/nawk/dist/ytab.c | 1679 ++++++++++++++++++++++++++++++++++
external/historical/nawk/dist/ytab.h | 101 ++
4 files changed, 1839 insertions(+), 1 deletions(-)
diffs (truncated from 1868 to 300 lines):
diff -r 2cc4d9492dda -r 45f2bf5fbdb5 external/historical/nawk/dist/FIXES
--- a/external/historical/nawk/dist/FIXES Sat Dec 29 00:08:26 2012 +0000
+++ b/external/historical/nawk/dist/FIXES Sat Dec 29 02:14:50 2012 +0000
@@ -25,6 +25,64 @@
This file lists all bug fixes, changes, etc., made since the AWK book
was sent to the printers in August, 1987.
+Dec 20, 2012:
+ fiddled makefile to get correct yacc and bison flags. pick yacc
+ (linux) or bison (mac) as necessary.
+
+ added __attribute__((__noreturn__)) to a couple of lines in
+ proto.h, to silence someone's enthusiastic checker.
+
+ fixed obscure call by value bug in split(a[1],a) reported on
+ 9fans. the management of temporary values is just a mess; i
+ took a shortcut by making an extra string copy. thanks
+ to paul patience and arnold robbins for passing it on and for
+ proposed patches.
+
+ tiny fiddle in setfval to eliminate -0 results in T.expr, which
+ has irritated me for 20+ years.
+
+Aug 10, 2011:
+ another fix to avoid core dump with delete(ARGV); again, many thanks
+ to ruslan ermilov.
+
+Aug 7, 2011:
+ split(s, a, //) now behaves the same as split(s, a, "")
+
+Jun 12, 2011:
+ /pat/, \n /pat/ {...} is now legal, though bad style to use.
+
+ added checks to new -v code that permits -vnospace; thanks to
+ ruslan ermilov for spotting this and providing the patch.
+
+ removed fixed limit on number of open files; thanks to aleksey
+ cheusov and christos zoulos.
+
+ fixed day 1 bug that resurrected deleted elements of ARGV when
+ used as filenames (in lib.c).
+
+ minor type fiddles to make gcc -Wall -pedantic happier (but not
+ totally so); turned on -fno-strict-aliasing in makefile.
+
+May 6, 2011:
+ added #ifdef for isblank.
+ now allows -ffoo as well as -f foo arguments.
+ (thanks, ruslan)
+
+May 1, 2011:
+ after advice from todd miller, kevin lo, ruslan ermilov,
+ and arnold robbins, changed srand() to return the previous
+ seed (which is 1 on the first call of srand). the seed is
+ an Awkfloat internally though converted to unsigned int to
+ pass to the library srand(). thanks, everyone.
+
+ fixed a subtle (and i hope low-probability) overflow error
+ in fldbld, by adding space for one extra \0. thanks to
+ robert bassett for spotting this one and providing a fix.
+
+ removed the files related to compilation on windows. i no
+ longer have anything like a current windows environment, so
+ i can't test any of it.
+
May 23, 2010:
fixed long-standing overflow bug in run.c; many thanks to
nelson beebe for spotting it and providing the fix.
diff -r 2cc4d9492dda -r 45f2bf5fbdb5 external/historical/nawk/dist/README
--- a/external/historical/nawk/dist/README Sat Dec 29 00:08:26 2012 +0000
+++ b/external/historical/nawk/dist/README Sat Dec 29 02:14:50 2012 +0000
@@ -29,7 +29,7 @@
Changes, mostly bug fixes and occasional enhancements, are listed
in FIXES. If you distribute this code further, please please please
distribute FIXES with it. If you find errors, please report them
-to bwk%bell-labs.com@localhost. Thanks.
+to bwk%cs.princeton.edu@localhost. Thanks.
The program itself is created by
make
diff -r 2cc4d9492dda -r 45f2bf5fbdb5 external/historical/nawk/dist/ytab.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/historical/nawk/dist/ytab.c Sat Dec 29 02:14:50 2012 +0000
@@ -0,0 +1,1679 @@
+
+#line 26 "/n/fs/fac/bwk/awk/awkgram.y"
+#include <stdio.h>
+#include <string.h>
+#include "awk.h"
+
+void checkdup(Node *list, Cell *item);
+int yywrap(void) { return(1); }
+
+Node *beginloc = 0;
+Node *endloc = 0;
+int infunc = 0; /* = 1 if in arglist or body of func */
+int inloop = 0; /* = 1 if in while, for, do */
+char *curfname = 0; /* current function name */
+Node *arglist = 0; /* list of args for current function */
+
+#line 41 "/n/fs/fac/bwk/awk/awkgram.y"
+typedef union {
+ Node *p;
+ Cell *cp;
+ int i;
+ char *s;
+} YYSTYPE;
+extern int yyerrflag;
+#ifndef YYMAXDEPTH
+#define YYMAXDEPTH 150
+#endif
+YYSTYPE yylval;
+YYSTYPE yyval;
+#define FIRSTTOKEN 57346
+#define PROGRAM 57347
+#define PASTAT 57348
+#define PASTAT2 57349
+#define XBEGIN 57350
+#define XEND 57351
+#define NL 57352
+#define ARRAY 57353
+#define MATCH 57354
+#define NOTMATCH 57355
+#define MATCHOP 57356
+#define FINAL 57357
+#define DOT 57358
+#define ALL 57359
+#define CCL 57360
+#define NCCL 57361
+#define CHAR 57362
+#define OR 57363
+#define STAR 57364
+#define QUEST 57365
+#define PLUS 57366
+#define EMPTYRE 57367
+#define AND 57368
+#define BOR 57369
+#define APPEND 57370
+#define EQ 57371
+#define GE 57372
+#define GT 57373
+#define LE 57374
+#define LT 57375
+#define NE 57376
+#define IN 57377
+#define ARG 57378
+#define BLTIN 57379
+#define BREAK 57380
+#define CLOSE 57381
+#define CONTINUE 57382
+#define DELETE 57383
+#define DO 57384
+#define EXIT 57385
+#define FOR 57386
+#define FUNC 57387
+#define SUB 57388
+#define GSUB 57389
+#define IF 57390
+#define INDEX 57391
+#define LSUBSTR 57392
+#define MATCHFCN 57393
+#define NEXT 57394
+#define NEXTFILE 57395
+#define ADD 57396
+#define MINUS 57397
+#define MULT 57398
+#define DIVIDE 57399
+#define MOD 57400
+#define ASSIGN 57401
+#define ASGNOP 57402
+#define ADDEQ 57403
+#define SUBEQ 57404
+#define MULTEQ 57405
+#define DIVEQ 57406
+#define MODEQ 57407
+#define POWEQ 57408
+#define PRINT 57409
+#define PRINTF 57410
+#define SPRINTF 57411
+#define ELSE 57412
+#define INTEST 57413
+#define CONDEXPR 57414
+#define POSTINCR 57415
+#define PREINCR 57416
+#define POSTDECR 57417
+#define PREDECR 57418
+#define VAR 57419
+#define IVAR 57420
+#define VARNF 57421
+#define CALL 57422
+#define NUMBER 57423
+#define STRING 57424
+#define REGEXPR 57425
+#define GETLINE 57426
+#define RETURN 57427
+#define SPLIT 57428
+#define SUBSTR 57429
+#define WHILE 57430
+#define CAT 57431
+#define NOT 57432
+#define UMINUS 57433
+#define POWER 57434
+#define DECR 57435
+#define INCR 57436
+#define INDIRECT 57437
+#define LASTTOKEN 57438
+#define YYEOFCODE 1
+#define YYERRCODE 2
+
+#line 445 "/n/fs/fac/bwk/awk/awkgram.y"
+
+
+void setfname(Cell *p)
+{
+ if (isarr(p))
+ SYNTAX("%s is an array, not a function", p->nval);
+ else if (isfcn(p))
+ SYNTAX("you can't define function %s more than once", p->nval);
+ curfname = p->nval;
+}
+
+int constnode(Node *p)
+{
+ return isvalue(p) && ((Cell *) (p->narg[0]))->csub == CCON;
+}
+
+char *strnode(Node *p)
+{
+ return ((Cell *)(p->narg[0]))->sval;
+}
+
+Node *notnull(Node *n)
+{
+ switch (n->nobj) {
+ case LE: case LT: case EQ: case NE: case GT: case GE:
+ case BOR: case AND: case NOT:
+ return n;
+ default:
+ return op2(NE, n, nullnode);
+ }
+}
+
+void checkdup(Node *vl, Cell *cp) /* check if name already in list */
+{
+ char *s = cp->nval;
+ for ( ; vl; vl = vl->nnext) {
+ if (strcmp(s, ((Cell *)(vl->narg[0]))->nval) == 0) {
+ SYNTAX("duplicate argument %s", s);
+ break;
+ }
+ }
+}
+static const short yyexca[] =
+{-1, 0,
+ 1, 28,
+ 8, 28,
+ 9, 28,
+ 12, 28,
+ 13, 28,
+ 16, 28,
+ 46, 28,
+ 47, 28,
+ 49, 28,
+ 55, 28,
+ 56, 28,
+ 57, 28,
+ 59, 28,
+ 61, 28,
+ 79, 28,
+ 87, 28,
+ 88, 28,
+ 89, 28,
+ 90, 28,
+ 91, 28,
+ 92, 28,
+ 96, 28,
+ 98, 28,
+ 99, 28,
+ 102, 28,
+ 103, 28,
+ 106, 28,
+ 109, 28,
+ 110, 28,
+ 111, 28,
+ -2, 0,
+-1, 1,
+ 1, -1,
+ -2, 0,
+-1, 157,
+ 15, 30,
+ -2, 0,
+-1, 176,
+ 14, 0,
+ 24, 0,
+ 39, 0,
+ 40, 0,
+ 41, 0,
+ 42, 0,
+ 43, 0,
+ 44, 0,
Home |
Main Index |
Thread Index |
Old Index