Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
EXPLAIN | H A D | 14-Jun-2005 | 3.4 KiB | 110 | 92 | |
Makefile | H A D | 22-Jul-2012 | 2.7 KiB | 124 | 65 | |
README | H A D | 14-Jun-2005 | 3.7 KiB | 122 | 104 | |
awk.def | H A D | 21-Oct-2005 | 4.7 KiB | 178 | 155 | |
awk.g.y | H A D | 14-Jun-2005 | 7.3 KiB | 351 | 262 | |
awk.lx.l | H A D | 21-Oct-2005 | 6.3 KiB | 241 | 195 | |
awktype.h | H A D | 14-Jun-2005 | 1.2 KiB | 36 | 2 | |
b.c | H A D | 21-Oct-2005 | 23.6 KiB | 1,141 | 917 | |
lib.c | H A D | 06-Jan-2006 | 9.7 KiB | 437 | 325 | |
main.c | H A D | 21-Oct-2005 | 4 KiB | 164 | 110 | |
makeprctab.c | H A D | 19-Aug-2010 | 3.4 KiB | 125 | 90 | |
oawk.xcl | H A D | 14-Jun-2005 | 3.4 KiB | 201 | 179 | |
parse.c | H A D | 14-Jun-2005 | 3.4 KiB | 245 | 149 | |
run.c | H A D | 19-Aug-2010 | 18.7 KiB | 1,210 | 947 | |
token.c | H A D | 21-Oct-2005 | 2.4 KiB | 135 | 106 | |
tokenscript | H A D | 14-Jun-2005 | 151 | 13 | 12 | |
tran.c | H A D | 21-Oct-2005 | 8.2 KiB | 341 | 238 |
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