readme

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 代码 · 共 100 行

TXT
100
字号
CHANGES as of July 12:1. \ddd allowed in regular expressions.2. exit <expression> causes the expression toto be the status return upon completion.3. a new builtin called "getline" causes the nextinput line to be read immediately.  Fields, NR, etc.,are all set, but you are left at exactly the same placein the awk program.  Getline returns 0 for end of file;1 for a normal record.CHANGES SINCE MEMO:Update to TM of Sept 1, 1978:1. A new form of for loop	for (i in array)		statementis now available. It provides a way to walkalong the members of an array, most usefullyfor associative arrays with non-numeric subscripts.Elements are accessed in an unpredictable order,so don't count on anything.Futhermore, havoc ensues if elements are createdduring this operation, or if the index variableis fiddled.2. index(s1, s2) returns the position in s1where s2 first occurs, or 0 if it doesn't.3. Multi-line records are now supported moreconveniently. If the record separator is null	RS = ""then a blank line terminates a record, and newlineis a default field separator, along withblank and tab.4. The syntax of split has been changed.	n = split(str, arrayname, sep)splits the string str into the array usingthe separator sep (a single character).If no sep field is given, FS is used instead.The elements are array[1] ... array[n]; nis the function value.5. some minor bugs have been fixed.IMPLEMENTATION NOTES:Things to watch out for when trying to make awk:1. The yacc -d business creates a new file y.tab.hwith the yacc #defines in it. this is compared toawk.h on each successive compile, and major recompilationis done only if the files differ. (This permits editingthe grammar file without causing everything in sightto be recompiled, so long as the definitions don'tchange.)2. The program proc.c is compiled into proc, whichis used to create proctab.c. proctab.c is thetable of function pointers used by run to actuallyexecute things. Don't try to load proc.c with theother .c files; it also contains a "main()".3. Awk uses structure assignment. Be sure yourversion of the C compiler has it.4. The loader flag -lm is used to fetch the standardmath library on the Research system. It is more likelythat you will want to use -lS on yours.run.c also includes "math.h", which contains sensibledefinitions for log(), sqrt(), etc. If you don't have thisinclude file, comment the line out, and all will be wellanyway.5. The basic sequence of events (in case make doesn'tseem to do the job) is	yacc -d awk.g.y	cc -O -c y.tab.c	mv y.tab.o awk.g.o	lex awk.lx.l	cc -O -c lex.yy.c	mv lex.yy.o awk.lx.o	cc -O -c b.c	cc -O -c main.c	e - <tokenscript	cc -O -c token.c	cc -O -c tran.c	cc -O -c lib.c	cc -O -c run.c	cc -O -c parse.c	cc -O -c proc.c	cc -o proc proc.c token.o	proc >proctab.c	cc -O -c proctab.c	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

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?