awk 2.0 for GNO/ME, including modified Bell Labs source code, test cases,

and output files for test case comparison. See README.gno for implementation
notes. NOTE: some test cases in tests/dotests are commented-out because
they depend on pipes working and/or the "sort" utility.
This commit is contained in:
tribby 1998-04-07 16:19:01 +00:00
parent d522fa44b8
commit 0b6d503134
116 changed files with 3581 additions and 1433 deletions

64
usr.bin/awk/Makefile Normal file
View File

@ -0,0 +1,64 @@
#
# This makefile is intended for use with dmake(1) on Apple IIGS
# $Id: Makefile,v 1.1 1998/04/07 16:13:04 tribby Exp $
#
# Created by Dave Tribby, January 1998
# --------------------------------------------------------------------
# NOTE: the original Bell Labs package uses yacc (or bison) to compile
# awkgram.y into ytab.c and ytab.h. It compiles maketab.c into
# the program maketab, and produces proctab.c using maketab and
# ytab.h. I chose to create ytab.c, ytab.h, and proctab.c on a
# Unix system and bring them to the Apple IIGS, since I don't
# use yacc or bison on my GS. This makefile could be modified
# to include these additional steps. If necessary, remove the
# "#" from the beginning of the following lines and move them
# to the end of this Makefile.
#OBJS += maketab maketab.o
#YFLAGS += -d
#ytab.h: awk.h proto.h awkgram.y
# $(YACC) $(YFLAGS) awkgram.y
# mv y.tab.c ytab.c
# mv y.tab.h ytab.h
#
#proctab.c: maketab
# $(OBJ_DIR)maketab >proctab.c
#
#maketab.o: ytab.h maketab.c
# $(CC) -o $@ $(CFLAGS:s/ -r / /) -a0 -c maketab.c
#
#maketab: maketab.o
# $(CC) -o $(OBJ_DIR)$@ $(LDFLAGS) $< $(LDLIBS)
# --------------------------------------------------------------------
# Default stack size (can be overridden by cmd line)
# This value have been tested and certified as working, although
# even more may be required for deeply recursive awk programs
STACK *= 4096
# Program name
PROG= awk
MAIN= main
# Source files
# Compile main program first, then in size order since ORCA/C
# can run out of memory if run.c is compiled last
SRCS= main.c run.c ytab.c b.c lib.c lex.c tran.c parse.c proctab.c
# Deliver to /usr/bin
BINDIR = /usr/bin
.INCLUDE : /src/gno/prog.mk
#
# Additional dependancies
#
main.o: awk.h proto.h ytab.h
b.o: awk.h proto.h ytab.h
parse.o: awk.h proto.h ytab.h
lib.o: awk.h proto.h ytab.h
run.o: awk.h proto.h ytab.h
tran.o: awk.h proto.h ytab.h
ytab.o: awk.h proto.h
lex.o: awk.h proto.h
proctab.o: awk.h proto.h

139
usr.bin/awk/README.gno Normal file
View File

@ -0,0 +1,139 @@
==========================================================
AWK Version 2.0: Updated for GNO/ME 2.0.6
$Id: README.gno,v 1.1 1998/04/07 16:13:08 tribby Exp $
==========================================================
AWK is a powerful string processing language that is widely used in the Unix
world. Jawaid Bazyar, the "father" of GNO/ME, created version 1.00 in
December 1994 by porting scource code available to the public from Bell Labs
(then part of AT&T; now part of Lucent Technologies). The code remains
available on Brian W. Kernighan's Web page at URL
http://plan9.bell-labs.com/who/bwk/awk.tar.gz
In addition to adding GNO/ME 2.0.6 compatibility, version 2.0
picks up the latest enhancements and defect fixes from Bell Labs.
(AWK 1.0 was based upon July 1993 code; 2.0 is based upon code
completed in February 1998.)
While this version of AWK has been tested against dozens of sample
AWK programs, its extensive feature set makes exhaustive testing very
difficult. It is certainly conceivable that bugs were introduced by the
porting process; if you find one, please let me know.
==========
Compiling
=========
This package requires the GNO/ME 2.0.6, ORCA/C 2.1, dmake, and occ.
The Makefile uses the standard GNO/ME 2.0.6 declaration files.
The Bell Labs package uses yacc (or bison) to compile awkgram.y to ytab.c
and ytab.h. The program maketab then uses ytab.h to produce proctab.c
For the 2.0 delivery of GNO, I did not compile awkgram.y or proctab.c
on the Apple IIGS but instead produced these on an HP-UX workstation.
Note: the ytab.c shipped with the Bell Labs code uses integers starting at
57346 to represent the symbol definitions, which causes problems for ORCA/C.
The version generated under HP-UX starts with 257.
==================================
Changes To Make AWK Work Under GNO
==================================
The majority of original changes required to make AWK work on the
Apple IIGS involved replacing large procedure-local (stack-based)
arrays and data structures with a call to malloc() at the beginning
of the function and a call to free() at the end. Between 1993 and 1998,
the Bell Labs source code evolved to remove many of the local arrays,
and fewer changes were needed to port the latest version.
In all cases, the original C code was left in place in parallel to the
new code, with #ifdef directives selecting the appropriate version.
The version 1.00 changes were:
(1) Reduce the size of the data structure (in the case of an array
of possible open file pointers; reduce the system's FOPEN_MAX
from 32768 to 40 by redefining it (in "run.c").
(2) Allocate all large local structures via malloc() and free.
(in "run.c")
(3) Set the IIGS OMF load segment names, since AWK is bigger than
64K and the code must therefore be segmented.
(4) In main.c, signal(SIGFPE,fpecatch) was removed, because the
IIGS floating point libraries don't send signals on floating
point exceptions.
Version 2.0 changes fall into several categories --
Due to changes in the way AWK allocates buffers, and the ORCA/C math.h
header files, several of the changes Jawaid Bazyar introduced were no
longer needed:
- Most of the buffer allocation/deallocation code was already in
the latest Bell Labs code. [run.c]
- Due to declaration in math.h of modf(double, double*), in
several declarations int variables changed back to double, and
type casting "(extended)" was removed. [tran.c, run.c]
There were a few changes for compatibility with GNO/ME 2.0.6. These
were marked with "#ifdef __GNO__" to differentiate GNO changes from
ORCA/C changes (see below).
- Declaration of initenv() was removed and the call to initenv()
was changed to environInit(). [main.c]
- Removed unnecessary unprototyped declarations. [ytab.c]
- Added code to check for stack space when __STACK_CHECK__
is definef [main.c]
- Hash function required unsigned long (rather than unsigned)
intermediate value [tran.c]
- One module had to be broken into two segments, in order to
accomodate generated code under full debug mode [run.c]
- External nodestat is declared but never defined or used; this
caused a link error when using full debug mode [awk.h]
- Added ID of 2.0 when printing version [main.c]
- A make file compatible with dmake and the GNO development
environment was created [Makefile].
- Resources for version information and descriptive comment were
added [awk.rez].
- Database entry for desc utility was added. [rez.desc]
C code translated to assembly language for performance improvement
is marked with "#if defined(__NOASM__) || !defined(__ORCAC__)". If
necessary to test with the C code rather than assembly, define the
macro __NOASM__.
- The routine hash() was recoded, resulting in a 10% performance
boost [tran.c].
Instances of defects in the ORCA/C compiler that required code
modification for successful compilation (marked with #ifndef __ORCAC__)
- ORCA/C 2.1.0 reports a type conflict for the code segment
fp = strcmp(s, "-") == 0 ? stdin : fopen(s, "r");
so different, equivalent code was used. [run.c]
- ORCA/C 2.1.0 could not parse string.h after macro declarations,
so #include was moved before declarations. [lex.c]
When required to pass lint, headers were modified to be prototyped
(marked with #ifndef __STDC__) [lex.c, ytab.c]
Due to the way the C source code debuggers work, it was necessary to
comment out all "#line" directives in ytab.c.
==================
Author Information
==================
Version 1.00, December 1994:
Jawaid Bazyar
Version 2.0, March 1998:
Dave Tribby
tribby@cup.hp.com

View File

@ -1,15 +1,9 @@
.de EX
.nf
.ft CW
..
.de EE
.br
.fi
.ft 1
..
awk
.TH AWK 1
.CT 1 files prog_other
.\" awk man page, taken from the download available on Brian Kernighan's
.\" Web page at Bell Labs (Lucent Technologies); February 1998 version.
.\"
.\" Modified for GNO/ME 2.0.6 by Dave Tribby
.\" $Id: awk.1,v 1.3 1998/04/07 16:13:11 tribby Exp $
.TH AWK 1 "March 1998" "GNO" "Commands and Applications"
.SH NAME
awk \- pattern-directed scanning and processing language
.SH SYNOPSIS
@ -101,10 +95,8 @@ An action is a sequence of statements.
A statement can be one of the following:
.PP
.EX
.ta \w'\f(CWdelete array[expression]'u
.RS
.nf
.ft CW
if(\fI expression \fP)\fI statement \fP\fR[ \fPelse\fI statement \fP\fR]\fP
while(\fI expression \fP)\fI statement\fP
for(\fI expression \fP;\fI expression \fP;\fI expression \fP)\fI statement\fP
@ -124,8 +116,6 @@ delete\fI array\fP #\fR delete all elements of array\fP
exit\fR [ \fP\fIexpression \fP\fR]\fP #\fR exit immediately; status is \fP\fIexpression\fP
.fi
.RE
.EE
.DT
.PP
Statements are terminated by
semicolons, newlines or right braces.
@ -133,7 +123,7 @@ An empty
.I expression-list
stands for
.BR $0 .
String constants are quoted \&\f(CW"\ "\fR,
String constants are quoted \&\fB"\fR\ \fB"\fR,
with the usual C escapes recognized within.
Expressions take on string or numeric values as appropriate,
and are built using the operators
@ -198,7 +188,6 @@ and
.BR atan2
are built in.
Other built-in functions:
.TF length
.TP
.B length
the length of its argument
@ -313,7 +302,6 @@ returns a copy of
.I str
with all lower-case characters translated to their
corresponding upper-case equivalents.
.PD
.PP
The ``function''
.B getline
@ -375,13 +363,13 @@ though an occurrence of the second.
.PP
A relational expression is one of the following:
.IP
.I expression matchop regular-expression
.IR expression " " matchop " " regular-expression
.br
.I expression relop expression
.IR expression " " relop " " expression
.br
.IB expression " in " array-name
.IR expression " in " array-name
.br
.BI ( expr , expr,... ") in " array-name
.RI ( expr , expr,... ") in " array-name
.PP
where a relop is any of the six relational operators in C,
and a matchop is either
@ -407,7 +395,6 @@ and
do not combine with other patterns.
.PP
Variable names with special meanings:
.TF FILENAME
.TP
.B CONVFMT
conversion format used when converting numbers
@ -456,7 +443,6 @@ non-null members are taken as filenames
.TP
.B ENVIRON
array of environment variables; subscripts are names.
.PD
.PP
Functions may be defined (at the position of a pattern-action statement) thus:
.IP
@ -472,35 +458,28 @@ the function definition.
.TP
.EX
length($0) > 72
.EE
.PP
Print lines longer than 72 characters.
.TP
.EX
{ print $2, $1 }
.EE
.IP
Print first two fields in opposite order.
.PP
.EX
BEGIN { FS = ",[ \et]*|[ \et]+" }
{ print $2, $1 }
.EE
.ns
.IP
Same, with input fields separated by comma and/or blanks and tabs.
.PP
.EX
.nf
{ s += $1 }
END { print "sum is", s, " average is", s/NR }
.fi
.EE
.ns
.IP
Add up first column, print sum and average.
.TP
.EX
/start/, /stop/
.EE
Print all lines between start/stop pairs.
.PP
.EX
@ -510,7 +489,6 @@ BEGIN { # Simulate echo(1)
printf "\en"
exit }
.fi
.EE
.SH SEE ALSO
.IR lex (1),
.IR sed (1)
@ -519,11 +497,28 @@ A. V. Aho, B. W. Kernighan, P. J. Weinberger,
.I
The AWK Programming Language,
Addison-Wesley, 1988. ISBN 0-201-07981-X
.SH VERSION
This manual page documents GNO/ME
.BR awk
version 2.0, based upon Lucent Technologies version 980211.
.SH ATTRIBUTIONS
This command was ported for distribution with GNO/ME 2.0.6
from source code made available via the Web page of Brian
Kernighan at Bell Labs (Lucent Technologies).
.SH HISTORY
GNO/ME version 1.0 (December 1994) of
.BR awk
was translated from Bell Labs source code
(version July 23, 1993) by Jawaid Bazyar
and distributed as a separate archive.
.SH BUGS
There are no explicit conversions between numbers and strings.
To force an expression to be treated as a number add 0 to it;
to force it to be treated as a string concatenate
\&\f(CW""\fP to it.
to force it to be treated as a string concatenate \fB""\fP to it.
.br
The scope rules for variables in functions are a botch;
the syntax is worse.
.br
This GNO version has 4096 bytes of stack space allocated. This should
be enough for most cases, but extreme recursion in an awk script can cause
heavy stack usage and progam failure.

10
usr.bin/awk/awk.desc Normal file
View File

@ -0,0 +1,10 @@
Name: awk
Version: 2.0 (March 1998)
Shell: GNO
Author: Jawaid Bazyar (from Bell Labs code; updated by Dave Tribby)
Contact: tribby@cup.hp.com
Where: /usr/bin
FTP: ground.isca.uiowa.edu apple2.caltech.edu trenco.myrias.com
Pattern-directed scanning and processing language.

View File

@ -22,6 +22,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
/* $Id: awk.h,v 1.2 1998/04/07 16:13:18 tribby Exp $ */
typedef double Awkfloat;
/* unsigned char is more trouble than it's worth */
@ -142,7 +144,9 @@ typedef struct Node {
#define NIL ((Node *) 0)
extern Node *winner;
#ifndef __GNO__ /* nullstat not used/defined; causes debugger problems */
extern Node *nullstat;
#endif
extern Node *nullnode;
/* ctypes */

30
usr.bin/awk/awk.rez Normal file
View File

@ -0,0 +1,30 @@
/*
* Resources for version and comment
* $Id: awk.rez,v 1.1 1998/04/07 16:13:21 tribby Exp $
*/
#define PROG "awk"
#define DESC "Pattern-directed scanning and processing language."
#include "Types.rez"
/*
* Version
*/
resource rVersion (1, purgeable3) {
{ 2, 0, 0, /* Version 2.0.0 */
release, /* development|alpha|beta|final|release */
0 }, /* non-final release number */
verUS, /* Country */
PROG, /* Program name */
DESC
};
/*
* Comment
*/
resource rComment (1, purgeable3) {
PROG " v2.0 (March 1998)\n"
"GNO utility: " DESC "\n"
"Ported from Bell Labs code by Jawaid Bazyar; updated by Dave Tribby"
};

View File

@ -22,6 +22,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
/* $Id: awkgram.y,v 1.2 1998/04/07 16:13:23 tribby Exp $ */
%{
#include <stdio.h>
#include <string.h>

View File

@ -24,6 +24,12 @@ THIS SOFTWARE.
/* lasciate ogne speranza, voi ch'entrate. */
/* $Id: b.c,v 1.2 1998/04/07 16:13:27 tribby Exp $ */
#ifdef __GNO__
segment "b";
#endif
#define DEBUG
#include <ctype.h>

View File

@ -22,6 +22,12 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
/* $Id: lex.c,v 1.3 1998/04/07 16:13:31 tribby Exp $ */
#ifdef __GNO__
segment "lex";
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -96,7 +102,11 @@ Keyword keywords[] ={ /* keep sorted: binary searched */
#define RET(x) return(x)
#endif
#ifndef __STDC__
int peek()
#else
int peek(void)
#endif
{
int c = input();
unput(c);
@ -163,7 +173,11 @@ int regexpr(void);
int sc = 0; /* 1 => return a } right now */
int reg = 0; /* 1 => return a REGEXPR now */
#ifndef __STDC__
int yylex()
#else
int yylex(void)
#endif
{
int c, n;
static char *buf = 0;
@ -348,7 +362,11 @@ int yylex()
}
}
#ifndef __STDC__
int string()
#else
int string(void)
#endif
{
int c, n;
char *s, *bp;
@ -492,7 +510,11 @@ void startreg(void) /* next call to yyles will return a regular expression */
reg = 1;
}
#ifndef __STDC__
int regexpr()
#else
int regexpr(void)
#endif
{
int c;
static char *buf = 0;

View File

@ -22,6 +22,12 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
/* $Id: lib.c,v 1.2 1998/04/07 16:13:35 tribby Exp $ */
#ifdef __GNO__
segment "lib";
#endif
#define DEBUG
#include <stdio.h>
#include <string.h>

View File

@ -22,6 +22,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
/* $Id: main.c,v 1.3 1998/04/07 16:13:39 tribby Exp $ */
char *version = "version 980211";
#define DEBUG
@ -32,6 +34,9 @@ char *version = "version 980211";
#include <signal.h>
#include "awk.h"
#include "ytab.h"
#if defined(__GNO__) && defined(__STACK_CHECK__)
#include <gno/gno.h>
#endif
extern char **environ;
extern int nfields;
@ -50,17 +55,26 @@ int curpfile = 0; /* current filename */
int safe = 0; /* 1 => "safe" mode */
int main(int argc, char *argv[])
{
char *fs = NULL, *marg;
int temp;
#ifdef __GNO__
#ifdef __STACK_CHECK__
__REPORT_STACK();
#endif
environInit();
#endif
cmdname = argv[0];
if (argc == 1) {
fprintf(stderr, "Usage: %s [-f programfile | 'program'] [-Ffieldsep] [-v var=value] [files]\n", cmdname);
exit(1);
}
#ifndef __GNO__
signal(SIGFPE, fpecatch);
#endif
yyin = NULL;
symtab = makesymtab(NSYMTAB);
while (argc > 1 && argv[1][0] == '-' && argv[1][1] != '\0') {
@ -120,7 +134,11 @@ int main(int argc, char *argv[])
dbg = atoi(&argv[1][2]);
if (dbg == 0)
dbg = 1;
#ifndef __GNO__
printf("awk %s\n", version);
#else
printf("awk 2.0 for GNO/ME; based on %s\n", version);
#endif
break;
default:
ERROR "unknown option %s ignored", argv[1] WARNING;
@ -158,6 +176,9 @@ int main(int argc, char *argv[])
run(winner);
} else
bracecheck();
#if defined(__GNO__) && defined(__STACK_CHECK__)
printf("=> stack usage: %d bytes\n", _endStackCheck());
#endif
return(errorflag);
}

View File

@ -22,6 +22,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
/* $Id: maketab.c,v 1.3 1998/04/07 16:13:46 tribby Exp $ */
/*
* this program makes the table to link function names
* and type indices that is used by execute() in run.c.

View File

@ -22,6 +22,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
/* $Id: parse.c,v 1.2 1998/04/07 16:13:49 tribby Exp $ */
#define DEBUG
#include <stdio.h>
#include <string.h>

View File

@ -22,6 +22,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
/* $Id: proto.h,v 1.3 1998/04/07 16:13:52 tribby Exp $ */
extern int yywrap(void);
extern void setfname(Cell *);
extern int constnode(Node *);

View File

@ -22,6 +22,12 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
/* $Id: run.c,v 1.3 1998/04/07 16:13:55 tribby Exp $ */
#ifdef __GNO__
segment "run";
#endif
#define DEBUG
#include <stdio.h>
#include <ctype.h>
@ -32,9 +38,19 @@ THIS SOFTWARE.
#include <time.h>
#include "awk.h"
#include "ytab.h"
#if defined(__GNO__) && defined(__STACK_CHECK__)
#include <gno/gno.h>
#undef true
#undef false
#endif
#define tempfree(x) if (istemp(x)) tfree(x); else
#ifdef __GNO__
#undef FOPEN_MAX
#define FOPEN_MAX 40
#endif
/*
#undef tempfree
@ -196,6 +212,9 @@ Cell *program(Node **a, int n) /* execute an awk program */
tempfree(x);
}
ex1:
#if defined(__GNO__) && defined(__STACK_CHECK__)
printf("=> stack usage: %d bytes\n", _endStackCheck());
#endif
return(true);
}
@ -217,10 +236,18 @@ Cell *call(Node **a, int n) /* function call. very kludgy and fragile */
static Cell newcopycell = { OCELL, CCOPY, 0, "", 0.0, NUM|STR|DONTFREE };
int i, ncall, ndef;
Node *x;
#ifdef __GNO__
Cell **args, **oargs;
#else
Cell *args[NARGS], *oargs[NARGS]; /* BUG: fixed size arrays */
#endif
Cell *y, *z, *fcn;
char *s;
#ifdef __GNO__
args = malloc(sizeof(Cell *) * NARGS);
oargs = malloc(sizeof(Cell *) * NARGS);
#endif
fcn = execute(a[0]); /* the function itself */
s = fcn->nval;
if (!isfcn(fcn))
@ -295,12 +322,22 @@ Cell *call(Node **a, int n) /* function call. very kludgy and fragile */
}
}
tempfree(fcn);
#ifdef __GNO__
if (isexit(y) || isnext(y) || isnextfile(y)) {
free(args); free(oargs); return y;
}
#else
if (isexit(y) || isnext(y) || isnextfile(y))
return y;
#endif
tempfree(y); /* this can free twice! */
z = fp->retval; /* return value */
dprintf( ("%s returns %g |%s| %o\n", s, getfval(z), getsval(z), z->tval) );
fp--;
#ifdef __GNO__
free(args);
free(oargs);
#endif
return(z);
}
@ -1114,6 +1151,11 @@ Cell *assign(Node **a, int n) /* a[0] = a[1], a[0] += a[1], etc. */
return(x);
}
#ifdef __GNO__
/* In full debug mode, there is too much code for one segment */
segment "run2";
#endif
Cell *cat(Node **a, int q) /* a[0] cat a[1] */
{
Cell *x, *y, *z;
@ -1615,7 +1657,15 @@ FILE *openfile(int a, char *us)
} else if (a == LE) { /* input pipe */
fp = popen(s, "r");
} else if (a == LT) { /* getline <file */
#ifndef __ORCAC__ /* ORCA/C 2.1.0 reports a type conflict */
fp = strcmp(s, "-") == 0 ? stdin : fopen(s, "r"); /* "-" is stdin */
#else
/* "-" is stdin */
if (strcmp(s, "-") == 0)
fp = stdin;
else
fp = fopen(s, "r");
#endif
} else /* can't happen */
ERROR "illegal redirection %d", a FATAL;
if (fp != NULL) {

View File

@ -0,0 +1,14 @@
s1_l1_1
s1_l1_2
s1_l1_3
s1_l1_4
s1_l1_5
s1_l1_6
s1_l1_7
s1_l1_8
s1_l1_9
s1_l1_10
s1_l1_11
s1_l1_12
s1_l1_13
s1_l1_14

View File

@ -0,0 +1,14 @@
e1_l1_1
e1_l1_2
e1_l1_3
e1_l1_4
e1_l1_5
e1_l1_6
e1_l1_7
e1_l1_8
e1_l1_9
e1_l1_10
e1_l1_11
e1_l1_12
e1_l1_13
e1_l1_14

View File

@ -0,0 +1,14 @@
e1_l1_1
e1_l1_2
e1_l1_3
e1_l1_4
e1_l1_5
e1_l1_6
e1_l1_7
e1_l1_8
e1_l1_9
e1_l1_10
e1_l1_11
e1_l1_12
e1_l1_13
e1_l1_14

View File

@ -0,0 +1,42 @@
e1_l1_1
e2_e1_l1_1
e2_e1_l1_1
e1_l1_2
e2_e1_l1_2
e2_e1_l1_2
e1_l1_3
e2_e1_l1_3
e2_e1_l1_3
e1_l1_4
e2_e1_l1_4
e2_e1_l1_4
e1_l1_5
e2_e1_l1_5
e2_e1_l1_5
e1_l1_6
e2_e1_l1_6
e2_e1_l1_6
e1_l1_7
e2_e1_l1_7
e2_e1_l1_7
e1_l1_8
e2_e1_l1_8
e2_e1_l1_8
e1_l1_9
e2_e1_l1_9
e2_e1_l1_9
e1_l1_10
e2_e1_l1_10
e2_e1_l1_10
e1_l1_11
e2_e1_l1_11
e2_e1_l1_11
e1_l1_12
e2_e1_l1_12
e2_e1_l1_12
e1_l1_13
e2_e1_l1_13
e2_e1_l1_13
e1_l1_14
e2_e1_l1_14
e2_e1_l1_14

View File

@ -0,0 +1,42 @@
s1_l1_1
s2_s1_l1_1
s2_s1_l1_1
s1_l1_2
s2_s1_l1_2
s2_s1_l1_2
s1_l1_3
s2_s1_l1_3
s2_s1_l1_3
s1_l1_4
s2_s1_l1_4
s2_s1_l1_4
s1_l1_5
s2_s1_l1_5
s2_s1_l1_5
s1_l1_6
s2_s1_l1_6
s2_s1_l1_6
s1_l1_7
s2_s1_l1_7
s2_s1_l1_7
s1_l1_8
s2_s1_l1_8
s2_s1_l1_8
s1_l1_9
s2_s1_l1_9
s2_s1_l1_9
s1_l1_10
s2_s1_l1_10
s2_s1_l1_10
s1_l1_11
s2_s1_l1_11
s2_s1_l1_11
s1_l1_12
s2_s1_l1_12
s2_s1_l1_12
s1_l1_13
s2_s1_l1_13
s2_s1_l1_13
s1_l1_14
s2_s1_l1_14
s2_s1_l1_14

View File

@ -0,0 +1,56 @@
e1_l1_1
e1_l1_1
e1_l1_2
e1_l1_2
e1_l1_3
e1_l1_3
e1_l1_4
e1_l1_4
e1_l1_5
e1_l1_5
e1_l1_6
e1_l1_6
e1_l1_7
e1_l1_7
e1_l1_8
e1_l1_8
e1_l1_9
e1_l1_9
e1_l1_10
e1_l1_10
e1_l1_11
e1_l1_11
e1_l1_12
e1_l1_12
e1_l1_13
e1_l1_13
e1_l1_14
e1_l1_14
e1_l1_1
e1_l1_1
e1_l1_2
e1_l1_2
e1_l1_3
e1_l1_3
e1_l1_4
e1_l1_4
e1_l1_5
e1_l1_5
e1_l1_6
e1_l1_6
e1_l1_7
e1_l1_7
e1_l1_8
e1_l1_8
e1_l1_9
e1_l1_9
e1_l1_10
e1_l1_10
e1_l1_11
e1_l1_11
e1_l1_12
e1_l1_12
e1_l1_13
e1_l1_13
e1_l1_14
e1_l1_14

View File

@ -0,0 +1,14 @@
l1_1
l1_2
l1_3
l1_4
l1_5
l1_6
l1_7
l1_8
l1_9
l1_10
l1_11
l1_12
l1_13
l1_14

View File

@ -0,0 +1,14 @@
e1_l1_1
e1_l1_2
e1_l1_3
e1_l1_4
e1_l1_5
e1_l1_6
e1_l1_7
e1_l1_8
e1_l1_9
e1_l1_10
e1_l1_11
e1_l1_12
e1_l1_13
e1_l1_14

View File

@ -0,0 +1,14 @@
e1_l1_1
e1_l1_2
e1_l1_3
e1_l1_4
e1_l1_5
e1_l1_6
e1_l1_7
e1_l1_8
e1_l1_9
e1_l1_10
e1_l1_11
e1_l1_12
e1_l1_13
e1_l1_14

View File

@ -0,0 +1,14 @@
s1_l1_1
s1_l1_2
s1_l1_3
s1_l1_4
s1_l1_5
s1_l1_6
s1_l1_7
s1_l1_8
s1_l1_9
s1_l1_10
s1_l1_11
s1_l1_12
s1_l1_13
s1_l1_14

View File

@ -0,0 +1 @@
l1_4

View File

@ -0,0 +1,4 @@
l1_1
l1_2
l1_3
l1_4

View File

@ -0,0 +1,23 @@
l1_1
l1_2
l1_3
l1_4
l1_5
l1_6
l1_7
l1_8
l1_9
l1_10
l1_11
l1_12
l1_13
l1_14
l2_1
l2_2
l2_3
l2_4
l2_5
l2_6
l2_7
l2_8
l2_9

View File

@ -0,0 +1,17 @@
l1_4
l1_5
l1_6
l1_7
l1_8
l1_9
l1_10
l1_14
l2_1
l2_2
l2_3
l2_4
l2_5
l2_6
l2_7
l2_8
l2_9

View File

@ -0,0 +1,7 @@
l2_3
l2_4
l2_5
l2_6
l2_7
l2_8
l2_9

View File

@ -0,0 +1 @@
l2_6

View File

@ -0,0 +1 @@
l1_14

View File

@ -0,0 +1 @@
l2_9

View File

@ -0,0 +1 @@
l1_7

View File

@ -0,0 +1,14 @@
l1_1
l1_2
l1_3
^l1T4$
^l1T5$
^l1T6$
^l1T7$
^l1T8$
^l1T9$
^l1T10$
^l1T11$
^l1T12$
l1_13
l1_14

View File

@ -0,0 +1,14 @@
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXXX
XXXXX
XXXXX
XXXXX
XXXXX

View File

@ -0,0 +1,14 @@
lX_X
lX_X
lX_X
lX_4
lX_5
lX_6
lX_7
lX_8
lX_9
lX_X0
lX_XX
lX_XX
lX_XX
lX_X4

View File

@ -0,0 +1,29 @@
Values in array
nine 9
two 2
one 1
three 3
six 6
four 4
seven 7
five 5
eight 8
Values in array
two 2
one 1
three 3
six 6
four 4
seven 7
five 5
eight 8
Values in array
two II
one I
three III
six VI
four IV
five V

View File

@ -0,0 +1 @@
256.273

View File

@ -0,0 +1,15 @@
NORTH
S: K Q 7
H: Q 7 4
D: A 2
C: J 10 7 6 2
WEST EAST
S: 9 4 S: A 10 5
H: K 8 3 H: A 10 9 6
D: J 8 6 5 4 D: K 10
C: A 5 4 C: K Q 9 3
SOUTH
S: J 8 6 3 2
H: J 5 2
D: Q 9 7 3
C: 8

View File

@ -0,0 +1,7 @@
/tmp/bundle # bundle - combine multiple files into one
/tmp/bundle
/tmp/bundle { print FILENAME, $0 }
/tmp/unbundle # unbundle - unpack a bundle into separate files
/tmp/unbundle
/tmp/unbundle $1 != prev { close(prev); prev = $1 }
/tmp/unbundle { print substr($0, index($0, " ") + 1) >$1 }

View File

@ -0,0 +1,6 @@
Beth $ 0.00
Dan $ 0.00
Kathy $ 40.00
Mark $100.00
Mary $121.00
Susie $ 76.50

View File

@ -0,0 +1,2 @@
Mark 5.00 20
Mary 5.50 22

View File

@ -0,0 +1,3 @@
$100.00 for Mark
$121.00 for Mary
$76.50 for Susie

View File

@ -0,0 +1,5 @@
Beth 4.00 0
Kathy 4.00 10
Mark 5.00 20
Mary 5.50 22
Susie 4.25 18

View File

@ -0,0 +1,6 @@
3 Beth 0
3 Dan 0
3 Kathy 10
3 Mark 20
3 Mary 22
3 Susie 18

View File

@ -0,0 +1,8 @@
NAME RATE HOURS
Beth 4.00 0
Dan 3.75 0
Kathy 4.00 10
Mark 5.00 20
Mary 5.50 22
Susie 4.25 18

View File

@ -0,0 +1 @@
3 employees worked more than 15 hours

View File

@ -0,0 +1,3 @@
6 employees
total pay is 337.5
average pay is 56.25

View File

@ -0,0 +1 @@
highest hourly rate: 5.50 for Mary

View File

@ -0,0 +1 @@
Susie 4.25 18

View File

@ -0,0 +1 @@
Beth Dan Kathy Mark Mary Susie

View File

@ -0,0 +1 @@
6 lines, 18 words, 77 characters

View File

@ -0,0 +1 @@
no employees are paid more than $6/hour

View File

@ -0,0 +1,6 @@
Susie 4.25 18
Mary 5.50 22
Mark 5.00 20
Kathy 4.00 10
Dan 3.75 0
Beth 4.00 0

View File

@ -0,0 +1 @@
18

View File

@ -0,0 +1 @@
18

View File

@ -0,0 +1 @@
Susie Susie 4.25 18

View File

@ -0,0 +1,6 @@
4
3.75
14
25
27.5
22.25

View File

@ -0,0 +1 @@
96.5

View File

@ -0,0 +1,15 @@
COUNTRY AREA POP CONTINENT
USSR 8649 275 Asia
Canada 3852 25 North America
China 3705 1032 Asia
USA 3615 237 North America
Brazil 3286 134 South America
India 1267 746 Asia
Mexico 762 78 North America
France 211 55 Europe
Japan 144 120 Asia
Germany 96 61 Europe
England 94 56 Europe
TOTAL 25681 2819

View File

@ -0,0 +1,7 @@
USSR 8649 275 Asia
China 3705 1032 Asia
India 1267 746 Asia
France 211 55 Europe
Japan 144 120 Asia
Germany 96 61 Europe
England 94 56 Europe

View File

@ -0,0 +1,4 @@
France 211 55 Europe
Japan 144 120 Asia
Germany 96 61 Europe
England 94 56 Europe

View File

@ -0,0 +1,5 @@
countries: USSR 8649 275 Asia
countries: Canada 3852 25 North America
countries: China 3705 1032 Asia
countries: USA 3615 237 North America
countries: Brazil 3286 134 South America

View File

@ -0,0 +1 @@
Total population of the 4 Asian countries is 2173 million.

View File

@ -0,0 +1 @@
country with largest population: China 1032

View File

@ -0,0 +1,11 @@
1:USSR 8649 275 Asia
2:Canada 3852 25 North America
3:China 3705 1032 Asia
4:USA 3615 237 North America
5:Brazil 3286 134 South America
6:India 1267 746 Asia
7:Mexico 762 78 North America
8:France 211 55 Europe
9:Japan 144 120 Asia
10:Germany 96 61 Europe
11:England 94 56 Europe

View File

@ -0,0 +1,11 @@
USSR 8649 275 Asia
Canada 3852 25 North America
China 3705 1032 Asia
United States 3615 237 North America
Brazil 3286 134 South America
India 1267 746 Asia
Mexico 762 78 North America
France 211 55 Europe
Japan 144 120 Asia
Germany 96 61 Europe
England 94 56 Europe

View File

@ -0,0 +1,11 @@
USS 8649 275 Asia
Can 3852 25 North America
Chi 3705 1032 Asia
USA 3615 237 North America
Bra 3286 134 South America
Ind 1267 746 Asia
Mex 762 78 North America
Fra 211 55 Europe
Jap 144 120 Asia
Ger 96 61 Europe
Eng 94 56 Europe

View File

@ -0,0 +1 @@
USS Can Chi USA Bra Ind Mex Fra Jap Ger Eng

View File

@ -0,0 +1,11 @@
USSR 8649 275 Asia
Canada 3852 25 NA
China 3705 1032 Asia
USA 3615 237 NA
Brazil 3286 134 SA
India 1267 746 Asia
Mexico 762 78 NA
France 211 55 Europe
Japan 144 120 Asia
Germany 96 61 Europe
England 94 56 Europe

View File

@ -0,0 +1,6 @@
0
10
20
30
40
50

View File

@ -0,0 +1,48 @@
USSR
8649
275
Asia
Canada
3852
25
North
America
China
3705
1032
Asia
USA
3615
237
North
America
Brazil
3286
134
South
America
India
1267
746
Asia
Mexico
762
78
North
America
France
211
55
Europe
Japan
144
120
Asia
Germany
96
61
Europe
England
94
56
Europe

View File

@ -0,0 +1,48 @@
USSR
8649
275
Asia
Canada
3852
25
North
America
China
3705
1032
Asia
USA
3615
237
North
America
Brazil
3286
134
South
America
India
1267
746
Asia
Mexico
762
78
North
America
France
211
55
Europe
Japan
144
120
Asia
Germany
96
61
Europe
England
94
56
Europe

View File

@ -0,0 +1,2 @@
Asian population is 2173 million.
European population is 172 million.

View File

@ -0,0 +1,4 @@
South America 134
North America 340
Asia 2173
Europe 172

View File

@ -0,0 +1,22 @@
USSR:8649
Canada:3852
China:3705
USA:3615
Brazil:3286
India:1267
Mexico:762
France:211
Japan:144
Germany:96
England:94

View File

@ -0,0 +1,4 @@
Asia 2173
North America 340
Europe 172
South America 134

View File

@ -0,0 +1,13 @@
This is a testfile for the awk test ch2p62.awk
USSR 275
China 1032
USA 237
Brazil 134
India 746
Japan 120
Canada 25
Mexico 78
France 55
Germany 61
England 56

View File

@ -0,0 +1 @@
p1 p2 param 3 p4

View File

@ -0,0 +1 @@
deposits $500.00, checks $418.95

View File

@ -0,0 +1,40 @@
1021
Mar. 7, 1998
Pay to Champagne Unlimited-------------------------- $123.10
the sum of one hundred twenty three dollars and 10 cents exactly
1022
Mar. 7, 1998
Pay to Getwell Drug Store--------------------------- $45.10
the sum of forty five dollars and 10 cents exactly
1023
Mar. 7, 1998
Pay to International Travel------------------------- $125.00
the sum of one hundred twenty five dollars and 00 cents exactly
1024
Mar. 7, 1998
Pay to Carnegie Hall-------------------------------- $50.00
the sum of fifty dollars and 00 cents exactly
1025
Mar. 7, 1998
Pay to American Express----------------------------- $75.75
the sum of seventy five dollars and 75 cents exactly

View File

@ -0,0 +1,12 @@
"getsval" in file ../tran.o uses 122 stack bytes
"string" in file ../lex.o uses 128 stack bytes
"split" in file ../run.o uses 101 stack bytes
Code file Code bytes
../main.o 4254
../b.o 21244
../lex.o 10704
../parse.o 3253
../run.o 43971
../lib.o 19039
../proctab.o 1569
../tran.o 8450

View File

@ -0,0 +1,5 @@
7
8
9
10
1

View File

@ -0,0 +1,5 @@
420130 mary's birthday
720327 mark's birthday
700524 anniversary
090612 mother's birthday
751101 elizabeth's birthday

View File

@ -0,0 +1,6 @@
/obj/gno/usr.bin/awk/awk: extra } at source line 1
context is
>>> {}} <<<
/obj/gno/usr.bin/awk/awk: syntax error at source line 1
extra }
/obj/gno/usr.bin/awk/awk: bailing out at source line 1

View File

@ -0,0 +1,6 @@
/obj/gno/usr.bin/awk/awk: extra ) at source line 1
context is
>>> {) <<<
/obj/gno/usr.bin/awk/awk: syntax error at source line 1
/obj/gno/usr.bin/awk/awk: illegal statement at source line 1
extra )

View File

@ -0,0 +1,6 @@
/obj/gno/usr.bin/awk/awk: extra ] at source line 1
context is
>>> {] <<<
/obj/gno/usr.bin/awk/awk: syntax error at source line 1
/obj/gno/usr.bin/awk/awk: illegal statement at source line 1
extra ]

View File

@ -0,0 +1,2 @@
Calculating 10 factorial
Result: 3628800

View File

@ -0,0 +1,8 @@
Subject: Demographic Information About England
From: AWK Demographics, Inc.
In response to your request for information about England,
our latest research has revealed that its population is 94
million people and its area is 56 million square miles.
This gives England a population density of 1.67857 people per
square mile.

View File

@ -0,0 +1,12 @@
CONTINENT COUNTRY POPULATION AREA POP. DEN.
Asia Japan 120 144 833.3
Asia India 746 1267 588.8
Asia China 1032 3705 278.5
Asia USSR 275 8649 31.8
Europe Germany 61 96 635.4
Europe England 56 94 595.7
Europe France 55 211 260.7
North America Mexico 78 762 102.4
North America USA 237 3615 65.6
North America Canada 25 3852 6.5
South America Brazil 134 3286 40.8

View File

@ -0,0 +1,16 @@
CONTINENT COUNTRY POPULATION AREA POP. DEN.
Asia 0.00120000 0 120 144.0
0.00169839 0 746 1267.0
0.00359012 0 1032 3705.0
0.03145091 0 275 8649.0
Europe 0.00157377 0 61 96.0
0.00167857 0 56 94.0
0.00383636 0 55 211.0
North America 0.00976923 0 78 762.0
0.01525316 0 237 3615.0
0.15408000 0 25 3852.0
South America 0.02452239 0 134 3286.0

View File

@ -0,0 +1,11 @@
0 - 9: 22 **********************
10 - 19: 22 **********************
20 - 29: 20 ********************
30 - 39: 19 *******************
40 - 49: 15 ***************
50 - 59: 22 **********************
60 - 69: 20 ********************
70 - 79: 15 ***************
80 - 89: 24 ************************
90 - 99: 19 *******************
100: 2 **

View File

@ -0,0 +1,4 @@
Germany:
61 million people
0.096 million sq. mi.
635.4 people per sq. mi.

View File

@ -0,0 +1,8 @@
USSR:
275 million people
8.649 million sq. mi.
31.8 people per sq. mi.
USA:
237 million people
3.615 million sq. mi.
65.6 people per sq. mi.

View File

@ -0,0 +1,11 @@
Brazil 3286 134 South America Brasilia
Canada 3852 25 North America Ottawa
China 3705 1032 Asia Beijing
England 94 56 Europe London
France 211 55 Europe Paris
Germany 96 61 Europe Bonn
India 1267 746 Asia New Delhi
Japan 144 120 Asia Tokyo
Mexico 762 78 North America Mexico City
USA 3615 237 North America Washington
USSR 8649 275 Asia Moscow

View File

@ -0,0 +1,42 @@
-n Testing command beginning at
Tue Feb 17 13:06:25 PST 1998
Testing prep1 and form1
Completion status = 0
Checking results against control file form1.out (no differences expected)
Completion status = 0
Testing prep2 and form2
Completion status = 0
Checking results against control file form2.out (no differences expected)
Completion status = 0
Testing info.awk (Germany)
Completion status = 0
Checking results against control file infoG.out (no differences expected)
Completion status = 0
Testing info.awk (US)
Completion status = 0
Checking results against control file infoUS.out (no differences expected)
Completion status = 0
Testing form.gen (England)
Completion status = 0
Checking results against control file form.gen.out (no differences expected)
Completion status = 0
Testing table
Completion status = 0
Checking results against control file table.out (no differences expected)
Completion status = 0
Testing table1
Completion status = 0
Checking results against control file table1.out (no differences expected)
Completion status = 0
Testing avgarea.awk (from command line)
Completion status = 0
Checking results against control file avgarea.out (no differences expected)
Completion status = 0
Testing join.awk
Completion status = 0
Checking results against control file join.out (no differences expected)
Completion status = 0
Testing merge.awk
Completion status = 0
Checking results against control file merge.out (no differences expected)
Completion status = 0

View File

@ -0,0 +1,4 @@
USSR 275 Moscow
China 1032 Beijing
India 746 New Delhi
Japan 120 Tokyo

View File

@ -0,0 +1,10 @@
Adam Smith
1234 Wall St., Apt. 5C
New York, NY 10021
212 555-4321
Canadian Consulate
555 Fifth Ave
New York, NY
212 586-2400

Some files were not shown because too many files have changed in this diff Show More