Name
Date
Size
#Lines
LOC

..--

EXPLAINH A D14-Jun-20053.4 KiB11092

MakefileH A D22-Jul-20122.7 KiB12465

READMEH A D14-Jun-20053.7 KiB122104

awk.defH A D21-Oct-20054.7 KiB178155

awk.g.yH A D14-Jun-20057.3 KiB351262

awk.lx.lH A D21-Oct-20056.3 KiB241195

awktype.hH A D14-Jun-20051.2 KiB362

b.cH A D21-Oct-200523.6 KiB1,141917

lib.cH A D06-Jan-20069.7 KiB437325

main.cH A D21-Oct-20054 KiB164110

makeprctab.cH A D19-Aug-20103.4 KiB12590

oawk.xclH A D14-Jun-20053.4 KiB201179

parse.cH A D14-Jun-20053.4 KiB245149

run.cH A D19-Aug-201018.7 KiB1,210947

token.cH A D21-Oct-20052.4 KiB135106

tokenscriptH A D14-Jun-2005151 1312

tran.cH A D21-Oct-20058.2 KiB341238

README

1 #
2 # CDDL HEADER START
3 #
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License, Version 1.0 only
6 # (the "License").  You may not use this file except in compliance
7 # with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22 #ident	"%Z%%M%	%I%	%E% SMI"
23 CHANGES as of July 12:
24 
25 1. \ddd allowed in regular expressions.
26 
27 2. exit <expression> causes the expression to
28 to be the status return upon completion.
29 
30 3. a new builtin called "getline" causes the next
31 input line to be read immediately.  Fields, NR, etc.,
32 are all set, but you are left at exactly the same place
33 in the awk program.  Getline returns 0 for end of file;
34 1 for a normal record.
35 
36 
37 CHANGES SINCE MEMO:
38 Update to TM of Sept 1, 1978:
39 
40 1. A new form of for loop
41 	for (i in array)
42 		statement
43 is now available. It provides a way to walk
44 along the members of an array, most usefully
45 for associative arrays with non-numeric subscripts.
46 Elements are accessed in an unpredictable order,
47 so don't count on anything.
48 Futhermore, havoc ensues if elements are created
49 during this operation, or if the index variable
50 is fiddled.
51 
52 2. index(s1, s2) returns the position in s1
53 where s2 first occurs, or 0 if it doesn't.
54 
55 3. Multi-line records are now supported more
56 conveniently. If the record separator is null
57 	RS = ""
58 then a blank line terminates a record, and newline
59 is a default field separator, along with
60 blank and tab.
61 
62 4. The syntax of split has been changed.
63 	n = split(str, arrayname, sep)
64 splits the string str into the array using
65 the separator sep (a single character).
66 If no sep field is given, FS is used instead.
67 The elements are array[1] ... array[n]; n
68 is the function value.
69 
70 5. some minor bugs have been fixed.
71 
72 IMPLEMENTATION NOTES:
73 
74 Things to watch out for when trying to make awk:
75 
76 1. The yacc -d business creates a new file y.tab.h
77 with the yacc #defines in it. this is compared to
78 awk.h on each successive compile, and major recompilation
79 is done only if the files differ. (This permits editing
80 the grammar file without causing everything in sight
81 to be recompiled, so long as the definitions don't
82 change.)
83 
84 2. The program proc.c is compiled into proc, which
85 is used to create proctab.c. proctab.c is the
86 table of function pointers used by run to actually
87 execute things. Don't try to load proc.c with the
88 other .c files; it also contains a "main()".
89 
90 3. Awk uses structure assignment. Be sure your
91 version of the C compiler has it.
92 
93 4. The loader flag -lm is used to fetch the standard
94 math library on the Research system. It is more likely
95 that you will want to use -lS on yours.
96 run.c also includes "math.h", which contains sensible
97 definitions for log(), sqrt(), etc. If you don't have this
98 include file, comment the line out, and all will be well
99 anyway.
100 
101 5. The basic sequence of events (in case make doesn't
102 seem to do the job) is
103 	yacc -d awk.g.y
104 	cc -O -c y.tab.c
105 	mv y.tab.o awk.g.o
106 	lex awk.lx.l
107 	cc -O -c lex.yy.c
108 	mv lex.yy.o awk.lx.o
109 	cc -O -c b.c
110 	cc -O -c main.c
111 	e - <tokenscript
112 	cc -O -c token.c
113 	cc -O -c tran.c
114 	cc -O -c lib.c
115 	cc -O -c run.c
116 	cc -O -c parse.c
117 	cc -O -c proc.c
118 	cc -o proc proc.c token.o
119 	proc >proctab.c
120 	cc -O -c proctab.c
121 	cc -i -O awk.g.o awk.lx.o b.o main.o token.o tran.o lib.o run.o parse.o proctab.o -lm
122