home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| NWiper Show (other/nWiperShow)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| ASCII text, with CR line terminators
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[CR]
| default (weak)
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 20 43 6f 70 79 72 69 | 67 68 74 20 31 39 39 31 |% Copyri|ght 1991|
|00000010| 20 62 79 20 4e 6f 72 6d | 61 6e 20 52 61 6d 73 65 | by Norm|an Ramse|
|00000020| 79 2e 20 20 41 6c 6c 20 | 72 69 67 68 74 73 20 72 |y. All |rights r|
|00000030| 65 73 65 72 76 65 64 2e | 0d 25 20 53 65 65 20 66 |eserved.|.% See f|
|00000040| 69 6c 65 20 43 4f 50 59 | 52 49 47 48 54 20 66 6f |ile COPY|RIGHT fo|
|00000050| 72 20 6d 6f 72 65 20 69 | 6e 66 6f 72 6d 61 74 69 |r more i|nformati|
|00000060| 6f 6e 2e 0d 40 20 0d 5c | 73 75 62 73 65 63 74 69 |on..@ .\|subsecti|
|00000070| 6f 6e 7b 54 61 6e 67 6c | 69 6e 67 20 61 20 73 69 |on{Tangl|ing a si|
|00000080| 6e 67 6c 65 20 66 69 6c | 65 7d 0d 41 20 63 68 65 |ngle fil|e}.A che|
|00000090| 61 70 20 69 6d 69 74 61 | 74 69 6f 6e 20 6f 66 20 |ap imita|tion of |
|000000a0| 74 61 6e 67 6c 65 2e 0d | 54 68 65 20 69 64 65 61 |tangle..|The idea|
|000000b0| 20 69 73 20 61 20 76 65 | 72 79 20 63 68 65 61 70 | is a ve|ry cheap|
|000000c0| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 20 | impleme|ntation |
|000000d0| 6f 66 20 74 61 6e 67 6c | 65 2e 0d 54 68 65 20 6d |of tangl|e..The m|
|000000e0| 61 72 6b 75 70 20 6f 66 | 20 74 68 65 20 66 69 6c |arkup of| the fil|
|000000f0| 65 20 69 73 20 64 65 73 | 63 72 69 62 65 64 20 69 |e is des|cribed i|
|00000100| 6e 20 66 69 6c 65 20 6d | 61 72 6b 75 70 2e 6f 77 |n file m|arkup.ow|
|00000110| 2e 0d 40 0d 54 68 65 20 | 73 74 72 75 63 74 75 72 |..@.The |structur|
|00000120| 65 20 6f 66 20 74 68 65 | 20 70 72 6f 67 72 61 6d |e of the| program|
|00000130| 20 69 73 20 61 73 20 66 | 6f 6c 6c 6f 77 73 3a 20 | is as f|ollows: |
|00000140| 66 69 72 73 74 20 77 65 | 20 61 63 63 75 6d 75 6c |first we| accumul|
|00000150| 61 74 65 20 61 6c 6c 20 | 6f 66 0d 74 68 65 20 6d |ate all |of.the m|
|00000160| 6f 64 75 6c 65 20 64 65 | 66 69 6e 69 74 69 6f 6e |odule de|finition|
|00000170| 73 2c 20 74 68 65 6e 20 | 77 65 20 77 72 69 74 65 |s, then |we write|
|00000180| 20 6f 75 74 20 74 68 65 | 20 64 65 66 69 6e 69 74 | out the| definit|
|00000190| 69 6f 6e 20 6f 66 20 74 | 68 65 0d 72 6f 6f 74 20 |ion of t|he.root |
|000001a0| 6d 6f 64 75 6c 65 20 28 | 6e 6f 72 6d 61 6c 6c 79 |module (|normally|
|000001b0| 20 5b 5b 22 2a 22 5d 5d | 29 2e 0d 54 68 65 20 6d | [["*"]]|)..The m|
|000001c0| 6f 64 75 6c 65 20 64 65 | 66 69 6e 69 74 69 6f 6e |odule de|finition|
|000001d0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 77 69 6c | informa|tion wil|
|000001e0| 6c 20 62 65 20 73 74 6f | 72 65 64 20 73 74 61 74 |l be sto|red stat|
|000001f0| 69 63 61 6c 6c 79 0d 69 | 6e 20 61 20 74 61 62 6c |ically.i|n a tabl|
|00000200| 65 20 73 75 70 70 6c 69 | 65 64 20 62 79 20 5b 5b |e suppli|ed by [[|
|00000210| 6d 6f 64 74 72 65 65 73 | 2e 68 5d 5d 3b 20 77 65 |modtrees|.h]]; we|
|00000220| 27 6c 6c 20 63 6f 76 65 | 72 20 74 68 65 0d 64 65 |'ll cove|r the.de|
|00000230| 74 61 69 6c 73 20 6c 61 | 74 65 72 2e 0d 3c 3c 68 |tails la|ter..<<h|
|00000240| 65 61 64 65 72 3e 3e 3d | 0d 76 6f 69 64 20 6e 6f |eader>>=|.void no|
|00000250| 74 61 6e 67 6c 65 20 28 | 46 49 4c 45 2a 20 69 6e |tangle (|FILE* in|
|00000260| 2c 20 46 49 4c 45 20 2a | 6f 75 74 2c 20 63 68 61 |, FILE *|out, cha|
|00000270| 72 20 2a 72 6f 6f 74 6e | 61 6d 65 2c 20 63 68 61 |r *rootn|ame, cha|
|00000280| 72 20 2a 6c 6f 63 66 6f | 72 6d 61 74 29 3b 0d 3c |r *locfo|rmat);.<|
|00000290| 3c 2a 3e 3e 3d 0d 23 64 | 65 66 69 6e 65 20 4d 41 |<*>>=.#d|efine MA|
|000002a0| 58 5f 4d 4f 44 4e 41 4d | 45 20 32 35 35 0d 40 0d |X_MODNAM|E 255.@.|
|000002b0| 3c 3c 2a 3e 3e 3d 0d 23 | 69 6e 63 6c 75 64 65 20 |<<*>>=.#|include |
|000002c0| 3c 73 74 64 69 6f 2e 68 | 3e 0d 23 69 6e 63 6c 75 |<stdio.h|>.#inclu|
|000002d0| 64 65 20 3c 73 74 72 69 | 6e 67 2e 68 3e 0d 23 69 |de <stri|ng.h>.#i|
|000002e0| 6e 63 6c 75 64 65 20 3c | 73 74 64 6c 69 62 2e 68 |nclude <|stdlib.h|
|000002f0| 3e 0d 23 69 6e 63 6c 75 | 64 65 20 3c 63 74 79 70 |>.#inclu|de <ctyp|
|00000300| 65 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 22 73 |e.h>.#in|clude "s|
|00000310| 74 72 73 61 76 65 2e 68 | 22 0d 23 69 6e 63 6c 75 |trsave.h|".#inclu|
|00000320| 64 65 20 22 67 65 74 6c | 69 6e 65 2e 68 22 0d 23 |de "getl|ine.h".#|
|00000330| 69 6e 63 6c 75 64 65 20 | 22 6d 6f 64 75 6c 65 73 |include |"modules|
|00000340| 2e 68 22 0d 23 69 6e 63 | 6c 75 64 65 20 22 6d 6f |.h".#inc|lude "mo|
|00000350| 64 74 72 65 65 73 2e 68 | 22 0d 23 69 6e 63 6c 75 |dtrees.h|".#inclu|
|00000360| 64 65 20 22 65 72 72 6f | 72 73 2e 68 22 0d 23 69 |de "erro|rs.h".#i|
|00000370| 6e 63 6c 75 64 65 20 22 | 6d 61 74 63 68 2e 68 22 |nclude "|match.h"|
|00000380| 0d 23 69 6e 63 6c 75 64 | 65 20 22 6e 6f 74 61 6e |.#includ|e "notan|
|00000390| 67 6c 65 2e 68 22 0d 0d | 3c 3c 46 75 6e 63 74 69 |gle.h"..|<<Functi|
|000003a0| 6f 6e 20 64 65 63 6c 61 | 72 61 74 69 6f 6e 73 3e |on decla|rations>|
|000003b0| 3e 0d 0d 76 6f 69 64 20 | 6e 6f 74 61 6e 67 6c 65 |>..void |notangle|
|000003c0| 20 28 46 49 4c 45 2a 20 | 69 6e 2c 20 46 49 4c 45 | (FILE* |in, FILE|
|000003d0| 20 2a 6f 75 74 2c 20 63 | 68 61 72 20 2a 72 6f 6f | *out, c|har *roo|
|000003e0| 74 6e 61 6d 65 2c 20 63 | 68 61 72 20 2a 6c 6f 63 |tname, c|har *loc|
|000003f0| 66 6f 72 6d 61 74 29 20 | 7b 0d 20 20 20 20 4d 6f |format) |{. Mo|
|00000400| 64 75 6c 65 20 72 6f 6f | 74 20 3d 20 4e 55 4c 4c |dule roo|t = NULL|
|00000410| 3b 20 2f 2a 20 70 74 72 | 20 74 6f 20 72 6f 6f 74 |; /* ptr| to root|
|00000420| 20 6d 6f 64 75 6c 65 20 | 2a 2f 0d 0d 20 20 20 20 | module |*/.. |
|00000430| 72 65 61 64 5f 64 65 66 | 73 28 69 6e 29 3b 20 20 |read_def|s(in); |
|00000440| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 72 | | /* r|
|00000450| 65 61 64 20 61 6c 6c 20 | 74 68 65 20 64 65 66 69 |ead all |the defi|
|00000460| 6e 69 74 69 6f 6e 73 20 | 2a 2f 0d 0d 20 20 20 20 |nitions |*/.. |
|00000470| 61 70 70 6c 79 5f 65 61 | 63 68 5f 6d 6f 64 75 6c |apply_ea|ch_modul|
|00000480| 65 28 72 65 6d 6f 76 65 | 5f 66 69 6e 61 6c 5f 6e |e(remove|_final_n|
|00000490| 65 77 6c 69 6e 65 29 3b | 0d 20 20 20 20 20 20 20 |ewline);|. |
|000004a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000004b0| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 70 72 65 74 | | /* pret|
|000004c0| 74 79 20 75 70 20 74 68 | 65 20 6d 6f 64 75 6c 65 |ty up th|e module|
|000004d0| 20 74 65 78 74 73 20 2a | 2f 0d 0d 20 20 20 20 72 | texts *|/.. r|
|000004e0| 6f 6f 74 20 3d 20 6c 6f | 6f 6b 75 70 28 72 6f 6f |oot = lo|okup(roo|
|000004f0| 74 6e 61 6d 65 29 3b 0d | 20 20 20 20 3c 3c 71 75 |tname);.| <<qu|
|00000500| 69 74 20 69 66 20 77 65 | 20 63 6f 75 6c 64 6e 27 |it if we| couldn'|
|00000510| 74 20 66 69 6e 64 20 74 | 68 65 20 72 6f 6f 74 3e |t find t|he root>|
|00000520| 3e 0d 20 20 20 20 28 76 | 6f 69 64 29 20 65 78 70 |>. (v|oid) exp|
|00000530| 61 6e 64 28 72 6f 6f 74 | 2c 30 2c 30 2c 30 2c 6c |and(root|,0,0,0,l|
|00000540| 6f 63 66 6f 72 6d 61 74 | 2c 6f 75 74 29 3b 0d 20 |ocformat|,out);. |
|00000550| 20 20 20 70 75 74 63 28 | 27 5c 6e 27 2c 6f 75 74 | putc(|'\n',out|
|00000560| 29 3b 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |); | |
|00000570| 20 20 20 20 20 20 20 2f | 2a 20 6d 61 6b 65 20 6f | /|* make o|
|00000580| 75 74 70 75 74 20 65 6e | 64 20 77 69 74 68 20 6e |utput en|d with n|
|00000590| 65 77 6c 69 6e 65 20 2a | 2f 0d 7d 0d 40 20 25 64 |ewline *|/.}.@ %d|
|000005a0| 65 66 20 6e 6f 74 61 6e | 67 6c 65 0d 0d 57 65 20 |ef notan|gle..We |
|000005b0| 6c 6f 6f 70 20 6c 6f 6f | 6b 69 6e 67 20 66 6f 72 |loop loo|king for|
|000005c0| 20 74 68 65 20 73 74 61 | 72 74 20 6f 66 20 61 20 | the sta|rt of a |
|000005d0| 63 6f 64 65 20 63 68 75 | 6e 6b 2e 0d 57 68 65 6e |code chu|nk..When|
|000005e0| 20 77 65 20 66 69 6e 64 | 20 6f 6e 65 2c 20 77 65 | we find| one, we|
|000005f0| 20 67 65 74 20 74 68 65 | 20 6e 61 6d 65 20 6f 66 | get the| name of|
|00000600| 20 74 68 65 20 6d 6f 64 | 75 6c 65 20 69 6e 20 77 | the mod|ule in w|
|00000610| 68 69 63 68 20 74 68 65 | 20 63 6f 64 65 0d 69 73 |hich the| code.is|
|00000620| 20 74 6f 20 61 70 70 65 | 61 72 2e 20 20 0d 54 68 | to appe|ar. .Th|
|00000630| 65 6e 20 77 65 20 6a 75 | 73 74 20 6b 65 65 70 20 |en we ju|st keep |
|00000640| 61 64 64 69 6e 67 20 6c | 69 6e 65 73 20 74 6f 20 |adding l|ines to |
|00000650| 74 68 61 74 20 6d 6f 64 | 75 6c 65 20 75 6e 74 69 |that mod|ule unti|
|00000660| 6c 0d 77 65 20 73 65 65 | 20 61 20 74 65 72 6d 69 |l.we see| a termi|
|00000670| 6e 61 74 6f 72 2e 0d 41 | 66 74 65 72 20 77 65 20 |nator..A|fter we |
|00000680| 73 65 65 20 74 68 65 20 | 74 65 72 6d 69 6e 61 74 |see the |terminat|
|00000690| 6f 72 20 77 65 20 73 74 | 61 72 74 20 61 6c 6c 20 |or we st|art all |
|000006a0| 6f 76 65 72 20 61 67 61 | 69 6e 20 6c 6f 6f 6b 69 |over aga|in looki|
|000006b0| 6e 67 20 66 6f 72 20 61 | 6e 6f 74 68 65 72 20 63 |ng for a|nother c|
|000006c0| 6f 64 65 0d 63 68 75 6e | 6b 2e 0d 3c 3c 68 65 61 |ode.chun|k..<<hea|
|000006d0| 64 65 72 3e 3e 3d 0d 76 | 6f 69 64 20 72 65 61 64 |der>>=.v|oid read|
|000006e0| 5f 64 65 66 73 28 46 49 | 4c 45 20 2a 69 6e 29 3b |_defs(FI|LE *in);|
|000006f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|00000700| 20 72 65 61 64 20 6d 6f | 64 75 6c 65 20 64 65 66 | read mo|dule def|
|00000710| 69 6e 69 74 69 6f 6e 73 | 20 2a 2f 0d 3c 3c 2a 3e |initions| */.<<*>|
|00000720| 3e 3d 0d 76 6f 69 64 20 | 72 65 61 64 5f 64 65 66 |>=.void |read_def|
|00000730| 73 28 46 49 4c 45 20 2a | 69 6e 29 20 7b 0d 20 20 |s(FILE *|in) {. |
|00000740| 20 20 63 68 61 72 20 6d | 6f 64 6e 61 6d 65 5b 4d | char m|odname[M|
|00000750| 41 58 5f 4d 4f 44 4e 41 | 4d 45 2b 31 5d 20 3d 20 |AX_MODNA|ME+1] = |
|00000760| 22 22 3b 20 2f 2a 20 6e | 61 6d 65 20 6f 66 20 6d |""; /* n|ame of m|
|00000770| 6f 64 75 6c 65 20 63 75 | 72 72 65 6e 74 6c 79 20 |odule cu|rrently |
|00000780| 62 65 69 6e 67 20 72 65 | 61 64 2c 20 0d 20 20 20 |being re|ad, . |
|00000790| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000007a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000007b0| 20 20 20 20 20 20 5b 5b | 22 22 5d 5d 20 69 66 20 | [[|""]] if |
|000007c0| 6e 6f 20 6d 6f 64 75 6c | 65 20 69 73 20 62 65 69 |no modul|e is bei|
|000007d0| 6e 67 20 72 65 61 64 20 | 2a 2f 20 0d 20 20 20 20 |ng read |*/ . |
|000007e0| 4d 6f 64 75 6c 65 20 6d | 6f 64 70 74 72 20 3d 20 |Module m|odptr = |
|000007f0| 4e 55 4c 4c 3b 20 20 20 | 20 20 20 20 2f 2a 20 70 |NULL; | /* p|
|00000800| 74 72 20 74 6f 20 63 75 | 72 72 65 6e 74 20 6d 6f |tr to cu|rrent mo|
|00000810| 64 75 6c 65 2c 20 6f 72 | 20 4e 55 4c 4c 20 2a 2f |dule, or| NULL */|
|00000820| 0d 20 20 20 20 63 68 61 | 72 20 2a 6c 69 6e 65 20 |. cha|r *line |
|00000830| 3d 20 4e 55 4c 4c 3b 20 | 20 20 20 20 20 20 20 20 |= NULL; | |
|00000840| 20 2f 2a 20 62 75 66 66 | 65 72 20 66 6f 72 20 69 | /* buff|er for i|
|00000850| 6e 70 75 74 20 2a 2f 0d | 20 20 20 20 4c 6f 63 61 |nput */.| Loca|
|00000860| 74 69 6f 6e 20 6c 6f 63 | 3b 0d 0d 20 20 20 20 77 |tion loc|;.. w|
|00000870| 68 69 6c 65 20 28 28 6c | 69 6e 65 20 3d 20 67 65 |hile ((l|ine = ge|
|00000880| 74 6c 69 6e 65 28 69 6e | 29 29 20 21 3d 20 4e 55 |tline(in|)) != NU|
|00000890| 4c 4c 29 20 7b 0d 09 3c | 3c 74 72 61 63 6b 20 6c |LL) {..<|<track l|
|000008a0| 69 6e 65 20 6e 75 6d 62 | 65 72 73 2c 20 74 68 65 |ine numb|ers, the|
|000008b0| 6e 20 5b 5b 63 6f 6e 74 | 69 6e 75 65 5d 5d 20 75 |n [[cont|inue]] u|
|000008c0| 6e 6c 65 73 73 20 5b 5b | 6c 69 6e 65 5d 5d 20 69 |nless [[|line]] i|
|000008d0| 73 20 5b 5b 40 62 65 67 | 69 6e 20 63 6f 64 65 5d |s [[@beg|in code]|
|000008e0| 5d 3e 3e 0d 20 20 20 20 | 20 20 20 20 3c 3c 72 65 |]>>. | <<re|
|000008f0| 70 65 61 74 20 5b 5b 6c | 69 6e 65 20 3d 20 67 65 |peat [[l|ine = ge|
|00000900| 74 6c 69 6e 65 28 69 6e | 29 3b 5d 5d 20 75 6e 74 |tline(in|);]] unt|
|00000910| 69 6c 20 45 4f 46 2c 20 | 5b 5b 40 64 65 66 6e 5d |il EOF, |[[@defn]|
|00000920| 5d 2c 20 6f 72 20 5b 5b | 40 74 65 78 74 5d 5d 3e |], or [[|@text]]>|
|00000930| 3e 0d 09 69 6e 73 69 73 | 74 28 6c 69 6e 65 2c 22 |>..insis|t(line,"|
|00000940| 64 65 66 6e 22 2c 22 63 | 6f 64 65 20 63 68 75 6e |defn","c|ode chun|
|00000950| 6b 20 68 61 64 20 6e 6f | 20 64 65 66 69 6e 69 74 |k had no| definit|
|00000960| 69 6f 6e 20 6c 69 6e 65 | 22 29 3b 0d 20 20 20 20 |ion line|");. |
|00000970| 20 20 20 20 3c 3c 63 6f | 70 79 20 6d 6f 64 75 6c | <<co|py modul|
|00000980| 65 20 6e 61 6d 65 20 69 | 6e 74 6f 20 5b 5b 6d 6f |e name i|nto [[mo|
|00000990| 64 6e 61 6d 65 5d 5d 3e | 3e 0d 20 20 20 20 20 20 |dname]]>|>. |
|000009a0| 20 20 77 61 72 6e 5f 64 | 6f 74 73 28 6d 6f 64 6e | warn_d|ots(modn|
|000009b0| 61 6d 65 29 3b 20 20 20 | 20 20 20 20 2f 2a 20 6e |ame); | /* n|
|000009c0| 61 6d 65 73 20 65 6e 64 | 69 6e 67 20 69 6e 20 2e |ames end|ing in .|
|000009d0| 2e 2e 20 61 72 65 6e 27 | 74 20 6c 69 6b 65 20 77 |.. aren'|t like w|
|000009e0| 65 62 20 2a 2f 0d 20 20 | 20 20 20 20 20 20 6d 6f |eb */. | mo|
|000009f0| 64 70 74 72 20 3d 20 69 | 6e 73 65 72 74 28 6d 6f |dptr = i|nsert(mo|
|00000a00| 64 6e 61 6d 65 29 3b 20 | 2f 2a 20 66 69 6e 64 20 |dname); |/* find |
|00000a10| 6f 72 20 61 64 64 20 6d | 6f 64 75 6c 65 20 69 6e |or add m|odule in|
|00000a20| 20 74 61 62 6c 65 20 2a | 2f 0d 0d 09 6c 69 6e 65 | table *|/...line|
|00000a30| 20 3d 20 67 65 74 6c 69 | 6e 65 28 69 6e 29 3b 0d | = getli|ne(in);.|
|00000a40| 09 69 6e 73 69 73 74 28 | 6c 69 6e 65 2c 22 6e 6c |.insist(|line,"nl|
|00000a50| 22 2c 22 64 65 66 69 6e | 69 74 69 6f 6e 20 6c 69 |","defin|ition li|
|00000a60| 6e 65 20 6e 6f 74 20 66 | 6f 6c 6c 6f 77 65 64 20 |ne not f|ollowed |
|00000a70| 62 79 20 6e 65 77 6c 69 | 6e 65 22 29 3b 0d 09 6c |by newli|ne");..l|
|00000a80| 6f 63 2e 6c 69 6e 65 6e | 6f 2b 2b 3b 0d 20 20 20 |oc.linen|o++;. |
|00000a90| 20 20 20 20 20 6c 69 6e | 65 20 3d 20 67 65 74 6c | lin|e = getl|
|00000aa0| 69 6e 65 28 69 6e 29 3b | 0d 20 20 20 20 20 20 20 |ine(in);|. |
|00000ab0| 20 77 68 69 6c 65 20 28 | 6c 69 6e 65 20 21 3d 20 | while (|line != |
|00000ac0| 4e 55 4c 4c 20 26 26 20 | 21 69 73 5f 65 6e 64 28 |NULL && |!is_end(|
|00000ad0| 6c 69 6e 65 2c 22 63 6f | 64 65 22 29 29 20 7b 0d |line,"co|de")) {.|
|00000ae0| 09 20 20 20 20 69 66 20 | 28 69 73 5f 6b 65 79 77 |. if |(is_keyw|
|00000af0| 6f 72 64 28 6c 69 6e 65 | 2c 22 6e 6c 22 29 29 20 |ord(line|,"nl")) |
|00000b00| 7b 0d 09 09 61 64 64 6e | 65 77 6c 69 6e 65 28 6d |{...addn|ewline(m|
|00000b10| 6f 64 70 74 72 29 3b 0d | 09 20 20 20 20 20 20 20 |odptr);.|. |
|00000b20| 20 6c 6f 63 2e 6c 69 6e | 65 6e 6f 2b 2b 3b 0d 09 | loc.lin|eno++;..|
|00000b30| 20 20 20 20 7d 20 65 6c | 73 65 20 69 66 20 28 69 | } el|se if (i|
|00000b40| 73 5f 6b 65 79 77 6f 72 | 64 28 6c 69 6e 65 2c 22 |s_keywor|d(line,"|
|00000b50| 74 65 78 74 22 29 29 20 | 7b 0d 09 09 61 64 64 73 |text")) |{...adds|
|00000b60| 74 72 69 6e 67 28 6d 6f | 64 70 74 72 2c 6c 69 6e |tring(mo|dptr,lin|
|00000b70| 65 2b 31 2b 34 2b 31 2c | 6c 6f 63 29 3b 0d 09 20 |e+1+4+1,|loc);.. |
|00000b80| 20 20 20 7d 20 65 6c 73 | 65 20 69 66 20 28 69 73 | } els|e if (is|
|00000b90| 5f 6b 65 79 77 6f 72 64 | 28 6c 69 6e 65 2c 22 75 |_keyword|(line,"u|
|00000ba0| 73 65 22 29 29 20 7b 0d | 20 20 20 20 20 20 20 20 |se")) {.| |
|00000bb0| 20 20 20 20 20 20 20 20 | 77 61 72 6e 5f 64 6f 74 | |warn_dot|
|00000bc0| 73 28 6c 69 6e 65 2b 31 | 2b 33 2b 35 29 3b 0d 09 |s(line+1|+3+5);..|
|00000bd0| 09 61 64 64 6d 6f 64 75 | 6c 65 28 6d 6f 64 70 74 |.addmodu|le(modpt|
|00000be0| 72 2c 6c 69 6e 65 2b 31 | 2b 33 2b 31 29 3b 0d 20 |r,line+1|+3+1);. |
|00000bf0| 20 20 20 20 20 20 20 20 | 20 20 20 7d 20 65 6c 73 | | } els|
|00000c00| 65 20 69 66 20 28 69 73 | 5f 69 6e 64 65 78 28 6c |e if (is|_index(l|
|00000c10| 69 6e 65 2c 20 22 6e 6c | 22 29 29 20 7b 0d 09 20 |ine, "nl|")) {.. |
|00000c20| 20 20 20 20 20 20 20 6c | 6f 63 2e 6c 69 6e 65 6e | l|oc.linen|
|00000c30| 6f 2b 2b 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |o++;. | |
|00000c40| 20 3c 3c 5b 5b 7d 20 65 | 6c 73 65 20 69 66 20 28 | <<[[} e|lse if (|
|00000c50| 6c 69 6e 65 5d 5d 20 63 | 6f 6e 74 61 69 6e 73 20 |line]] c|ontains |
|00000c60| 5b 5b 40 66 69 6c 65 5d | 5d 20 6f 72 20 5b 5b 40 |[[@file]|] or [[@|
|00000c70| 6c 69 6e 65 29 20 7b 5d | 5d 20 61 64 6a 75 73 74 |line) {]|] adjust|
|00000c80| 20 5b 5b 6c 6f 63 5d 5d | 3e 3e 0d 09 20 20 20 20 | [[loc]]|>>.. |
|00000c90| 7d 20 65 6c 73 65 20 69 | 66 20 28 21 69 73 5f 6b |} else i|f (!is_k|
|00000ca0| 65 79 77 6f 72 64 28 6c | 69 6e 65 2c 20 22 69 6e |eyword(l|ine, "in|
|00000cb0| 64 65 78 22 29 29 0d 20 | 20 20 20 20 20 20 20 20 |dex")). | |
|00000cc0| 20 20 20 20 20 20 20 3c | 3c 63 6f 6d 70 6c 61 69 | <|<complai|
|00000cd0| 6e 20 6f 66 20 62 6f 74 | 63 68 65 64 20 63 6f 64 |n of bot|ched cod|
|00000ce0| 65 20 63 68 75 6e 6b 3e | 3e 0d 20 20 20 20 20 20 |e chunk>|>. |
|00000cf0| 20 20 20 20 20 20 6c 69 | 6e 65 20 3d 20 67 65 74 | li|ne = get|
|00000d00| 6c 69 6e 65 28 69 6e 29 | 3b 0d 20 20 20 20 20 20 |line(in)|;. |
|00000d10| 20 20 7d 0d 20 20 20 20 | 20 20 20 20 3c 3c 69 66 | }. | <<if|
|00000d20| 20 5b 5b 6c 69 6e 65 3d | 3d 4e 55 4c 4c 5d 5d 20 | [[line=|=NULL]] |
|00000d30| 64 69 65 20 6f 66 20 70 | 72 65 6d 61 74 75 72 65 |die of p|remature|
|00000d40| 20 65 6e 64 20 6f 66 20 | 66 69 6c 65 3e 3e 0d 20 | end of |file>>. |
|00000d50| 20 20 20 7d 0d 7d 0d 40 | 20 25 64 65 66 20 72 65 | }.}.@| %def re|
|00000d60| 61 64 5f 64 65 66 73 0d | 3c 3c 72 65 70 65 61 74 |ad_defs.|<<repeat|
|00000d70| 20 5b 5b 6c 69 6e 65 20 | 3d 20 67 65 74 6c 69 6e | [[line |= getlin|
|00000d80| 65 28 69 6e 29 3b 5d 5d | 20 75 6e 74 69 6c 20 45 |e(in);]]| until E|
|00000d90| 4f 46 2c 20 5b 5b 40 64 | 65 66 6e 5d 5d 2c 20 6f |OF, [[@d|efn]], o|
|00000da0| 72 20 5b 5b 40 74 65 78 | 74 5d 5d 3e 3e 3d 0d 64 |r [[@tex|t]]>>=.d|
|00000db0| 6f 20 7b 20 6c 69 6e 65 | 20 3d 20 67 65 74 6c 69 |o { line| = getli|
|00000dc0| 6e 65 28 69 6e 29 3b 0d | 7d 20 77 68 69 6c 65 20 |ne(in);.|} while |
|00000dd0| 28 6c 69 6e 65 20 21 3d | 20 4e 55 4c 4c 20 26 26 |(line !=| NULL &&|
|00000de0| 20 21 69 73 5f 6b 65 79 | 77 6f 72 64 28 6c 69 6e | !is_key|word(lin|
|00000df0| 65 2c 22 64 65 66 6e 22 | 29 20 26 26 20 21 69 73 |e,"defn"|) && !is|
|00000e00| 5f 6b 65 79 77 6f 72 64 | 28 6c 69 6e 65 2c 22 74 |_keyword|(line,"t|
|00000e10| 65 78 74 22 29 29 3b 0d | 40 0d 3c 3c 74 72 61 63 |ext"));.|@.<<trac|
|00000e20| 6b 20 6c 69 6e 65 20 6e | 75 6d 62 65 72 73 2c 20 |k line n|umbers, |
|00000e30| 74 68 65 6e 20 5b 5b 63 | 6f 6e 74 69 6e 75 65 5d |then [[c|ontinue]|
|00000e40| 5d 20 75 6e 6c 65 73 73 | 20 5b 5b 6c 69 6e 65 5d |] unless| [[line]|
|00000e50| 5d 20 69 73 20 5b 5b 40 | 62 65 67 69 6e 20 63 6f |] is [[@|begin co|
|00000e60| 64 65 5d 5d 3e 3e 3d 0d | 69 66 20 28 69 73 5f 6b |de]]>>=.|if (is_k|
|00000e70| 65 79 77 6f 72 64 28 6c | 69 6e 65 2c 20 22 6e 6c |eyword(l|ine, "nl|
|00000e80| 22 29 20 7c 7c 20 69 73 | 5f 69 6e 64 65 78 28 6c |") || is|_index(l|
|00000e90| 69 6e 65 2c 20 22 6e 6c | 22 29 29 20 7b 0d 20 20 |ine, "nl|")) {. |
|00000ea0| 20 20 6c 6f 63 2e 6c 69 | 6e 65 6e 6f 2b 2b 3b 0d | loc.li|neno++;.|
|00000eb0| 3c 3c 5b 5b 7d 20 65 6c | 73 65 20 69 66 20 28 6c |<<[[} el|se if (l|
|00000ec0| 69 6e 65 5d 5d 20 63 6f | 6e 74 61 69 6e 73 20 5b |ine]] co|ntains [|
|00000ed0| 5b 40 66 69 6c 65 5d 5d | 20 6f 72 20 5b 5b 40 6c |[@file]]| or [[@l|
|00000ee0| 69 6e 65 29 20 7b 5d 5d | 20 61 64 6a 75 73 74 20 |ine) {]]| adjust |
|00000ef0| 5b 5b 6c 6f 63 5d 5d 3e | 3e 0d 7d 20 0d 69 66 20 |[[loc]]>|>.} .if |
|00000f00| 28 21 69 73 5f 62 65 67 | 69 6e 28 6c 69 6e 65 2c |(!is_beg|in(line,|
|00000f10| 20 22 63 6f 64 65 22 29 | 29 0d 20 20 20 20 63 6f | "code")|). co|
|00000f20| 6e 74 69 6e 75 65 3b 0d | 40 0d 54 68 65 20 6f 6e |ntinue;.|@.The on|
|00000f30| 6c 79 20 74 72 69 63 6b | 79 20 62 69 74 20 77 69 |ly trick|y bit wi|
|00000f40| 74 68 20 74 68 65 20 6c | 69 6e 65 20 6e 75 6d 62 |th the l|ine numb|
|00000f50| 65 72 73 20 69 73 20 74 | 6f 20 6e 6f 74 65 20 74 |ers is t|o note t|
|00000f60| 68 61 74 20 5b 5b 40 6c | 69 6e 65 5d 5d 20 67 69 |hat [[@l|ine]] gi|
|00000f70| 76 65 73 0d 74 68 65 20 | 6c 69 6e 65 20 6e 75 6d |ves.the |line num|
|00000f80| 62 65 72 20 6f 66 20 74 | 68 65 20 7b 5c 65 6d 20 |ber of t|he {\em |
|00000f90| 66 6f 6c 6c 6f 77 69 6e | 67 7d 20 6c 69 6e 65 2c |followin|g} line,|
|00000fa0| 20 6e 6f 74 20 6f 66 20 | 74 68 65 20 6c 69 6e 65 | not of |the line|
|00000fb0| 20 6f 6e 20 77 68 69 63 | 68 20 74 68 65 0d 5b 5b | on whic|h the.[[|
|00000fc0| 40 6c 69 6e 65 5d 5d 20 | 61 70 70 65 61 72 73 2e |@line]] |appears.|
|00000fd0| 20 20 54 68 61 74 20 6d | 65 61 6e 73 20 5b 5b 6c | That m|eans [[l|
|00000fe0| 6f 63 2e 6c 69 6e 65 6e | 6f 5d 5d 20 6d 75 73 74 |oc.linen|o]] must|
|00000ff0| 20 62 65 20 64 65 63 72 | 65 6d 65 6e 74 65 64 20 | be decr|emented |
|00001000| 61 66 74 65 72 20 69 74 | 20 69 73 20 0d 73 65 74 |after it| is .set|
|00001010| 2c 20 73 6f 20 74 68 61 | 74 20 74 68 65 20 6e 65 |, so tha|t the ne|
|00001020| 78 74 20 6e 65 77 6c 69 | 6e 65 20 77 69 6c 6c 20 |xt newli|ne will |
|00001030| 69 6e 63 72 65 6d 65 6e | 74 20 69 74 20 74 6f 20 |incremen|t it to |
|00001040| 74 68 65 20 63 6f 72 72 | 65 63 74 20 76 61 6c 75 |the corr|ect valu|
|00001050| 65 2e 0d 3c 3c 5b 5b 7d | 20 65 6c 73 65 20 69 66 |e..<<[[}| else if|
|00001060| 20 28 6c 69 6e 65 5d 5d | 20 63 6f 6e 74 61 69 6e | (line]]| contain|
|00001070| 73 20 5b 5b 40 66 69 6c | 65 5d 5d 20 6f 72 20 5b |s [[@fil|e]] or [|
|00001080| 5b 40 6c 69 6e 65 29 20 | 7b 5d 5d 20 61 64 6a 75 |[@line) |{]] adju|
|00001090| 73 74 20 5b 5b 6c 6f 63 | 5d 5d 3e 3e 3d 0d 7d 20 |st [[loc|]]>>=.} |
|000010a0| 65 6c 73 65 20 69 66 20 | 28 69 73 5f 6b 65 79 77 |else if |(is_keyw|
|000010b0| 6f 72 64 28 6c 69 6e 65 | 2c 22 66 69 6c 65 22 29 |ord(line|,"file")|
|000010c0| 29 20 7b 0d 20 20 20 20 | 3c 3c 73 61 76 65 20 6e |) {. |<<save n|
|000010d0| 61 6d 65 20 66 72 6f 6d | 20 5b 5b 6c 69 6e 65 5d |ame from| [[line]|
|000010e0| 5d 20 28 5b 5b 40 66 69 | 6c 65 20 2e 2e 2e 5d 5d |] ([[@fi|le ...]]|
|000010f0| 29 20 69 6e 74 6f 20 5b | 5b 6c 6f 63 2e 66 69 6c |) into [|[loc.fil|
|00001100| 65 6e 61 6d 65 5d 5d 3e | 3e 0d 20 20 20 20 6c 6f |ename]]>|>. lo|
|00001110| 63 2e 6c 69 6e 65 6e 6f | 20 3d 20 31 3b 0d 7d 20 |c.lineno| = 1;.} |
|00001120| 65 6c 73 65 20 69 66 20 | 28 69 73 5f 6b 65 79 77 |else if |(is_keyw|
|00001130| 6f 72 64 28 6c 69 6e 65 | 2c 20 22 6c 69 6e 65 22 |ord(line|, "line"|
|00001140| 29 29 20 7b 0d 20 20 20 | 20 3c 3c 73 61 76 65 20 |)) {. | <<save |
|00001150| 6c 69 6e 65 20 6e 75 6d | 62 65 72 20 66 72 6f 6d |line num|ber from|
|00001160| 20 5b 5b 6c 69 6e 65 5d | 5d 20 28 5b 5b 40 6c 69 | [[line]|] ([[@li|
|00001170| 6e 65 20 2e 2e 2e 5d 5d | 29 20 69 6e 74 6f 20 5b |ne ...]]|) into [|
|00001180| 5b 6c 6f 63 2e 6c 69 6e | 65 6e 6f 5d 5d 3e 3e 0d |[loc.lin|eno]]>>.|
|00001190| 20 20 20 20 6c 6f 63 2e | 6c 69 6e 65 6e 6f 2d 2d | loc.|lineno--|
|000011a0| 3b 0d 40 0d 57 68 65 6e | 20 63 6f 70 79 69 6e 67 |;.@.When| copying|
|000011b0| 20 74 68 65 20 6d 6f 64 | 75 6c 65 20 6e 61 6d 65 | the mod|ule name|
|000011c0| 20 6f 72 20 61 20 66 69 | 6c 65 20 6e 61 6d 65 2c | or a fi|le name,|
|000011d0| 0d 77 65 20 68 61 76 65 | 20 74 6f 20 73 74 72 69 |.we have| to stri|
|000011e0| 70 20 74 68 65 20 74 72 | 61 69 6c 69 6e 67 20 6e |p the tr|ailing n|
|000011f0| 65 77 6c 69 6e 65 2e 0d | 3c 3c 63 6f 70 79 20 6d |ewline..|<<copy m|
|00001200| 6f 64 75 6c 65 20 6e 61 | 6d 65 20 69 6e 74 6f 20 |odule na|me into |
|00001210| 5b 5b 6d 6f 64 6e 61 6d | 65 5d 5d 3e 3e 3d 0d 73 |[[modnam|e]]>>=.s|
|00001220| 74 72 63 70 79 28 6d 6f | 64 6e 61 6d 65 2c 6c 69 |trcpy(mo|dname,li|
|00001230| 6e 65 2b 73 74 72 6c 65 | 6e 28 22 40 64 65 66 6e |ne+strle|n("@defn|
|00001240| 20 22 29 29 3b 0d 6d 6f | 64 6e 61 6d 65 5b 73 74 | "));.mo|dname[st|
|00001250| 72 6c 65 6e 28 6d 6f 64 | 6e 61 6d 65 29 2d 31 5d |rlen(mod|name)-1]|
|00001260| 3d 27 5c 30 27 3b 0d 3c | 3c 73 61 76 65 20 6e 61 |='\0';.<|<save na|
|00001270| 6d 65 20 66 72 6f 6d 20 | 5b 5b 6c 69 6e 65 5d 5d |me from |[[line]]|
|00001280| 20 28 5b 5b 40 66 69 6c | 65 20 2e 2e 2e 5d 5d 29 | ([[@fil|e ...]])|
|00001290| 20 69 6e 74 6f 20 5b 5b | 6c 6f 63 2e 66 69 6c 65 | into [[|loc.file|
|000012a0| 6e 61 6d 65 5d 5d 3e 3e | 3d 0d 7b 20 63 68 61 72 |name]]>>|=.{ char|
|000012b0| 20 74 65 6d 70 5b 4d 41 | 58 5f 4d 4f 44 4e 41 4d | temp[MA|X_MODNAM|
|000012c0| 45 2b 31 5d 3b 0d 20 20 | 69 66 20 28 73 74 72 6c |E+1];. |if (strl|
|000012d0| 65 6e 28 6c 69 6e 65 29 | 20 3e 3d 20 4d 41 58 5f |en(line)| >= MAX_|
|000012e0| 4d 4f 44 4e 41 4d 45 20 | 2b 20 73 74 72 6c 65 6e |MODNAME |+ strlen|
|000012f0| 28 22 40 66 69 6c 65 20 | 22 29 29 0d 20 20 20 20 |("@file |")). |
|00001300| 6f 76 65 72 66 6c 6f 77 | 28 22 66 69 6c 65 20 6e |overflow|("file n|
|00001310| 61 6d 65 20 73 69 7a 65 | 22 29 3b 0d 20 20 73 74 |ame size|");. st|
|00001320| 72 63 70 79 28 74 65 6d | 70 2c 6c 69 6e 65 2b 73 |rcpy(tem|p,line+s|
|00001330| 74 72 6c 65 6e 28 22 40 | 66 69 6c 65 20 22 29 29 |trlen("@|file "))|
|00001340| 3b 0d 20 20 74 65 6d 70 | 5b 73 74 72 6c 65 6e 28 |;. temp|[strlen(|
|00001350| 74 65 6d 70 29 2d 31 5d | 3d 27 5c 30 27 3b 0d 20 |temp)-1]|='\0';. |
|00001360| 20 6c 6f 63 2e 66 69 6c | 65 6e 61 6d 65 20 3d 20 | loc.fil|ename = |
|00001370| 73 74 72 73 61 76 65 28 | 74 65 6d 70 29 3b 0d 7d |strsave(|temp);.}|
|00001380| 0d 3c 3c 73 61 76 65 20 | 6c 69 6e 65 20 6e 75 6d |.<<save |line num|
|00001390| 62 65 72 20 66 72 6f 6d | 20 5b 5b 6c 69 6e 65 5d |ber from| [[line]|
|000013a0| 5d 20 28 5b 5b 40 6c 69 | 6e 65 20 2e 2e 2e 5d 5d |] ([[@li|ne ...]]|
|000013b0| 29 20 69 6e 74 6f 20 5b | 5b 6c 6f 63 2e 6c 69 6e |) into [|[loc.lin|
|000013c0| 65 6e 6f 5d 5d 3e 3e 3d | 0d 7b 20 63 68 61 72 20 |eno]]>>=|.{ char |
|000013d0| 74 65 6d 70 5b 4d 41 58 | 5f 4d 4f 44 4e 41 4d 45 |temp[MAX|_MODNAME|
|000013e0| 2b 31 5d 3b 0d 20 20 69 | 66 20 28 73 74 72 6c 65 |+1];. i|f (strle|
|000013f0| 6e 28 6c 69 6e 65 29 20 | 3e 3d 20 4d 41 58 5f 4d |n(line) |>= MAX_M|
|00001400| 4f 44 4e 41 4d 45 20 2b | 20 73 74 72 6c 65 6e 28 |ODNAME +| strlen(|
|00001410| 22 40 6c 69 6e 65 20 22 | 29 29 0d 20 20 20 20 6f |"@line "|)). o|
|00001420| 76 65 72 66 6c 6f 77 28 | 22 66 69 6c 65 20 6e 61 |verflow(|"file na|
|00001430| 6d 65 20 73 69 7a 65 22 | 29 3b 0d 20 20 73 74 72 |me size"|);. str|
|00001440| 63 70 79 28 74 65 6d 70 | 2c 6c 69 6e 65 2b 73 74 |cpy(temp|,line+st|
|00001450| 72 6c 65 6e 28 22 40 6c | 69 6e 65 20 22 29 29 3b |rlen("@l|ine "));|
|00001460| 0d 20 20 74 65 6d 70 5b | 73 74 72 6c 65 6e 28 74 |. temp[|strlen(t|
|00001470| 65 6d 70 29 2d 31 5d 3d | 27 5c 30 27 3b 0d 20 20 |emp)-1]=|'\0';. |
|00001480| 3c 3c 66 61 69 6c 20 69 | 66 20 73 74 72 69 6e 67 |<<fail i|f string|
|00001490| 20 5b 5b 74 65 6d 70 5d | 5d 20 63 6f 6e 74 61 69 | [[temp]|] contai|
|000014a0| 6e 73 20 61 20 6e 6f 6e | 2d 64 69 67 69 74 3e 3e |ns a non|-digit>>|
|000014b0| 0d 20 20 6c 6f 63 2e 6c | 69 6e 65 6e 6f 20 3d 20 |. loc.l|ineno = |
|000014c0| 61 74 6f 69 28 74 65 6d | 70 29 3b 0d 7d 0d 3c 3c |atoi(tem|p);.}.<<|
|000014d0| 66 61 69 6c 20 69 66 20 | 73 74 72 69 6e 67 20 5b |fail if |string [|
|000014e0| 5b 74 65 6d 70 5d 5d 20 | 63 6f 6e 74 61 69 6e 73 |[temp]] |contains|
|000014f0| 20 61 20 6e 6f 6e 2d 64 | 69 67 69 74 3e 3e 3d 0d | a non-d|igit>>=.|
|00001500| 7b 20 63 68 61 72 20 2a | 70 3b 0d 20 20 66 6f 72 |{ char *|p;. for|
|00001510| 20 28 70 20 3d 20 74 65 | 6d 70 3b 20 2a 70 3b 20 | (p = te|mp; *p; |
|00001520| 70 2b 2b 29 0d 20 20 20 | 20 69 66 20 28 21 69 73 |p++). | if (!is|
|00001530| 64 69 67 69 74 28 2a 70 | 29 29 20 0d 20 20 20 20 |digit(*p|)) . |
|00001540| 20 20 65 72 72 6f 72 6d | 73 67 28 45 72 72 6f 72 | errorm|sg(Error|
|00001550| 2c 20 22 6e 6f 6e 2d 6e | 75 6d 65 72 69 63 20 6c |, "non-n|umeric l|
|00001560| 69 6e 65 20 6e 75 6d 62 | 65 72 20 69 6e 20 60 40 |ine numb|er in `@|
|00001570| 6c 69 6e 65 20 25 73 27 | 22 2c 20 74 65 6d 70 29 |line %s'|", temp)|
|00001580| 3b 0d 7d 0d 40 0d 49 6e | 20 7b 5c 74 74 20 57 45 |;.}.@.In| {\tt WE|
|00001590| 42 7d 2c 20 6d 6f 64 75 | 6c 65 20 6e 61 6d 65 73 |B}, modu|le names|
|000015a0| 20 65 6e 64 69 6e 67 20 | 69 6e 20 60 60 2e 2e 2e | ending |in ``...|
|000015b0| 27 27 20 6d 61 79 20 62 | 65 20 70 72 65 66 69 78 |'' may b|e prefix|
|000015c0| 65 73 0d 66 6f 72 20 6f | 74 68 65 72 20 6e 61 6d |es.for o|ther nam|
|000015d0| 65 73 2e 0d 57 65 20 64 | 6f 6e 27 74 20 64 6f 20 |es..We d|on't do |
|000015e0| 61 6e 79 74 68 69 6e 67 | 20 6c 69 6b 65 20 74 68 |anything| like th|
|000015f0| 61 74 20 68 65 72 65 2c | 20 62 75 74 20 77 65 20 |at here,| but we |
|00001600| 64 6f 20 77 61 72 6e 20 | 74 68 65 20 75 73 65 72 |do warn |the user|
|00001610| 20 61 62 6f 75 74 0d 60 | 60 2e 2e 2e 27 27 20 69 | about.`|`...'' i|
|00001620| 6e 20 63 61 73 65 20 68 | 65 27 73 20 67 6f 74 20 |n case h|e's got |
|00001630| 61 20 66 69 6c 65 20 63 | 6f 6e 76 65 72 74 65 64 |a file c|onverted|
|00001640| 20 66 72 6f 6d 20 7b 5c | 74 74 20 57 45 42 7d 2e | from {\|tt WEB}.|
|00001650| 0d 3c 3c 2a 3e 3e 3d 0d | 73 74 61 74 69 63 0d 76 |.<<*>>=.|static.v|
|00001660| 6f 69 64 20 77 61 72 6e | 5f 64 6f 74 73 28 63 68 |oid warn|_dots(ch|
|00001670| 61 72 20 2a 6d 6f 64 6e | 61 6d 65 29 20 7b 0d 20 |ar *modn|ame) {. |
|00001680| 20 69 66 20 28 21 73 74 | 72 63 6d 70 28 6d 6f 64 | if (!st|rcmp(mod|
|00001690| 6e 61 6d 65 2b 73 74 72 | 6c 65 6e 28 6d 6f 64 6e |name+str|len(modn|
|000016a0| 61 6d 65 29 2d 33 2c 22 | 2e 2e 2e 22 29 29 20 0d |ame)-3,"|...")) .|
|000016b0| 20 20 20 20 65 72 72 6f | 72 6d 73 67 28 57 61 72 | erro|rmsg(War|
|000016c0| 6e 69 6e 67 2c 20 22 4d | 6f 64 75 6c 65 20 6e 61 |ning, "M|odule na|
|000016d0| 6d 65 20 40 3c 3c 25 73 | 40 3e 3e 20 69 73 6e 27 |me @<<%s|@>> isn'|
|000016e0| 74 20 63 6f 6d 70 6c 65 | 74 65 64 20 61 73 20 69 |t comple|ted as i|
|000016f0| 6e 20 77 65 62 22 2c 20 | 0d 20 20 20 20 20 20 20 |n web", |. |
|00001700| 20 20 20 20 20 20 6d 6f | 64 6e 61 6d 65 29 3b 0d | mo|dname);.|
|00001710| 7d 0d 40 20 25 64 65 66 | 20 77 61 72 6e 5f 64 6f |}.@ %def| warn_do|
|00001720| 74 73 0d 3c 3c 46 75 6e | 63 74 69 6f 6e 20 64 65 |ts.<<Fun|ction de|
|00001730| 63 6c 61 72 61 74 69 6f | 6e 73 3e 3e 3d 0d 73 74 |claratio|ns>>=.st|
|00001740| 61 74 69 63 20 76 6f 69 | 64 20 77 61 72 6e 5f 64 |atic voi|d warn_d|
|00001750| 6f 74 73 28 63 68 61 72 | 20 2a 6d 6f 64 6e 61 6d |ots(char| *modnam|
|00001760| 65 29 3b 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 |e); | /* |
|00001770| 77 61 72 6e 20 61 62 6f | 75 74 20 6e 61 6d 65 73 |warn abo|ut names|
|00001780| 20 65 6e 64 69 6e 67 20 | 69 6e 20 2e 2e 2e 20 2a | ending |in ... *|
|00001790| 2f 0d 0d 40 20 45 72 72 | 6f 72 20 63 68 65 63 6b |/..@ Err|or check|
|000017a0| 69 6e 67 20 69 73 20 70 | 65 72 65 6e 69 61 6c 6c |ing is p|ereniall|
|000017b0| 79 20 64 75 6c 6c 2e 0d | 3c 3c 71 75 69 74 20 69 |y dull..|<<quit i|
|000017c0| 66 20 77 65 20 63 6f 75 | 6c 64 6e 27 74 20 66 69 |f we cou|ldn't fi|
|000017d0| 6e 64 20 74 68 65 20 72 | 6f 6f 74 3e 3e 3d 0d 69 |nd the r|oot>>=.i|
|000017e0| 66 20 28 72 6f 6f 74 3d | 3d 4e 55 4c 4c 29 20 7b |f (root=|=NULL) {|
|000017f0| 0d 20 20 20 20 65 72 72 | 6f 72 6d 73 67 28 46 61 |. err|ormsg(Fa|
|00001800| 74 61 6c 2c 20 22 54 68 | 65 20 72 6f 6f 74 20 6d |tal, "Th|e root m|
|00001810| 6f 64 75 6c 65 20 40 3c | 3c 25 73 40 3e 3e 20 77 |odule @<|<%s@>> w|
|00001820| 61 73 20 6e 6f 74 20 64 | 65 66 69 6e 65 64 2e 22 |as not d|efined."|
|00001830| 2c 20 72 6f 6f 74 6e 61 | 6d 65 29 3b 0d 20 20 20 |, rootna|me);. |
|00001840| 20 72 65 74 75 72 6e 3b | 0d 7d 0d 3c 3c 2a 3e 3e | return;|.}.<<*>>|
|00001850| 3d 0d 76 6f 69 64 20 69 | 6e 73 69 73 74 28 63 68 |=.void i|nsist(ch|
|00001860| 61 72 20 2a 6c 69 6e 65 | 2c 20 63 68 61 72 20 2a |ar *line|, char *|
|00001870| 6b 65 79 77 6f 72 64 2c | 20 63 68 61 72 20 2a 6d |keyword,| char *m|
|00001880| 73 67 29 20 7b 0d 20 20 | 3c 3c 69 66 20 5b 5b 6c |sg) {. |<<if [[l|
|00001890| 69 6e 65 3d 3d 4e 55 4c | 4c 5d 5d 20 64 69 65 20 |ine==NUL|L]] die |
|000018a0| 6f 66 20 70 72 65 6d 61 | 74 75 72 65 20 65 6e 64 |of prema|ture end|
|000018b0| 20 6f 66 20 66 69 6c 65 | 3e 3e 0d 20 20 69 66 20 | of file|>>. if |
|000018c0| 28 21 69 73 5f 6b 65 79 | 77 6f 72 64 28 6c 69 6e |(!is_key|word(lin|
|000018d0| 65 2c 6b 65 79 77 6f 72 | 64 29 29 0d 20 20 20 20 |e,keywor|d)). |
|000018e0| 69 6d 70 6f 73 73 69 62 | 6c 65 28 6d 73 67 29 3b |impossib|le(msg);|
|000018f0| 0d 7d 0d 40 20 25 64 65 | 66 20 69 6e 73 69 73 74 |.}.@ %de|f insist|
|00001900| 0d 3c 3c 69 66 20 5b 5b | 6c 69 6e 65 3d 3d 4e 55 |.<<if [[|line==NU|
|00001910| 4c 4c 5d 5d 20 64 69 65 | 20 6f 66 20 70 72 65 6d |LL]] die| of prem|
|00001920| 61 74 75 72 65 20 65 6e | 64 20 6f 66 20 66 69 6c |ature en|d of fil|
|00001930| 65 3e 3e 3d 0d 69 66 20 | 28 6c 69 6e 65 3d 3d 4e |e>>=.if |(line==N|
|00001940| 55 4c 4c 29 20 7b 0d 20 | 20 20 20 69 6d 70 6f 73 |ULL) {. | impos|
|00001950| 73 69 62 6c 65 28 22 45 | 6e 64 20 6f 66 20 66 69 |sible("E|nd of fi|
|00001960| 6c 65 20 6f 63 63 75 72 | 72 65 64 20 69 6e 20 6d |le occur|red in m|
|00001970| 69 64 2d 6d 6f 64 75 6c | 65 22 29 3b 0d 7d 0d 3c |id-modul|e");.}.<|
|00001980| 3c 46 75 6e 63 74 69 6f | 6e 20 64 65 63 6c 61 72 |<Functio|n declar|
|00001990| 61 74 69 6f 6e 73 3e 3e | 3d 0d 76 6f 69 64 20 69 |ations>>|=.void i|
|000019a0| 6e 73 69 73 74 28 63 68 | 61 72 20 2a 6c 69 6e 65 |nsist(ch|ar *line|
|000019b0| 2c 20 63 68 61 72 20 2a | 6b 65 79 77 6f 72 64 2c |, char *|keyword,|
|000019c0| 20 63 68 61 72 20 2a 6d | 73 67 29 3b 0d 3c 3c 63 | char *m|sg);.<<c|
|000019d0| 6f 6d 70 6c 61 69 6e 20 | 6f 66 20 62 6f 74 63 68 |omplain |of botch|
|000019e0| 65 64 20 63 6f 64 65 20 | 63 68 75 6e 6b 3e 3e 3d |ed code |chunk>>=|
|000019f0| 0d 65 72 72 6f 72 61 74 | 28 6c 6f 63 2e 66 69 6c |.errorat|(loc.fil|
|00001a00| 65 6e 61 6d 65 2c 20 6c | 6f 63 2e 6c 69 6e 65 6e |ename, l|oc.linen|
|00001a10| 6f 2c 20 45 72 72 6f 72 | 2c 20 22 62 6f 74 63 68 |o, Error|, "botch|
|00001a20| 65 64 20 63 6f 64 65 20 | 63 68 75 6e 6b 20 60 25 |ed code |chunk `%|
|00001a30| 73 27 22 2c 20 6c 69 6e | 65 29 3b 0d |s'", lin|e);. |
+--------+-------------------------+-------------------------+--------+--------+