home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / SPIDER / DOC / CACM.TEX < prev    next >
LaTeX Document  |  1989-04-13  |  23.9 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Corel 10 Texture (image/corel10Texture) ext Unsupported
1% dexvert Croteam texture file (image/croteamTextureFile) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 64 6f 63 75 6d 65 6e | 74 73 74 79 6c 65 5b 31 |\documen|tstyle[1|
|00000010| 31 70 74 5d 7b 61 72 74 | 69 63 6c 65 7d 0a 5c 74 |1pt]{art|icle}.\t|
|00000020| 69 74 6c 65 7b 42 75 69 | 6c 64 69 6e 67 20 61 20 |itle{Bui|lding a |
|00000030| 4c 61 6e 67 75 61 67 65 | 2d 49 6e 64 65 70 65 6e |Language|-Indepen|
|00000040| 64 65 6e 74 20 7b 5c 74 | 74 20 57 45 42 7d 5c 74 |dent {\t|t WEB}\t|
|00000050| 68 61 6e 6b 73 7b 54 68 | 69 73 20 72 65 73 65 61 |hanks{Th|is resea|
|00000060| 72 63 68 0a 68 61 73 20 | 62 65 65 6e 20 73 70 6f |rch.has |been spo|
|00000070| 6e 73 6f 72 65 64 20 69 | 6e 20 70 61 72 74 20 62 |nsored i|n part b|
|00000080| 79 20 74 68 65 20 55 53 | 41 46 2c 20 52 6f 6d 65 |y the US|AF, Rome|
|00000090| 20 41 69 72 20 44 65 76 | 65 6c 6f 70 6d 65 6e 74 | Air Dev|elopment|
|000000a0| 20 43 65 6e 74 65 72 2c | 0a 75 6e 64 65 72 20 63 | Center,|.under c|
|000000b0| 6f 6e 74 72 61 63 74 20 | 6e 75 6d 62 65 72 20 46 |ontract |number F|
|000000c0| 33 30 36 30 32 2d 2d 38 | 36 2d 2d 43 2d 2d 30 30 |30602--8|6--C--00|
|000000d0| 37 31 2e 7d 7d 0a 25 5c | 61 75 74 68 6f 72 7b 4e |71.}}.%\|author{N|
|000000e0| 6f 72 6d 61 6e 20 52 61 | 6d 73 65 79 5c 5c 44 65 |orman Ra|msey\\De|
|000000f0| 70 61 72 74 6d 65 6e 74 | 20 6f 66 20 43 6f 6d 70 |partment| of Comp|
|00000100| 75 74 65 72 20 53 63 69 | 65 6e 63 65 5c 5c 50 72 |uter Sci|ence\\Pr|
|00000110| 69 6e 63 65 74 6f 6e 20 | 55 6e 69 76 65 72 73 69 |inceton |Universi|
|00000120| 74 79 7d 0a 5c 61 75 74 | 68 6f 72 7b 4e 6f 72 6d |ty}.\aut|hor{Norm|
|00000130| 61 6e 20 52 61 6d 73 65 | 79 5c 74 68 61 6e 6b 73 |an Ramse|y\thanks|
|00000140| 7b 43 75 72 72 65 6e 74 | 20 61 64 64 72 65 73 73 |{Current| address|
|00000150| 3a 20 44 65 70 61 72 74 | 6d 65 6e 74 20 6f 66 20 |: Depart|ment of |
|00000160| 43 6f 6d 70 75 74 65 72 | 0a 53 63 69 65 6e 63 65 |Computer|.Science|
|00000170| 2c 20 50 72 69 6e 63 65 | 74 6f 6e 20 55 6e 69 76 |, Prince|ton Univ|
|00000180| 65 72 73 69 74 79 2c 20 | 50 72 69 6e 63 65 74 6f |ersity, |Princeto|
|00000190| 6e 2c 20 4e 65 77 20 4a | 65 72 73 65 79 20 30 38 |n, New J|ersey 08|
|000001a0| 35 34 34 7d 25 0a 5c 5c | 4f 64 79 73 73 65 79 20 |544}%.\\|Odyssey |
|000001b0| 52 65 73 65 61 72 63 68 | 20 41 73 73 6f 63 69 61 |Research| Associa|
|000001c0| 74 65 73 7d 0a 0a 5c 6e | 65 77 63 6f 6d 6d 61 6e |tes}..\n|ewcomman|
|000001d0| 64 7b 5c 74 6f 6b 65 6e | 7d 7b 5c 63 73 74 6f 6b |d{\token|}{\cstok|
|000001e0| 7d 0a 5c 64 65 66 5c 73 | 69 7a 65 64 62 6f 78 69 |}.\def\s|izedboxi|
|000001f0| 74 23 31 23 32 7b 5c 76 | 74 6f 70 7b 5c 76 62 6f |t#1#2{\v|top{\vbo|
|00000200| 78 7b 5c 68 72 75 6c 65 | 5c 68 62 6f 78 7b 5c 76 |x{\hrule|\hbox{\v|
|00000210| 72 75 6c 65 5c 6b 65 72 | 6e 20 23 32 25 0a 20 20 |rule\ker|n #2%. |
|00000220| 20 20 5c 76 74 6f 70 7b | 5c 76 62 6f 78 7b 5c 6b | \vtop{|\vbox{\k|
|00000230| 65 72 6e 20 23 32 5c 68 | 62 6f 78 7b 23 31 7d 7d |ern #2\h|box{#1}}|
|00000240| 5c 6b 65 72 6e 20 23 32 | 7d 5c 6b 65 72 6e 20 23 |\kern #2|}\kern #|
|00000250| 32 5c 76 72 75 6c 65 7d | 7d 5c 68 72 75 6c 65 7d |2\vrule}|}\hrule}|
|00000260| 7d 0a 5c 64 65 66 5c 62 | 6f 78 69 74 23 31 7b 5c |}.\def\b|oxit#1{\|
|00000270| 73 69 7a 65 64 62 6f 78 | 69 74 7b 23 31 7d 7b 33 |sizedbox|it{#1}{3|
|00000280| 70 74 7d 7d 0a 5c 6e 65 | 77 63 6f 6d 6d 61 6e 64 |pt}}.\ne|wcommand|
|00000290| 7b 5c 72 65 6d 61 72 6b | 7d 7b 5c 6d 61 72 67 69 |{\remark|}{\margi|
|000002a0| 6e 70 61 72 7d 0a 5c 64 | 65 66 5c 72 65 6d 61 72 |npar}.\d|ef\remar|
|000002b0| 6b 23 31 7b 5c 6d 61 72 | 67 69 6e 70 61 72 7b 5c |k#1{\mar|ginpar{\|
|000002c0| 66 6f 6f 74 6e 6f 74 65 | 73 69 7a 65 5c 69 74 20 |footnote|size\it |
|000002d0| 23 31 7d 7d 0a 5c 64 65 | 66 5c 63 73 74 6f 6b 23 |#1}}.\de|f\cstok#|
|000002e0| 31 7b 5c 6c 65 61 76 65 | 76 6d 6f 64 65 5c 74 68 |1{\leave|vmode\th|
|000002f0| 69 6e 73 70 61 63 65 5c | 68 62 6f 78 7b 5c 76 72 |inspace\|hbox{\vr|
|00000300| 75 6c 65 5c 76 74 6f 70 | 7b 5c 76 62 6f 78 7b 5c |ule\vtop|{\vbox{\|
|00000310| 68 72 75 6c 65 5c 6b 65 | 72 6e 31 70 74 0a 20 20 |hrule\ke|rn1pt. |
|00000320| 20 20 20 20 20 20 5c 68 | 62 6f 78 7b 5c 76 70 68 | \h|box{\vph|
|00000330| 61 6e 74 6f 6d 7b 5c 74 | 74 2f 7d 5c 74 68 69 6e |antom{\t|t/}\thin|
|00000340| 73 70 61 63 65 7b 5c 74 | 74 23 31 7d 5c 74 68 69 |space{\t|t#1}\thi|
|00000350| 6e 73 70 61 63 65 7d 7d | 0a 20 20 20 20 20 20 5c |nspace}}|. \|
|00000360| 6b 65 72 6e 31 70 74 5c | 68 72 75 6c 65 7d 5c 76 |kern1pt\|hrule}\v|
|00000370| 72 75 6c 65 7d 5c 74 68 | 69 6e 73 70 61 63 65 7d |rule}\th|inspace}|
|00000380| 20 25 20 63 6f 6e 74 72 | 6f 6c 20 73 65 71 75 65 | % contr|ol seque|
|00000390| 6e 63 65 20 74 6f 6b 65 | 6e 0a 5c 64 65 66 5c 74 |nce toke|n.\def\t|
|000003a0| 74 6f 6b 23 31 7b 5c 6c | 65 61 76 65 76 6d 6f 64 |tok#1{\l|eavevmod|
|000003b0| 65 5c 74 68 69 6e 73 70 | 61 63 65 5c 68 62 6f 78 |e\thinsp|ace\hbox|
|000003c0| 7b 5c 76 72 75 6c 65 5c | 76 74 6f 70 7b 5c 76 62 |{\vrule\|vtop{\vb|
|000003d0| 6f 78 7b 5c 68 72 75 6c | 65 5c 6b 65 72 6e 31 70 |ox{\hrul|e\kern1p|
|000003e0| 74 0a 20 20 20 20 20 20 | 20 20 5c 68 62 6f 78 7b |t. | \hbox{|
|000003f0| 5c 76 70 68 61 6e 74 6f | 6d 7b 5c 74 74 28 6a 7d |\vphanto|m{\tt(j}|
|00000400| 5c 74 68 69 6e 73 70 61 | 63 65 7b 5c 74 74 23 31 |\thinspa|ce{\tt#1|
|00000410| 7d 5c 74 68 69 6e 73 70 | 61 63 65 7d 7d 0a 20 20 |}\thinsp|ace}}. |
|00000420| 20 20 20 20 5c 6b 65 72 | 6e 31 70 74 5c 68 72 75 | \ker|n1pt\hru|
|00000430| 6c 65 7d 5c 76 72 75 6c | 65 7d 5c 74 68 69 6e 73 |le}\vrul|e}\thins|
|00000440| 70 61 63 65 7d 20 25 20 | 74 6f 6b 65 6e 0a 5c 6e |pace} % |token.\n|
|00000450| 65 77 63 6f 6d 6d 61 6e | 64 7b 5c 58 7d 7b 7d 0a |ewcomman|d{\X}{}.|
|00000460| 5c 64 65 66 5c 58 3a 23 | 31 5c 58 7b 5c 6d 62 6f |\def\X:#|1\X{\mbo|
|00000470| 78 7b 24 5c 6c 61 6e 67 | 6c 65 24 7b 23 31 7d 24 |x{$\lang|le${#1}$|
|00000480| 5c 72 61 6e 67 6c 65 24 | 7d 7d 0a 0a 5c 62 65 67 |\rangle$|}}..\beg|
|00000490| 69 6e 7b 64 6f 63 75 6d | 65 6e 74 7d 0a 5c 6d 61 |in{docum|ent}.\ma|
|000004a0| 6b 65 74 69 74 6c 65 0a | 0a 49 6e 20 74 68 65 20 |ketitle.|.In the |
|000004b0| 66 61 6c 6c 20 6f 66 7e | 31 39 38 37 20 49 20 73 |fall of~|1987 I s|
|000004c0| 74 61 72 74 65 64 20 70 | 6c 61 6e 6e 69 6e 67 20 |tarted p|lanning |
|000004d0| 74 68 65 20 69 6d 70 6c | 65 6d 65 6e 74 61 74 69 |the impl|ementati|
|000004e0| 6f 6e 20 6f 66 20 61 20 | 0a 73 75 69 74 65 20 6f |on of a |.suite o|
|000004f0| 66 20 74 6f 6f 6c 73 20 | 66 6f 72 20 62 75 69 6c |f tools |for buil|
|00000500| 64 69 6e 67 20 76 65 72 | 69 66 69 65 64 20 41 64 |ding ver|ified Ad|
|00000510| 61 0a 70 72 6f 67 72 61 | 6d 73 7e 5c 63 69 74 65 |a.progra|ms~\cite|
|00000520| 7b 72 61 6d 73 65 79 3a | 64 65 76 65 6c 6f 70 69 |{ramsey:|developi|
|00000530| 6e 67 7d 2e 0a 54 68 65 | 20 66 69 72 73 74 20 74 |ng}..The| first t|
|00000540| 6f 6f 6c 20 74 6f 20 62 | 65 20 62 75 69 6c 74 20 |ool to b|e built |
|00000550| 77 61 73 20 61 0a 76 65 | 72 69 66 69 63 61 74 69 |was a.ve|rificati|
|00000560| 6f 6e 20 63 6f 6e 64 69 | 74 69 6f 6e 20 67 65 6e |on condi|tion gen|
|00000570| 65 72 61 74 6f 72 2c 20 | 77 68 69 63 68 20 77 61 |erator, |which wa|
|00000580| 73 20 74 6f 20 62 65 20 | 66 6f 72 6d 61 6c 6c 79 |s to be |formally|
|00000590| 20 64 65 66 69 6e 65 64 | 0a 75 73 69 6e 67 20 74 | defined|.using t|
|000005a0| 68 65 20 74 79 70 65 64 | 20 6c 61 6d 62 64 61 20 |he typed| lambda |
|000005b0| 63 61 6c 63 75 6c 75 73 | 2e 20 20 0a 49 20 77 61 |calculus|. .I wa|
|000005c0| 73 20 65 61 67 65 72 20 | 74 6f 20 69 6e 63 6c 75 |s eager |to inclu|
|000005d0| 64 65 20 74 68 65 20 64 | 65 66 69 6e 69 74 69 6f |de the d|efinitio|
|000005e0| 6e 20 77 69 74 68 20 74 | 68 65 20 63 6f 64 65 0a |n with t|he code.|
|000005f0| 73 6f 20 74 68 61 74 20 | 69 74 20 77 6f 75 6c 64 |so that |it would|
|00000600| 20 62 65 20 65 61 73 79 | 20 74 6f 20 63 68 65 63 | be easy| to chec|
|00000610| 6b 20 74 68 65 20 63 6f | 64 65 27 73 20 63 6f 72 |k the co|de's cor|
|00000620| 72 65 63 74 6e 65 73 73 | 2e 0a 55 73 69 6e 67 20 |rectness|..Using |
|00000630| 7b 5c 74 74 20 57 45 42 | 7d 20 77 6f 75 6c 64 20 |{\tt WEB|} would |
|00000640| 68 61 76 65 20 6d 61 64 | 65 20 74 68 69 73 20 65 |have mad|e this e|
|00000650| 61 73 79 2c 20 62 75 74 | 2c 0a 75 6e 66 6f 72 74 |asy, but|,.unfort|
|00000660| 75 6e 61 74 65 6c 79 2c | 20 74 68 65 20 74 61 72 |unately,| the tar|
|00000670| 67 65 74 20 70 72 6f 67 | 72 61 6d 6d 69 6e 67 20 |get prog|ramming |
|00000680| 6c 61 6e 67 75 61 67 65 | 20 77 61 73 20 0a 53 53 |language| was .SS|
|00000690| 4c 20 28 61 20 6c 61 6e | 67 75 61 67 65 20 66 6f |L (a lan|guage fo|
|000006a0| 72 20 73 70 65 63 69 66 | 79 69 6e 67 20 73 74 72 |r specif|ying str|
|000006b0| 75 63 74 75 72 65 20 65 | 64 69 74 6f 72 73 29 2c |ucture e|ditors),|
|000006c0| 20 61 6e 64 20 74 68 65 | 20 6f 6e 6c 79 0a 6c 61 | and the| only.la|
|000006d0| 6e 67 75 61 67 65 73 20 | 66 6f 72 20 77 68 69 63 |nguages |for whic|
|000006e0| 68 20 7b 5c 74 74 20 57 | 45 42 7d 20 69 6d 70 6c |h {\tt W|EB} impl|
|000006f0| 65 6d 65 6e 74 61 74 69 | 6f 6e 73 20 77 65 72 65 |ementati|ons were|
|00000700| 20 0a 61 76 61 69 6c 61 | 62 6c 65 20 77 65 72 65 | .availa|ble were|
|00000710| 20 20 50 61 73 63 61 6c | 20 61 6e 64 7e 43 2e 20 | Pascal| and~C. |
|00000720| 0a 0a 57 72 69 74 69 6e | 67 20 61 20 6e 65 77 20 |..Writin|g a new |
|00000730| 7b 5c 74 74 20 57 45 42 | 7d 20 66 72 6f 6d 20 73 |{\tt WEB|} from s|
|00000740| 63 72 61 74 63 68 20 64 | 69 64 6e 27 74 20 6d 61 |cratch d|idn't ma|
|00000750| 6b 65 20 73 65 6e 73 65 | 2c 20 73 6f 0a 49 20 64 |ke sense|, so.I d|
|00000760| 65 63 69 64 65 64 20 74 | 6f 20 6d 6f 64 69 66 79 |ecided t|o modify|
|00000770| 20 53 69 6c 76 69 6f 20 | 4c 65 76 79 27 73 20 69 | Silvio |Levy's i|
|00000780| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 20 6f 66 |mplement|ation of|
|00000790| 20 7b 5c 74 74 20 57 45 | 42 7d 0a 69 6e 7e 43 7e | {\tt WE|B}.in~C~|
|000007a0| 5c 63 69 74 65 7b 6c 65 | 76 79 3a 63 77 65 62 7d |\cite{le|vy:cweb}|
|000007b0| 2c 20 0a 74 6f 20 67 65 | 74 20 61 20 7b 5c 74 74 |, .to ge|t a {\tt|
|000007c0| 20 57 45 42 7d 20 74 68 | 61 74 20 77 6f 75 6c 64 | WEB} th|at would|
|000007d0| 20 62 65 20 77 72 69 74 | 74 65 6e 20 69 6e 20 43 | be writ|ten in C|
|000007e0| 2c 20 62 75 74 20 77 6f | 75 6c 64 20 72 65 61 64 |, but wo|uld read|
|000007f0| 20 61 6e 64 0a 77 72 69 | 74 65 20 53 53 4c 20 63 | and.wri|te SSL c|
|00000800| 6f 64 65 2e 0a 46 72 6f | 6d 20 6d 79 20 70 72 65 |ode..Fro|m my pre|
|00000810| 76 69 6f 75 73 20 65 78 | 70 65 72 69 65 6e 63 65 |vious ex|perience|
|00000820| 73 20 6d 6f 64 69 66 79 | 69 6e 67 20 7b 5c 74 74 |s modify|ing {\tt|
|00000830| 20 57 45 42 7d 2c 20 49 | 20 6b 6e 65 77 20 74 68 | WEB}, I| knew th|
|00000840| 61 74 20 74 68 65 0a 6d | 6f 73 74 20 74 69 6d 65 |at the.m|ost time|
|00000850| 2d 63 6f 6e 73 75 6d 69 | 6e 67 20 6a 6f 62 20 77 |-consumi|ng job w|
|00000860| 6f 75 6c 64 20 62 65 20 | 66 69 6e 65 2d 74 75 6e |ould be |fine-tun|
|00000870| 69 6e 67 20 74 68 65 20 | 67 72 61 6d 6d 61 72 20 |ing the |grammar |
|00000880| 74 68 61 74 20 20 7b 5c | 74 74 0a 57 45 41 56 45 |that {\|tt.WEAVE|
|00000890| 7d 20 75 73 65 73 20 74 | 6f 20 70 72 65 74 74 79 |} uses t|o pretty|
|000008a0| 70 72 69 6e 74 20 63 6f | 64 65 2e 0a 49 20 62 65 |print co|de..I be|
|000008b0| 6c 69 65 76 65 64 20 49 | 20 63 6f 75 6c 64 20 6d |lieved I| could m|
|000008c0| 61 6b 65 20 64 65 62 75 | 67 67 69 6e 67 20 74 68 |ake debu|gging th|
|000008d0| 61 74 20 67 72 61 6d 6d | 61 72 20 61 20 6c 6f 74 |at gramm|ar a lot|
|000008e0| 20 6c 65 73 73 20 70 61 | 69 6e 66 75 6c 0a 69 66 | less pa|inful.if|
|000008f0| 2c 20 69 6e 73 74 65 61 | 64 20 6f 66 20 74 72 79 |, instea|d of try|
|00000900| 69 6e 67 20 74 6f 20 6d | 61 6b 65 20 64 6f 7a 65 |ing to m|ake doze|
|00000910| 6e 73 20 6f 66 20 73 6d | 61 6c 6c 20 6d 6f 64 69 |ns of sm|all modi|
|00000920| 66 69 63 61 74 69 6f 6e | 73 20 62 79 20 68 61 6e |fication|s by han|
|00000930| 64 2c 20 49 0a 20 77 72 | 6f 74 65 20 61 20 73 69 |d, I. wr|ote a si|
|00000940| 6d 70 6c 65 20 70 72 6f | 67 72 61 6d 2c 20 70 65 |mple pro|gram, pe|
|00000950| 72 68 61 70 73 20 61 6e | 20 41 57 4b 20 73 63 72 |rhaps an| AWK scr|
|00000960| 69 70 74 2c 20 74 68 61 | 74 20 77 6f 75 6c 64 20 |ipt, tha|t would |
|00000970| 72 65 61 64 20 0a 61 20 | 64 65 73 63 72 69 70 74 |read .a |descript|
|00000980| 69 6f 6e 20 6f 66 20 74 | 68 65 20 67 72 61 6d 6d |ion of t|he gramm|
|00000990| 61 72 20 61 6e 64 20 67 | 65 6e 65 72 61 74 65 20 |ar and g|enerate |
|000009a0| 43 7e 63 6f 64 65 20 66 | 6f 72 20 7b 5c 74 74 20 |C~code f|or {\tt |
|000009b0| 57 45 41 56 45 7d 2e 0a | 54 68 61 74 20 41 57 4b |WEAVE}..|That AWK|
|000009c0| 20 73 63 72 69 70 74 20 | 62 65 63 61 6d 65 20 7b | script |became {|
|000009d0| 5c 74 74 20 53 50 49 44 | 45 52 7d 2c 20 61 20 70 |\tt SPID|ER}, a p|
|000009e0| 72 6f 67 72 61 6d 20 74 | 68 61 74 20 74 75 72 6e |rogram t|hat turn|
|000009f0| 73 20 6c 61 6e 67 75 61 | 67 65 0a 64 65 73 63 72 |s langua|ge.descr|
|00000a00| 69 70 74 69 6f 6e 73 20 | 69 6e 74 6f 20 43 7e 63 |iptions |into C~c|
|00000a10| 6f 64 65 20 66 6f 72 20 | 7b 5c 74 74 20 54 41 4e |ode for |{\tt TAN|
|00000a20| 47 4c 45 7d 20 61 6e 64 | 20 7b 5c 74 74 20 57 45 |GLE} and| {\tt WE|
|00000a30| 41 56 45 7d 2e 0a 49 20 | 68 61 76 65 20 75 73 65 |AVE}..I |have use|
|00000a40| 64 20 7b 5c 74 74 20 53 | 50 49 44 45 52 7d 20 74 |d {\tt S|PIDER} t|
|00000a50| 6f 20 67 65 6e 65 72 61 | 74 65 20 7b 5c 74 74 20 |o genera|te {\tt |
|00000a60| 57 45 42 7d 73 20 66 6f | 72 20 43 2c 20 41 57 4b |WEB}s fo|r C, AWK|
|00000a70| 2c 20 53 53 4c 2c 20 41 | 64 61 2c 0a 61 6e 64 20 |, SSL, A|da,.and |
|00000a80| 61 20 63 6f 75 70 6c 65 | 20 6f 66 20 6f 74 68 65 |a couple| of othe|
|00000a90| 72 20 6c 61 6e 67 75 61 | 67 65 73 2e 0a 49 20 77 |r langua|ges..I w|
|00000aa0| 6f 6e 27 74 20 67 6f 20 | 69 6e 74 6f 20 74 68 65 |on't go |into the|
|00000ab0| 20 64 65 74 61 69 6c 73 | 20 6f 66 20 7b 5c 74 74 | details| of {\tt|
|00000ac0| 20 53 50 49 44 45 52 7d | 3b 20 69 6e 73 74 65 61 | SPIDER}|; instea|
|00000ad0| 64 2c 20 49 27 6c 6c 20 | 74 72 79 20 74 6f 0a 64 |d, I'll |try to.d|
|00000ae0| 65 73 63 72 69 62 65 20 | 77 68 61 74 20 7b 5c 74 |escribe |what {\t|
|00000af0| 74 20 53 50 49 44 45 52 | 7d 20 64 6f 65 73 20 74 |t SPIDER|} does t|
|00000b00| 6f 20 61 63 63 6f 6d 70 | 6c 69 73 68 20 69 74 73 |o accomp|lish its|
|00000b10| 20 6d 69 73 73 69 6f 6e | 2c 20 6f 72 20 0a 68 6f | mission|, or .ho|
|00000b20| 77 20 74 6f 20 74 61 6b | 65 20 74 68 65 20 60 60 |w to tak|e the ``|
|00000b30| 65 73 73 65 6e 63 65 20 | 6f 66 20 7b 5c 74 74 20 |essence |of {\tt |
|00000b40| 57 45 42 7d 27 27 20 61 | 6e 64 20 6d 61 6b 65 20 |WEB}'' a|nd make |
|00000b50| 69 74 0a 6c 61 6e 67 75 | 61 67 65 2d 69 6e 64 65 |it.langu|age-inde|
|00000b60| 70 65 6e 64 65 6e 74 2e | 20 0a 0a 5c 6d 65 64 73 |pendent.| ..\meds|
|00000b70| 6b 69 70 0a 0a 57 68 65 | 6e 20 75 73 69 6e 67 20 |kip..Whe|n using |
|00000b80| 7b 5c 74 74 20 57 45 42 | 7d 2c 20 61 20 70 72 6f |{\tt WEB|}, a pro|
|00000b90| 67 72 61 6d 6d 65 72 20 | 77 72 69 74 65 73 20 61 |grammer |writes a|
|00000ba0| 20 73 69 6e 67 6c 65 20 | 73 6f 75 72 63 65 20 66 | single |source f|
|00000bb0| 69 6c 65 2c 20 7b 5c 74 | 74 0a 66 6f 6f 2e 7b 5c |ile, {\t|t.foo.{\|
|00000bc0| 74 74 20 77 65 62 7d 7d | 2c 20 74 68 61 74 20 68 |tt web}}|, that h|
|00000bd0| 6f 6c 64 73 20 62 6f 74 | 68 20 63 6f 64 65 20 61 |olds bot|h code a|
|00000be0| 6e 64 20 64 6f 63 75 6d | 65 6e 74 61 74 69 6f 6e |nd docum|entation|
|00000bf0| 2e 0a 7b 5c 74 74 20 54 | 41 4e 47 4c 45 7d 20 61 |..{\tt T|ANGLE} a|
|00000c00| 6e 64 20 7b 5c 74 74 20 | 57 45 41 56 45 7d 20 72 |nd {\tt |WEAVE} r|
|00000c10| 65 61 64 20 74 68 61 74 | 20 66 69 6c 65 2e 0a 7b |ead that| file..{|
|00000c20| 5c 74 74 20 54 41 4e 47 | 4c 45 7d 20 65 78 74 72 |\tt TANG|LE} extr|
|00000c30| 61 63 74 73 0a 74 68 65 | 20 63 6f 64 65 20 66 72 |acts.the| code fr|
|00000c40| 6f 6d 20 74 68 65 20 7b | 5c 74 74 20 57 45 42 7d |om the {|\tt WEB}|
|00000c50| 20 66 69 6c 65 20 61 6e | 64 20 72 65 77 72 69 74 | file an|d rewrit|
|00000c60| 65 73 20 69 74 20 69 6e | 20 61 20 66 6f 72 6d 20 |es it in| a form |
|00000c70| 73 75 69 74 61 62 6c 65 | 0a 66 6f 72 20 63 6f 6d |suitable|.for com|
|00000c80| 70 69 6c 69 6e 67 2e 0a | 7b 5c 74 74 20 57 45 41 |piling..|{\tt WEA|
|00000c90| 56 45 7d 20 70 61 73 73 | 65 73 20 74 68 65 20 64 |VE} pass|es the d|
|00000ca0| 6f 63 75 6d 65 6e 74 61 | 74 69 6f 6e 20 70 61 72 |ocumenta|tion par|
|00000cb0| 74 73 20 74 6f 20 61 20 | 64 6f 63 75 6d 65 6e 74 |ts to a |document|
|00000cc0| 20 66 6f 72 6d 61 74 74 | 65 72 0a 28 7b 5c 54 65 | formatt|er.({\Te|
|00000cd0| 58 7d 29 2c 20 61 6e 64 | 20 70 72 65 74 74 79 70 |X}), and| prettyp|
|00000ce0| 72 69 6e 74 73 20 74 68 | 65 20 63 6f 64 65 20 70 |rints th|e code p|
|00000cf0| 61 72 74 73 2e 0a 54 68 | 65 20 77 68 6f 6c 65 20 |arts..Th|e whole |
|00000d00| 70 72 6f 63 65 73 73 20 | 69 73 20 73 68 6f 77 6e |process |is shown|
|00000d10| 20 69 6e 20 46 69 67 75 | 72 65 7e 5c 72 65 66 7b | in Figu|re~\ref{|
|00000d20| 69 6e 73 74 61 6e 63 65 | 7d 2c 20 66 6f 72 20 43 |instance|}, for C|
|00000d30| 7e 70 72 6f 67 72 61 6d | 73 0a 77 72 69 74 74 65 |~program|s.writte|
|00000d40| 6e 20 69 6e 20 7b 5c 74 | 74 20 57 45 42 7d 2e 0a |n in {\t|t WEB}..|
|00000d50| 54 68 65 7e 7b 5c 53 7d | 20 72 65 70 72 65 73 65 |The~{\S}| represe|
|00000d60| 6e 74 73 20 66 69 6c 65 | 73 20 74 68 61 74 20 68 |nts file|s that h|
|00000d70| 61 76 65 20 74 6f 20 62 | 65 20 77 72 69 74 74 65 |ave to b|e writte|
|00000d80| 6e 20 62 79 20 68 61 6e | 64 2e 0a 7b 5c 73 6c 20 |n by han|d..{\sl |
|00000d90| 53 6c 61 6e 74 7d 20 74 | 79 70 65 20 69 73 20 75 |Slant} t|ype is u|
|00000da0| 73 65 64 20 66 6f 72 20 | 74 68 65 20 6e 61 6d 65 |sed for |the name|
|00000db0| 73 20 6f 66 20 65 78 65 | 63 75 74 61 62 6c 65 20 |s of exe|cutable |
|00000dc0| 70 72 6f 67 72 61 6d 73 | 2e 0a 7b 5c 73 6c 20 43 |programs|..{\sl C|
|00000dd0| 54 41 4e 47 4c 45 7d 20 | 61 6e 64 20 7b 5c 73 6c |TANGLE} |and {\sl|
|00000de0| 20 43 57 45 41 56 45 7d | 20 61 72 65 20 74 68 65 | CWEAVE}| are the|
|00000df0| 20 43 2d 6c 61 6e 67 75 | 61 67 65 20 76 65 72 73 | C-langu|age vers|
|00000e00| 69 6f 6e 73 20 6f 66 20 | 7b 5c 74 74 0a 54 41 4e |ions of |{\tt.TAN|
|00000e10| 47 4c 45 7d 20 61 6e 64 | 20 7b 5c 74 74 20 57 45 |GLE} and| {\tt WE|
|00000e20| 41 56 45 7d 2c 20 7b 5c | 73 6c 20 63 63 7d 7e 69 |AVE}, {\|sl cc}~i|
|00000e30| 73 20 61 20 43 7e 63 6f | 6d 70 69 6c 65 72 2c 20 |s a C~co|mpiler, |
|00000e40| 61 6e 64 20 7b 5c 73 6c | 20 6c 64 7d 7e 69 73 20 |and {\sl| ld}~is |
|00000e50| 61 0a 6c 6f 61 64 65 72 | 2e 20 0a 0a 5c 62 65 67 |a.loader|. ..\beg|
|00000e60| 69 6e 7b 66 69 67 75 72 | 65 7d 0a 5c 63 61 70 74 |in{figur|e}.\capt|
|00000e70| 69 6f 6e 7b 50 72 6f 63 | 65 73 73 69 6e 67 20 61 |ion{Proc|essing a|
|00000e80| 20 43 7e 7b 5c 74 74 20 | 77 65 62 7d 20 66 69 6c | C~{\tt |web} fil|
|00000e90| 65 7d 0a 5c 6c 61 62 65 | 6c 7b 69 6e 73 74 61 6e |e}.\labe|l{instan|
|00000ea0| 63 65 7d 0a 5c 66 6f 6f | 74 6e 6f 74 65 73 69 7a |ce}.\foo|tnotesiz|
|00000eb0| 65 0a 5c 73 65 74 6c 65 | 6e 67 74 68 7b 5c 75 6e |e.\setle|ngth{\un|
|00000ec0| 69 74 6c 65 6e 67 74 68 | 7d 7b 32 70 74 7d 0a 5c |itlength|}{2pt}.\|
|00000ed0| 62 65 67 69 6e 7b 70 69 | 63 74 75 72 65 7d 28 31 |begin{pi|cture}(1|
|00000ee0| 37 30 2c 38 30 29 28 30 | 2c 2d 34 30 29 0a 5c 74 |70,80)(0|,-40).\t|
|00000ef0| 74 0a 5c 70 75 74 28 32 | 30 2c 31 32 2e 35 29 7b |t.\put(2|0,12.5){|
|00000f00| 5c 6d 61 6b 65 62 6f 78 | 28 30 2c 30 29 5b 6c 5d |\makebox|(0,0)[l]|
|00000f10| 7b 5c 20 5c 73 6c 20 43 | 54 41 4e 47 4c 45 7d 7d |{\ \sl C|TANGLE}}|
|00000f20| 0a 5c 70 75 74 28 32 30 | 2c 2d 31 32 2e 35 29 7b |.\put(20|,-12.5){|
|00000f30| 5c 6d 61 6b 65 62 6f 78 | 28 30 2c 30 29 5b 6c 5d |\makebox|(0,0)[l]|
|00000f40| 7b 5c 20 5c 73 6c 20 43 | 57 45 41 56 45 7d 7d 0a |{\ \sl C|WEAVE}}.|
|00000f50| 0a 5c 70 75 74 28 30 2c | 2d 35 29 7b 5c 66 72 61 |.\put(0,|-5){\fra|
|00000f60| 6d 65 62 6f 78 28 33 30 | 2c 31 30 29 7b 66 6f 6f |mebox(30|,10){foo|
|00000f70| 2e 7b 5c 74 74 20 77 65 | 62 7d 5c 73 6d 61 73 68 |.{\tt we|b}\smash|
|00000f80| 7b 24 7b 7d 5e 7b 5c 53 | 7d 24 7d 7d 7d 0a 5c 70 |{${}^{\S|}$}}}.\p|
|00000f90| 75 74 28 31 35 2c 35 29 | 7b 5c 76 65 63 74 6f 72 |ut(15,5)|{\vector|
|00000fa0| 28 31 2c 32 29 7b 37 2e | 35 7d 7d 0a 5c 70 75 74 |(1,2){7.|5}}.\put|
|00000fb0| 28 31 30 2c 32 30 29 7b | 5c 66 72 61 6d 65 62 6f |(10,20){|\framebo|
|00000fc0| 78 28 33 30 2c 31 30 29 | 7b 66 6f 6f 2e 63 7d 7d |x(30,10)|{foo.c}}|
|00000fd0| 0a 5c 70 75 74 28 31 35 | 2c 2d 35 29 7b 5c 76 65 |.\put(15|,-5){\ve|
|00000fe0| 63 74 6f 72 28 31 2c 2d | 32 29 7b 37 2e 35 7d 7d |ctor(1,-|2){7.5}}|
|00000ff0| 0a 5c 70 75 74 28 31 30 | 2c 2d 33 30 29 7b 5c 66 |.\put(10|,-30){\f|
|00001000| 72 61 6d 65 62 6f 78 28 | 33 30 2c 31 30 29 7b 66 |ramebox(|30,10){f|
|00001010| 6f 6f 2e 74 65 78 7d 7d | 0a 0a 5c 70 75 74 28 34 |oo.tex}}|..\put(4|
|00001020| 30 2c 2d 32 35 29 7b 5c | 76 65 63 74 6f 72 28 31 |0,-25){\|vector(1|
|00001030| 2c 30 29 7b 32 30 7d 7d | 0a 5c 70 75 74 28 35 30 |,0){20}}|.\put(50|
|00001040| 2c 2d 32 33 2e 35 29 7b | 5c 6d 61 6b 65 62 6f 78 |,-23.5){|\makebox|
|00001050| 28 30 2c 30 29 5b 62 5d | 7b 5c 73 6c 20 7b 5c 54 |(0,0)[b]|{\sl {\T|
|00001060| 65 58 7d 7d 7d 0a 5c 70 | 75 74 28 36 30 2c 2d 33 |eX}}}.\p|ut(60,-3|
|00001070| 30 29 7b 5c 66 72 61 6d | 65 62 6f 78 28 33 30 2c |0){\fram|ebox(30,|
|00001080| 31 30 29 7b 66 6f 6f 2e | 64 76 69 7d 7d 0a 5c 70 |10){foo.|dvi}}.\p|
|00001090| 75 74 28 39 30 2c 2d 32 | 35 29 7b 5c 76 65 63 74 |ut(90,-2|5){\vect|
|000010a0| 6f 72 28 31 2c 30 29 7b | 32 30 7d 7d 0a 5c 70 75 |or(1,0){|20}}.\pu|
|000010b0| 74 28 31 30 30 2c 2d 32 | 35 29 7b 5c 6d 61 6b 65 |t(100,-2|5){\make|
|000010c0| 62 6f 78 28 30 2c 30 29 | 7b 5c 73 68 6f 72 74 73 |box(0,0)|{\shorts|
|000010d0| 74 61 63 6b 7b 5c 73 74 | 72 75 74 20 64 76 69 5c |tack{\st|rut dvi\|
|000010e0| 5c 5c 73 74 72 75 74 20 | 5c 72 6d 20 64 72 69 76 |\\strut |\rm driv|
|000010f0| 65 72 7d 7d 7d 0a 5c 70 | 75 74 28 31 31 30 2c 2d |er}}}.\p|ut(110,-|
|00001100| 32 35 29 7b 5c 6d 61 6b | 65 62 6f 78 28 30 2c 30 |25){\mak|ebox(0,0|
|00001110| 29 5b 6c 5d 7b 5c 72 6d | 5c 73 74 72 75 74 20 5c |)[l]{\rm|\strut \|
|00001120| 20 54 79 70 65 73 65 74 | 20 64 6f 63 75 6d 65 6e | Typeset| documen|
|00001130| 74 61 74 69 6f 6e 20 66 | 6f 72 0a 7b 5c 74 74 20 |tation f|or.{\tt |
|00001140| 66 6f 6f 7d 7d 7d 0a 0a | 5c 70 75 74 28 34 30 2c |foo}}}..|\put(40,|
|00001150| 32 35 29 7b 5c 76 65 63 | 74 6f 72 28 31 2c 30 29 |25){\vec|tor(1,0)|
|00001160| 7b 32 30 7d 7d 0a 5c 70 | 75 74 28 35 30 2c 32 36 |{20}}.\p|ut(50,26|
|00001170| 2e 35 29 7b 5c 6d 61 6b | 65 62 6f 78 28 30 2c 30 |.5){\mak|ebox(0,0|
|00001180| 29 5b 62 5d 7b 5c 73 6c | 20 63 63 7d 7d 0a 5c 70 |)[b]{\sl| cc}}.\p|
|00001190| 75 74 28 36 30 2c 32 30 | 29 7b 5c 66 72 61 6d 65 |ut(60,20|){\frame|
|000011a0| 62 6f 78 28 33 30 2c 31 | 30 29 7b 66 6f 6f 2e 6f |box(30,1|0){foo.o|
|000011b0| 7d 7d 0a 5c 70 75 74 28 | 39 30 2c 32 35 29 7b 5c |}}.\put(|90,25){\|
|000011c0| 76 65 63 74 6f 72 28 31 | 2c 30 29 7b 32 30 7d 7d |vector(1|,0){20}}|
|000011d0| 0a 5c 70 75 74 28 31 30 | 30 2c 32 36 2e 35 29 7b |.\put(10|0,26.5){|
|000011e0| 5c 6d 61 6b 65 62 6f 78 | 28 30 2c 30 29 5b 62 5d |\makebox|(0,0)[b]|
|000011f0| 7b 5c 73 6c 20 6c 64 7d | 7d 0a 5c 70 75 74 28 31 |{\sl ld}|}.\put(1|
|00001200| 31 30 2c 32 35 29 7b 5c | 6d 61 6b 65 62 6f 78 28 |10,25){\|makebox(|
|00001210| 30 2c 30 29 5b 6c 5d 7b | 5c 72 6d 5c 73 74 72 75 |0,0)[l]{|\rm\stru|
|00001220| 74 20 5c 20 45 78 65 63 | 75 74 61 62 6c 65 20 5c |t \ Exec|utable \|
|00001230| 73 6c 20 66 6f 6f 7d 7d | 0a 0a 0a 0a 5c 65 6e 64 |sl foo}}|....\end|
|00001240| 7b 70 69 63 74 75 72 65 | 7d 0a 0a 5c 68 72 75 6c |{picture|}..\hrul|
|00001250| 65 0a 5c 65 6e 64 7b 66 | 69 67 75 72 65 7d 0a 0a |e.\end{f|igure}..|
|00001260| 7b 5c 74 74 20 53 50 49 | 44 45 52 7d 20 69 73 20 |{\tt SPI|DER} is |
|00001270| 75 73 65 64 20 74 6f 20 | 63 6f 6e 73 74 72 75 63 |used to |construc|
|00001280| 74 20 7b 5c 65 6d 20 69 | 6e 73 74 61 6e 63 65 73 |t {\em i|nstances|
|00001290| 7d 20 6f 66 20 7b 5c 74 | 74 20 54 41 4e 47 4c 45 |} of {\t|t TANGLE|
|000012a0| 7d 20 61 6e 64 0a 7b 5c | 74 74 20 57 45 41 56 45 |} and.{\|tt WEAVE|
|000012b0| 7d 2c 20 61 6e 64 20 74 | 68 65 73 65 20 69 6e 73 |}, and t|hese ins|
|000012c0| 74 61 6e 63 65 73 20 61 | 72 65 20 75 73 65 64 20 |tances a|re used |
|000012d0| 74 6f 20 70 72 6f 63 65 | 73 73 20 70 72 6f 67 72 |to proce|ss progr|
|000012e0| 61 6d 73 20 61 73 0a 73 | 68 6f 77 6e 20 69 6e 20 |ams as.s|hown in |
|000012f0| 46 69 67 75 72 65 7e 5c | 72 65 66 7b 69 6e 73 74 |Figure~\|ref{inst|
|00001300| 61 6e 63 65 7d 2e 0a 43 | 6f 64 65 20 66 6f 72 20 |ance}..C|ode for |
|00001310| 74 68 65 20 6c 61 6e 67 | 75 61 67 65 2d 64 65 70 |the lang|uage-dep|
|00001320| 65 6e 64 65 6e 74 20 70 | 61 72 74 73 20 6f 66 20 |endent p|arts of |
|00001330| 74 68 65 73 65 20 69 6e | 73 74 61 6e 63 65 73 20 |these in|stances |
|00001340| 69 73 20 67 65 6e 65 72 | 61 74 65 64 0a 62 79 20 |is gener|ated.by |
|00001350| 7b 5c 74 74 20 53 50 49 | 44 45 52 7d 20 77 68 65 |{\tt SPI|DER} whe|
|00001360| 6e 20 69 74 20 0a 72 65 | 61 64 73 20 61 20 6c 61 |n it .re|ads a la|
|00001370| 6e 67 75 61 67 65 20 64 | 65 73 63 72 69 70 74 69 |nguage d|escripti|
|00001380| 6f 6e 20 66 69 6c 65 20 | 77 72 69 74 74 65 6e 20 |on file |written |
|00001390| 62 79 20 61 20 7b 5c 74 | 74 20 57 45 42 7d 20 64 |by a {\t|t WEB} d|
|000013a0| 65 73 69 67 6e 65 72 2e | 0a 46 69 67 75 72 65 7e |esigner.|.Figure~|
|000013b0| 5c 72 65 66 7b 62 75 69 | 6c 64 69 6e 67 7d 20 73 |\ref{bui|lding} s|
|000013c0| 68 6f 77 73 20 68 6f 77 | 20 69 6e 73 74 61 6e 63 |hows how| instanc|
|000013d0| 65 73 20 6f 66 20 7b 5c | 74 74 20 54 41 4e 47 4c |es of {\|tt TANGL|
|000013e0| 45 7d 20 61 6e 64 20 7b | 5c 74 74 0a 57 45 41 56 |E} and {|\tt.WEAV|
|000013f0| 45 7d 20 61 72 65 20 67 | 65 6e 65 72 61 74 65 64 |E} are g|enerated|
|00001400| 2e 20 0a 7b 5c 74 74 20 | 53 50 49 44 45 52 7d 20 |. .{\tt |SPIDER} |
|00001410| 63 6f 6e 76 65 72 74 73 | 20 61 20 68 61 6e 64 2d |converts| a hand-|
|00001420| 77 72 69 74 74 65 6e 20 | 64 65 73 63 72 69 70 74 |written |descript|
|00001430| 69 6f 6e 20 6f 66 20 61 | 20 70 72 6f 67 72 61 6d |ion of a| program|
|00001440| 6d 69 6e 67 20 6c 61 6e | 67 75 61 67 65 0a 69 6e |ming lan|guage.in|
|00001450| 74 6f 20 43 7e 7b 5c 74 | 74 20 57 45 42 7d 20 63 |to C~{\t|t WEB} c|
|00001460| 6f 64 65 20 66 6f 72 20 | 74 68 65 20 6c 61 6e 67 |ode for |the lang|
|00001470| 75 61 67 65 2d 64 65 70 | 65 6e 64 65 6e 74 20 70 |uage-dep|endent p|
|00001480| 61 72 74 73 20 6f 66 20 | 7b 5c 74 74 20 54 41 4e |arts of |{\tt TAN|
|00001490| 47 4c 45 7d 0a 61 6e 64 | 20 7b 5c 74 74 20 57 45 |GLE}.and| {\tt WE|
|000014a0| 41 56 45 7d 2e 20 0a 49 | 6e 20 46 69 67 75 72 65 |AVE}. .I|n Figure|
|000014b0| 7e 5c 72 65 66 7b 62 75 | 69 6c 64 69 6e 67 7d 20 |~\ref{bu|ilding} |
|000014c0| 74 68 65 20 74 61 72 67 | 65 74 20 70 72 6f 67 72 |the targ|et progr|
|000014d0| 61 6d 6d 69 6e 67 20 6c | 61 6e 67 75 61 67 65 20 |amming l|anguage |
|000014e0| 69 73 20 61 20 68 79 70 | 6f 74 68 65 74 69 63 61 |is a hyp|othetica|
|000014f0| 6c 0a 60 60 58 2c 27 27 | 20 61 6e 64 20 74 68 65 |l.``X,''| and the|
|00001500| 20 64 65 73 63 72 69 70 | 74 69 6f 6e 20 66 69 6c | descrip|tion fil|
|00001510| 65 20 69 73 20 63 61 6c | 6c 65 64 20 60 60 7b 5c |e is cal|led ``{\|
|00001520| 74 74 20 78 2e 73 70 69 | 64 65 72 7d 2e 27 27 0a |tt x.spi|der}.''.|
|00001530| 7b 5c 74 74 20 43 54 41 | 4e 47 4c 45 7d 20 63 6f |{\tt CTA|NGLE} co|
|00001540| 6d 62 69 6e 65 73 20 74 | 68 65 20 63 6f 64 65 20 |mbines t|he code |
|00001550| 7b 5c 74 74 20 53 50 49 | 44 45 52 7d 20 77 72 69 |{\tt SPI|DER} wri|
|00001560| 74 65 73 20 77 69 74 68 | 20 74 68 65 20 60 60 6d |tes with| the ``m|
|00001570| 61 73 74 65 72 0a 63 6f | 70 69 65 73 27 27 20 6f |aster.co|pies'' o|
|00001580| 66 20 7b 5c 74 74 20 74 | 61 6e 67 6c 65 2e 77 65 |f {\tt t|angle.we|
|00001590| 62 7d 20 61 6e 64 20 7b | 5c 74 74 20 77 65 61 76 |b} and {|\tt weav|
|000015a0| 65 2e 77 65 62 7d 2c 20 | 77 68 69 63 68 20 63 6f |e.web}, |which co|
|000015b0| 6e 74 61 69 6e 20 74 68 | 65 0a 6c 61 6e 67 75 61 |ntain th|e.langua|
|000015c0| 67 65 2d 69 6e 64 65 70 | 65 6e 64 65 6e 74 20 70 |ge-indep|endent p|
|000015d0| 61 72 74 73 20 6f 66 20 | 7b 5c 74 74 20 54 41 4e |arts of |{\tt TAN|
|000015e0| 47 4c 45 7d 20 61 6e 64 | 20 7b 5c 74 74 20 57 45 |GLE} and| {\tt WE|
|000015f0| 41 56 45 7d 2e 0a 54 68 | 65 20 72 65 73 75 6c 74 |AVE}..Th|e result|
|00001600| 20 69 73 20 43 7e 73 6f | 75 72 63 65 20 63 6f 64 | is C~so|urce cod|
|00001610| 65 20 66 6f 72 20 7b 5c | 74 74 20 58 54 41 4e 47 |e for {\|tt XTANG|
|00001620| 4c 45 7d 20 61 6e 64 20 | 7b 5c 74 74 20 58 57 45 |LE} and |{\tt XWE|
|00001630| 41 56 45 7d 2e 0a 41 66 | 74 65 72 20 74 68 61 74 |AVE}..Af|ter that|
|00001640| 20 63 6f 64 65 20 69 73 | 20 63 6f 6d 70 69 6c 65 | code is| compile|
|00001650| 64 20 61 6e 64 20 6c 6f | 61 64 65 64 20 77 69 74 |d and lo|aded wit|
|00001660| 68 20 7b 5c 74 74 20 57 | 45 42 7d 27 73 20 49 2f |h {\tt W|EB}'s I/|
|00001670| 4f 20 63 6f 64 65 2c 20 | 74 68 65 0a 72 65 73 75 |O code, |the.resu|
|00001680| 6c 74 69 6e 67 20 65 78 | 65 63 75 74 61 62 6c 65 |lting ex|ecutable|
|00001690| 20 76 65 72 73 69 6f 6e | 73 20 6f 66 20 7b 5c 74 | version|s of {\t|
|000016a0| 74 20 58 54 41 4e 47 4c | 45 7d 20 61 6e 64 20 7b |t XTANGL|E} and {|
|000016b0| 5c 74 74 20 58 57 45 41 | 56 45 7d 20 63 61 6e 20 |\tt XWEA|VE} can |
|000016c0| 62 65 0a 75 73 65 64 20 | 74 6f 20 70 72 6f 63 65 |be.used |to proce|
|000016d0| 73 73 20 58 2d 6c 61 6e | 67 75 61 67 65 20 70 72 |ss X-lan|guage pr|
|000016e0| 6f 67 72 61 6d 73 20 77 | 72 69 74 74 65 6e 20 69 |ograms w|ritten i|
|000016f0| 6e 20 7b 5c 74 74 20 57 | 45 42 7d 20 66 6f 72 6d |n {\tt W|EB} form|
|00001700| 61 74 2c 20 61 73 0a 73 | 68 6f 77 6e 20 61 72 6f |at, as.s|hown aro|
|00001710| 75 6e 64 20 74 68 65 20 | 70 65 72 69 70 68 65 72 |und the |peripher|
|00001720| 79 20 6f 66 20 46 69 67 | 75 72 65 7e 5c 72 65 66 |y of Fig|ure~\ref|
|00001730| 7b 62 75 69 6c 64 69 6e | 67 7d 2e 0a 0a 0a 54 68 |{buildin|g}....Th|
|00001740| 65 20 6d 61 73 74 65 72 | 20 63 6f 70 69 65 73 20 |e master| copies |
|00001750| 6f 66 20 7b 5c 74 74 20 | 74 61 6e 67 6c 65 2e 77 |of {\tt |tangle.w|
|00001760| 65 62 7d 20 61 6e 64 20 | 7b 5c 74 74 20 77 65 61 |eb} and |{\tt wea|
|00001770| 76 65 2e 77 65 62 7d 20 | 61 72 65 20 61 62 6f 75 |ve.web} |are abou|
|00001780| 74 0a 31 38 30 30 20 61 | 6e 64 20 33 32 30 30 20 |t.1800 a|nd 3200 |
|00001790| 6c 69 6e 65 73 20 6c 6f | 6e 67 2c 20 72 65 73 70 |lines lo|ng, resp|
|000017a0| 65 63 74 69 76 65 6c 79 | 2e 0a 41 62 6f 75 74 20 |ectively|..About |
|000017b0| 6f 6e 65 20 74 68 69 72 | 64 20 6f 66 20 74 68 65 |one thir|d of the|
|000017c0| 73 65 20 6c 69 6e 65 73 | 20 61 72 65 20 63 6f 6d |se lines| are com|
|000017d0| 6d 65 6e 74 73 2e 0a 54 | 6f 20 69 6c 6c 75 73 74 |ments..T|o illust|
|000017e0| 72 61 74 65 20 74 68 65 | 20 6f 74 68 65 72 20 73 |rate the| other s|
|000017f0| 69 7a 65 2c 20 73 75 70 | 70 6f 73 65 20 58 20 69 |ize, sup|pose X i|
|00001800| 73 20 74 68 65 20 41 64 | 61 20 70 72 6f 67 72 61 |s the Ad|a progra|
|00001810| 6d 6d 69 6e 67 20 6c 61 | 6e 67 75 61 67 65 2e 0a |mming la|nguage..|
|00001820| 54 68 65 20 7b 5c 74 74 | 20 61 64 61 2e 73 70 69 |The {\tt| ada.spi|
|00001830| 64 65 72 7d 20 66 69 6c | 65 20 69 73 20 61 62 6f |der} fil|e is abo|
|00001840| 75 74 20 32 36 30 20 6c | 69 6e 65 73 20 6c 6f 6e |ut 260 l|ines lon|
|00001850| 67 2c 20 61 6e 64 20 66 | 72 6f 6d 20 69 74 20 7b |g, and f|rom it {|
|00001860| 5c 74 74 0a 53 50 49 44 | 45 52 7d 20 67 65 6e 65 |\tt.SPID|ER} gene|
|00001870| 72 61 74 65 73 20 0a 61 | 62 6f 75 74 20 31 34 30 |rates .a|bout 140|
|00001880| 30 7e 6c 69 6e 65 73 20 | 6f 66 20 7b 5c 74 74 20 |0~lines |of {\tt |
|00001890| 41 44 41 54 41 4e 47 4c | 45 7d 20 61 6e 64 20 7b |ADATANGL|E} and {|
|000018a0| 5c 74 74 20 41 44 41 57 | 45 41 56 45 7d 2e 0a 41 |\tt ADAW|EAVE}..A|
|000018b0| 62 6f 75 74 20 6f 6e 65 | 20 74 65 6e 74 68 20 6f |bout one| tenth o|
|000018c0| 66 20 74 68 65 73 65 20 | 6c 69 6e 65 73 20 61 72 |f these |lines ar|
|000018d0| 65 20 63 6f 6d 6d 65 6e | 74 73 2e 0a 49 74 20 69 |e commen|ts..It i|
|000018e0| 73 20 74 79 70 69 63 61 | 6c 20 66 6f 72 20 7b 5c |s typica|l for {\|
|000018f0| 74 74 20 53 50 49 44 45 | 52 7d 20 74 6f 20 67 65 |tt SPIDE|R} to ge|
|00001900| 6e 65 72 61 74 65 20 62 | 65 74 77 65 65 6e 20 24 |nerate b|etween $|
|00001910| 35 6e 24 20 61 6e 64 20 | 24 36 6e 24 20 6c 69 6e |5n$ and |$6n$ lin|
|00001920| 65 73 0a 6f 66 20 43 7e | 7b 5c 74 74 20 57 45 42 |es.of C~|{\tt WEB|
|00001930| 7d 20 63 6f 64 65 20 66 | 72 6f 6d 20 61 6e 20 24 |} code f|rom an $|
|00001940| 6e 24 7e 6c 69 6e 65 20 | 6c 61 6e 67 75 61 67 65 |n$~line |language|
|00001950| 20 64 65 73 63 72 69 70 | 74 69 6f 6e 2e 0a 0a 5c | descrip|tion...\|
|00001960| 62 65 67 69 6e 7b 66 69 | 67 75 72 65 7d 0a 5c 63 |begin{fi|gure}.\c|
|00001970| 61 70 74 69 6f 6e 7b 42 | 75 69 6c 64 69 6e 67 20 |aption{B|uilding |
|00001980| 61 6e 64 20 75 73 69 6e | 67 20 61 6e 20 69 6e 73 |and usin|g an ins|
|00001990| 74 61 6e 63 65 20 0a 6f | 66 20 7b 5c 74 74 20 57 |tance .o|f {\tt W|
|000019a0| 45 42 7d 20 28 66 6f 72 | 20 6c 61 6e 67 75 61 67 |EB} (for| languag|
|000019b0| 65 20 58 29 7d 0a 5c 6c | 61 62 65 6c 7b 62 75 69 |e X)}.\l|abel{bui|
|000019c0| 6c 64 69 6e 67 7d 0a 5c | 66 6f 6f 74 6e 6f 74 65 |lding}.\|footnote|
|000019d0| 73 69 7a 65 0a 5c 73 65 | 74 6c 65 6e 67 74 68 7b |size.\se|tlength{|
|000019e0| 5c 75 6e 69 74 6c 65 6e | 67 74 68 7d 7b 32 70 74 |\unitlen|gth}{2pt|
|000019f0| 7d 0a 5c 62 65 67 69 6e | 7b 70 69 63 74 75 72 65 |}.\begin|{picture|
|00001a00| 7d 28 32 31 35 2c 31 31 | 35 29 28 31 30 2c 2d 35 |}(215,11|5)(10,-5|
|00001a10| 35 29 0a 5c 74 74 0a 5c | 70 75 74 28 31 38 35 2c |5).\tt.\|put(185,|
|00001a20| 2d 35 29 7b 5c 66 72 61 | 6d 65 62 6f 78 28 33 30 |-5){\fra|mebox(30|
|00001a30| 2c 31 30 29 7b 78 2e 73 | 70 69 64 65 72 5c 73 6d |,10){x.s|pider\sm|
|00001a40| 61 73 68 7b 24 7b 7d 5e | 7b 5c 53 7d 24 7d 7d 7d |ash{${}^|{\S}$}}}|
|00001a50| 0a 5c 70 75 74 28 31 38 | 35 2c 30 29 7b 5c 6c 69 |.\put(18|5,0){\li|
|00001a60| 6e 65 28 2d 31 2c 30 29 | 7b 32 30 7d 7d 0a 5c 70 |ne(-1,0)|{20}}.\p|
|00001a70| 75 74 28 31 37 34 2c 31 | 2e 35 29 7b 5c 6d 61 6b |ut(174,1|.5){\mak|
|00001a80| 65 62 6f 78 28 30 2c 30 | 29 5b 62 5d 7b 24 5c 2c |ebox(0,0|)[b]{$\,|
|00001a90| 24 5c 73 6c 20 53 50 49 | 44 45 52 7d 7d 0a 5c 70 |$\sl SPI|DER}}.\p|
|00001aa0| 75 74 28 31 36 35 2c 30 | 29 7b 5c 76 65 63 74 6f |ut(165,0|){\vecto|
|00001ab0| 72 28 2d 31 2c 31 29 7b | 31 30 7d 7d 0a 5c 70 75 |r(-1,1){|10}}.\pu|
|00001ac0| 74 28 31 36 35 2c 30 29 | 7b 5c 76 65 63 74 6f 72 |t(165,0)|{\vector|
|00001ad0| 28 2d 31 2c 2d 31 29 7b | 31 30 7d 7d 0a 0a 5c 70 |(-1,-1){|10}}..\p|
|00001ae0| 75 74 28 31 32 35 2c 35 | 29 7b 5c 66 72 61 6d 65 |ut(125,5|){\frame|
|00001af0| 62 6f 78 28 33 30 2c 31 | 30 29 7b 78 74 2e 77 65 |box(30,1|0){xt.we|
|00001b00| 62 7d 7d 0a 5c 70 75 74 | 28 31 32 35 2c 2d 31 35 |b}}.\put|(125,-15|
|00001b10| 29 7b 5c 66 72 61 6d 65 | 62 6f 78 28 33 30 2c 31 |){\frame|box(30,1|
|00001b20| 30 29 7b 78 77 2e 77 65 | 62 7d 7d 0a 5c 70 75 74 |0){xw.we|b}}.\put|
|00001b30| 28 31 32 35 2c 32 35 29 | 7b 5c 66 72 61 6d 65 62 |(125,25)|{\frameb|
|00001b40| 6f 78 28 33 30 2c 31 30 | 29 7b 5c 73 68 6f 72 74 |ox(30,10|){\short|
|00001b50| 73 74 61 63 6b 7b 7b 5c | 72 6d 20 4d 61 73 74 65 |stack{{\|rm Maste|
|00001b60| 72 7d 5c 5c 74 61 6e 67 | 6c 65 2e 7b 5c 74 74 20 |r}\\tang|le.{\tt |
|00001b70| 77 65 62 7d 7d 7d 7d 0a | 5c 70 75 74 28 31 32 35 |web}}}}.|\put(125|
|00001b80| 2c 2d 33 35 29 7b 5c 66 | 72 61 6d 65 62 6f 78 28 |,-35){\f|ramebox(|
|00001b90| 33 30 2c 31 30 29 7b 5c | 73 68 6f 72 74 73 74 61 |30,10){\|shortsta|
|00001ba0| 63 6b 7b 7b 5c 72 6d 20 | 4d 61 73 74 65 72 7d 5c |ck{{\rm |Master}\|
|00001bb0| 5c 77 65 61 76 65 2e 7b | 5c 74 74 20 77 65 62 7d |\weave.{|\tt web}|
|00001bc0| 7d 7d 7d 0a 5c 70 75 74 | 28 31 32 35 2c 2d 33 30 |}}}.\put|(125,-30|
|00001bd0| 29 7b 5c 6c 69 6e 65 28 | 2d 31 2c 31 29 7b 31 30 |){\line(|-1,1){10|
|00001be0| 7d 7d 0a 5c 70 75 74 28 | 31 32 35 2c 2d 31 30 29 |}}.\put(|125,-10)|
|00001bf0| 7b 5c 6c 69 6e 65 28 2d | 31 2c 2d 31 29 7b 31 30 |{\line(-|1,-1){10|
|00001c00| 7d 7d 0a 5c 70 75 74 28 | 31 31 35 2c 2d 32 30 29 |}}.\put(|115,-20)|
|00001c10| 7b 5c 76 65 63 74 6f 72 | 28 2d 31 2c 30 29 7b 32 |{\vector|(-1,0){2|
|00001c20| 35 7d 7d 0a 0a 5c 70 75 | 74 28 31 30 34 2c 2d 31 |5}}..\pu|t(104,-1|
|00001c30| 38 2e 35 29 7b 5c 6d 61 | 6b 65 62 6f 78 28 30 2c |8.5){\ma|kebox(0,|
|00001c40| 30 29 5b 62 5d 7b 5c 73 | 63 72 69 70 74 73 69 7a |0)[b]{\s|criptsiz|
|00001c50| 65 5c 73 6c 20 43 54 41 | 4e 47 4c 45 7d 7d 0a 0a |e\sl CTA|NGLE}}..|
|00001c60| 5c 70 75 74 28 31 32 35 | 2c 31 30 29 7b 5c 6c 69 |\put(125|,10){\li|
|00001c70| 6e 65 28 2d 31 2c 31 29 | 7b 31 30 7d 7d 0a 5c 70 |ne(-1,1)|{10}}.\p|
|00001c80| 75 74 28 31 32 35 2c 33 | 30 29 7b 5c 6c 69 6e 65 |ut(125,3|0){\line|
|00001c90| 28 2d 31 2c 2d 31 29 7b | 31 30 7d 7d 0a 5c 70 75 |(-1,-1){|10}}.\pu|
|00001ca0| 74 28 31 31 35 2c 32 30 | 29 7b 5c 76 65 63 74 6f |t(115,20|){\vecto|
|00001cb0| 72 28 2d 31 2c 30 29 7b | 32 35 7d 7d 0a 0a 5c 70 |r(-1,0){|25}}..\p|
|00001cc0| 75 74 28 31 30 34 2c 32 | 31 2e 35 29 7b 5c 6d 61 |ut(104,2|1.5){\ma|
|00001cd0| 6b 65 62 6f 78 28 30 2c | 30 29 5b 62 5d 7b 5c 73 |kebox(0,|0)[b]{\s|
|00001ce0| 63 72 69 70 74 73 69 7a | 65 5c 73 6c 20 43 54 41 |criptsiz|e\sl CTA|
|00001cf0| 4e 47 4c 45 7d 7d 0a 0a | 5c 70 75 74 28 36 30 2c |NGLE}}..|\put(60,|
|00001d00| 31 35 29 7b 5c 66 72 61 | 6d 65 62 6f 78 28 33 30 |15){\fra|mebox(30|
|00001d10| 2c 31 30 29 7b 78 74 61 | 6e 67 6c 65 2e 63 7d 7d |,10){xta|ngle.c}}|
|00001d20| 0a 5c 70 75 74 28 36 30 | 2c 2d 32 35 29 7b 5c 66 |.\put(60|,-25){\f|
|00001d30| 72 61 6d 65 62 6f 78 28 | 33 30 2c 31 30 29 7b 78 |ramebox(|30,10){x|
|00001d40| 77 65 61 76 65 2e 63 7d | 7d 0a 5c 70 75 74 28 36 |weave.c}|}.\put(6|
|00001d50| 30 2c 2d 32 30 29 7b 5c | 76 65 63 74 6f 72 28 2d |0,-20){\|vector(-|
|00001d60| 31 2c 30 29 7b 32 30 7d | 7d 0a 5c 70 75 74 28 35 |1,0){20}|}.\put(5|
|00001d70| 30 2c 2d 31 38 2e 35 29 | 7b 5c 6d 61 6b 65 62 6f |0,-18.5)|{\makebo|
|00001d80| 78 28 30 2c 30 29 5b 62 | 5d 7b 5c 73 6c 20 63 63 |x(0,0)[b|]{\sl cc|
|00001d90| 2c 20 6c 64 7d 7d 0a 5c | 70 75 74 28 36 30 2c 32 |, ld}}.\|put(60,2|
|00001da0| 30 29 7b 5c 76 65 63 74 | 6f 72 28 2d 31 2c 30 29 |0){\vect|or(-1,0)|
|00001db0| 7b 32 30 7d 7d 0a 5c 70 | 75 74 28 35 30 2c 32 31 |{20}}.\p|ut(50,21|
|00001dc0| 2e 35 29 7b 5c 6d 61 6b | 65 62 6f 78 28 30 2c 30 |.5){\mak|ebox(0,0|
|00001dd0| 29 5b 62 5d 7b 5c 73 6c | 20 63 63 2c 20 6c 64 7d |)[b]{\sl| cc, ld}|
|00001de0| 7d 0a 5c 70 75 74 28 33 | 38 2c 32 30 29 7b 5c 6d |}.\put(3|8,20){\m|
|00001df0| 61 6b 65 62 6f 78 28 30 | 2c 30 29 5b 72 5d 7b 5c |akebox(0|,0)[r]{\|
|00001e00| 73 6c 20 58 54 41 4e 47 | 4c 45 7d 7d 0a 5c 70 75 |sl XTANG|LE}}.\pu|
|00001e10| 74 28 33 38 2c 2d 32 30 | 29 7b 5c 6d 61 6b 65 62 |t(38,-20|){\makeb|
|00001e20| 6f 78 28 30 2c 30 29 5b | 72 5d 7b 5c 73 6c 20 58 |ox(0,0)[|r]{\sl X|
|00001e30| 57 45 41 56 45 7d 7d 0a | 0a 5c 70 75 74 28 2d 36 |WEAVE}}.|.\put(-6|
|00001e40| 2e 32 35 2c 2d 35 29 7b | 5c 66 72 61 6d 65 62 6f |.25,-5){|\framebo|
|00001e50| 78 28 33 30 2c 31 30 29 | 7b 66 6f 6f 2e 7b 5c 74 |x(30,10)|{foo.{\t|
|00001e60| 74 20 77 65 62 7d 5c 73 | 6d 61 73 68 7b 24 7b 7d |t web}\s|mash{${}|
|00001e70| 5e 7b 5c 53 7d 24 7d 7d | 7d 0a 5c 70 75 74 28 38 |^{\S}$}}|}.\put(8|
|00001e80| 2e 37 35 2c 35 29 7b 5c | 76 65 63 74 6f 72 28 31 |.75,5){\|vector(1|
|00001e90| 2c 34 29 7b 36 2e 32 35 | 7d 7d 0a 5c 70 75 74 28 |,4){6.25|}}.\put(|
|00001ea0| 30 2c 33 30 29 7b 5c 66 | 72 61 6d 65 62 6f 78 28 |0,30){\f|ramebox(|
|00001eb0| 33 30 2c 31 30 29 7b 66 | 6f 6f 2e 78 7d 7d 0a 5c |30,10){f|oo.x}}.\|
|00001ec0| 70 75 74 28 38 2e 37 35 | 2c 2d 35 29 7b 5c 76 65 |put(8.75|,-5){\ve|
|00001ed0| 63 74 6f 72 28 31 2c 2d | 34 29 7b 36 2e 32 35 7d |ctor(1,-|4){6.25}|
|00001ee0| 7d 0a 5c 70 75 74 28 30 | 2c 2d 34 30 29 7b 5c 66 |}.\put(0|,-40){\f|
|00001ef0| 72 61 6d 65 62 6f 78 28 | 33 30 2c 31 30 29 7b 66 |ramebox(|30,10){f|
|00001f00| 6f 6f 2e 74 65 78 7d 7d | 0a 0a 5c 70 75 74 28 33 |oo.tex}}|..\put(3|
|00001f10| 30 2c 2d 33 35 29 7b 5c | 76 65 63 74 6f 72 28 34 |0,-35){\|vector(4|
|00001f20| 2c 2d 31 29 7b 32 30 7d | 7d 0a 5c 70 75 74 28 35 |,-1){20}|}.\put(5|
|00001f30| 30 2c 2d 34 38 2e 37 35 | 29 7b 5c 66 72 61 6d 65 |0,-48.75|){\frame|
|00001f40| 62 6f 78 28 33 30 2c 31 | 30 29 7b 66 6f 6f 2e 64 |box(30,1|0){foo.d|
|00001f50| 76 69 7d 7d 0a 5c 70 75 | 74 28 38 30 2c 2d 34 37 |vi}}.\pu|t(80,-47|
|00001f60| 2e 35 29 7b 5c 76 65 63 | 74 6f 72 28 34 2c 2d 31 |.5){\vec|tor(4,-1|
|00001f70| 29 7b 32 30 7d 7d 0a 5c | 70 75 74 28 31 30 30 2c |){20}}.\|put(100,|
|00001f80| 2d 35 32 2e 35 29 7b 5c | 6d 61 6b 65 62 6f 78 28 |-52.5){\|makebox(|
|00001f90| 30 2c 30 29 5b 6c 5d 7b | 5c 72 6d 5c 73 74 72 75 |0,0)[l]{|\rm\stru|
|00001fa0| 74 20 5c 20 54 79 70 65 | 73 65 74 20 64 6f 63 75 |t \ Type|set docu|
|00001fb0| 6d 65 6e 74 61 74 69 6f | 6e 20 66 6f 72 0a 7b 5c |mentatio|n for.{\|
|00001fc0| 74 74 20 66 6f 6f 7d 7d | 7d 0a 0a 5c 70 75 74 28 |tt foo}}|}..\put(|
|00001fd0| 33 30 2c 33 35 29 7b 5c | 76 65 63 74 6f 72 28 34 |30,35){\|vector(4|
|00001fe0| 2c 31 29 7b 32 30 7d 7d | 0a 5c 70 75 74 28 35 30 |,1){20}}|.\put(50|
|00001ff0| 2c 33 38 2e 37 35 29 7b | 5c 66 72 61 6d 65 62 6f |,38.75){|\framebo|
|00002000| 78 28 33 30 2c 31 30 29 | 7b 66 6f 6f 2e 6f 7d 7d |x(30,10)|{foo.o}}|
|00002010| 0a 5c 70 75 74 28 38 30 | 2c 34 37 2e 35 29 7b 5c |.\put(80|,47.5){\|
|00002020| 76 65 63 74 6f 72 28 34 | 2c 31 29 7b 32 30 7d 7d |vector(4|,1){20}}|
|00002030| 0a 5c 70 75 74 28 31 30 | 30 2c 35 32 2e 35 29 7b |.\put(10|0,52.5){|
|00002040| 5c 6d 61 6b 65 62 6f 78 | 28 30 2c 30 29 5b 6c 5d |\makebox|(0,0)[l]|
|00002050| 7b 5c 72 6d 5c 73 74 72 | 75 74 20 5c 20 45 78 65 |{\rm\str|ut \ Exe|
|00002060| 63 75 74 61 62 6c 65 20 | 5c 73 6c 20 66 6f 6f 7d |cutable |\sl foo}|
|00002070| 7d 0a 0a 0a 0a 5c 65 6e | 64 7b 70 69 63 74 75 72 |}....\en|d{pictur|
|00002080| 65 7d 0a 0a 5c 68 72 75 | 6c 65 0a 5c 65 6e 64 7b |e}..\hru|le.\end{|
|00002090| 66 69 67 75 72 65 7d 0a | 0a 5c 6d 65 64 73 6b 69 |figure}.|.\medski|
|000020a0| 70 0a 0a 41 20 7b 5c 74 | 74 20 57 45 42 7d 20 70 |p..A {\t|t WEB} p|
|000020b0| 72 6f 67 72 61 6d 20 69 | 73 20 61 20 63 6f 6c 6c |rogram i|s a coll|
|000020c0| 65 63 74 69 6f 6e 20 6f | 66 20 60 60 73 65 63 74 |ection o|f ``sect|
|000020d0| 69 6f 6e 73 2c 27 27 20 | 65 61 63 68 20 6f 66 20 |ions,'' |each of |
|000020e0| 77 68 69 63 68 20 68 61 | 73 20 61 0a 64 6f 63 75 |which ha|s a.docu|
|000020f0| 6d 65 6e 74 61 74 69 6f | 6e 20 70 61 72 74 2c 20 |mentatio|n part, |
|00002100| 61 20 64 65 66 69 6e 69 | 74 69 6f 6e 20 70 61 72 |a defini|tion par|
|00002110| 74 2c 20 61 6e 64 20 61 | 20 63 6f 64 65 20 70 61 |t, and a| code pa|
|00002120| 72 74 2e 0a 54 68 65 20 | 64 6f 63 75 6d 65 6e 74 |rt..The |document|
|00002130| 61 74 69 6f 6e 20 70 61 | 72 74 20 64 65 73 63 72 |ation pa|rt descr|
|00002140| 69 62 65 73 20 77 68 61 | 74 20 74 68 65 20 73 65 |ibes wha|t the se|
|00002150| 63 74 69 6f 6e 20 69 73 | 20 73 75 70 70 6f 73 65 |ction is| suppose|
|00002160| 64 20 74 6f 20 64 6f 2c | 0a 61 6e 64 20 69 73 20 |d to do,|.and is |
|00002170| 69 6e 74 65 6e 64 65 64 | 20 74 6f 20 62 65 20 70 |intended| to be p|
|00002180| 72 6f 63 65 73 73 65 64 | 20 62 79 20 61 20 66 6f |rocessed| by a fo|
|00002190| 72 6d 61 74 74 65 72 2d | 2d 2d 6d 79 20 7b 5c 74 |rmatter-|--my {\t|
|000021a0| 74 20 57 45 42 7d 73 20 | 75 73 65 0a 7b 5c 54 65 |t WEB}s |use.{\Te|
|000021b0| 58 7d 2c 20 77 68 69 63 | 68 20 69 73 20 65 73 70 |X}, whic|h is esp|
|000021c0| 65 63 69 61 6c 6c 79 20 | 63 6f 6e 76 65 6e 69 65 |ecially |convenie|
|000021d0| 6e 74 20 66 6f 72 20 6d | 61 74 68 65 6d 61 74 69 |nt for m|athemati|
|000021e0| 63 61 6c 20 73 79 6d 62 | 6f 6c 73 20 6c 69 6b 65 |cal symb|ols like|
|000021f0| 0a 74 68 6f 73 65 20 75 | 73 65 64 20 69 6e 20 77 |.those u|sed in w|
|00002200| 72 69 74 69 6e 67 20 61 | 20 66 6f 72 6d 61 6c 20 |riting a| formal |
|00002210| 73 65 6d 61 6e 74 69 63 | 73 2e 0a 54 68 65 20 64 |semantic|s..The d|
|00002220| 65 66 69 6e 69 74 69 6f | 6e 20 70 61 72 74 20 63 |efinitio|n part c|
|00002230| 6f 6e 74 61 69 6e 73 20 | 6d 61 63 72 6f 20 64 65 |ontains |macro de|
|00002240| 66 69 6e 69 74 69 6f 6e | 73 2e 0a 45 61 63 68 20 |finition|s..Each |
|00002250| 6d 61 63 72 6f 20 6d 61 | 79 20 68 61 76 65 20 70 |macro ma|y have p|
|00002260| 61 72 61 6d 65 74 65 72 | 73 20 6f 72 20 6e 6f 74 |arameter|s or not|
|00002270| 2c 20 61 73 20 74 68 65 | 20 70 72 6f 67 72 61 6d |, as the| program|
|00002280| 6d 65 72 20 63 68 6f 6f | 73 65 73 2e 0a 54 68 65 |mer choo|ses..The|
|00002290| 20 63 6f 64 65 20 69 6e | 20 74 68 65 20 63 6f 64 | code in| the cod|
|000022a0| 65 20 70 61 72 74 20 69 | 73 20 61 20 66 72 61 67 |e part i|s a frag|
|000022b0| 6d 65 6e 74 20 6f 66 20 | 74 68 65 20 77 68 6f 6c |ment of |the whol|
|000022c0| 65 20 70 72 6f 67 72 61 | 6d 2e 0a 49 74 20 69 73 |e progra|m..It is|
|000022d0| 20 63 61 6c 6c 65 64 20 | 61 20 60 60 6d 6f 64 75 | called |a ``modu|
|000022e0| 6c 65 27 27 20 61 6e 64 | 20 63 61 6e 20 62 65 20 |le'' and| can be |
|000022f0| 6e 61 6d 65 64 20 6f 72 | 20 75 6e 6e 61 6d 65 64 |named or| unnamed|
|00002300| 2e 0a 57 68 65 6e 20 74 | 68 65 20 6d 6f 64 75 6c |..When t|he modul|
|00002310| 65 20 69 73 20 6e 61 6d | 65 64 2c 20 74 68 65 20 |e is nam|ed, the |
|00002320| 6d 6f 64 75 6c 65 20 6e | 61 6d 65 20 60 60 73 74 |module n|ame ``st|
|00002330| 61 6e 64 73 20 66 6f 72 | 27 27 20 74 68 61 74 20 |ands for|'' that |
|00002340| 63 6f 64 65 2c 0a 6a 75 | 73 74 20 61 73 20 61 20 |code,.ju|st as a |
|00002350| 6d 61 63 72 6f 20 6e 61 | 6d 65 20 73 74 61 6e 64 |macro na|me stand|
|00002360| 73 20 66 6f 72 20 74 68 | 65 20 63 6f 64 65 20 69 |s for th|e code i|
|00002370| 6e 20 69 74 73 20 64 65 | 66 69 6e 69 74 69 6f 6e |n its de|finition|
|00002380| 2e 0a 54 68 65 20 75 6e | 6e 61 6d 65 64 20 6d 6f |..The un|named mo|
|00002390| 64 75 6c 65 20 69 73 20 | 73 70 65 63 69 61 6c 3b |dule is |special;|
|000023a0| 20 74 68 65 20 63 6f 64 | 65 20 69 6e 20 74 68 65 | the cod|e in the|
|000023b0| 20 75 6e 6e 61 6d 65 64 | 20 6d 6f 64 75 6c 65 20 | unnamed| module |
|000023c0| 69 73 0a 63 6f 6e 73 69 | 64 65 72 65 64 20 74 6f |is.consi|dered to|
|000023d0| 20 62 65 20 60 60 74 68 | 65 20 70 72 6f 67 72 61 | be ``th|e progra|
|000023e0| 6d 2e 27 27 0a 0a 46 69 | 67 75 72 65 7e 5c 72 65 |m.''..Fi|gure~\re|
|000023f0| 66 7b 66 72 61 67 6d 65 | 6e 74 7d 20 73 68 6f 77 |f{fragme|nt} show|
|00002400| 73 20 61 20 66 72 61 67 | 6d 65 6e 74 20 6f 66 20 |s a frag|ment of |
|00002410| 61 20 7b 5c 74 74 20 57 | 45 42 7d 20 70 72 6f 67 |a {\tt W|EB} prog|
|00002420| 72 61 6d 3b 20 74 68 65 | 0a 66 72 61 67 6d 65 6e |ram; the|.fragmen|
|00002430| 74 20 69 6e 76 65 72 74 | 73 20 61 6e 20 0a 45 42 |t invert|s an .EB|
|00002440| 43 44 49 43 2d 74 6f 2d | 41 53 43 49 49 20 74 61 |CDIC-to-|ASCII ta|
|00002450| 62 6c 65 20 74 6f 20 6f | 62 74 61 69 6e 20 61 6e |ble to o|btain an|
|00002460| 20 41 53 43 49 49 2d 74 | 6f 2d 45 42 43 44 49 43 | ASCII-t|o-EBCDIC|
|00002470| 20 74 61 62 6c 65 2e 0a | 54 68 65 20 74 61 72 67 | table..|The targ|
|00002480| 65 74 20 70 72 6f 67 72 | 61 6d 6d 69 6e 67 20 6c |et progr|amming l|
|00002490| 61 6e 67 75 61 67 65 20 | 69 73 20 43 2e 0a 4f 6e |anguage |is C..On|
|000024a0| 65 20 6d 6f 64 75 6c 65 | 2c 20 5c 58 3a 49 6e 76 |e module|, \X:Inv|
|000024b0| 65 72 74 20 7b 5c 69 74 | 20 74 6f 5c 5f 61 73 63 |ert {\it| to\_asc|
|000024c0| 69 69 7d 2c 20 70 72 6f | 64 75 63 69 6e 67 20 7b |ii}, pro|ducing {|
|000024d0| 5c 69 74 20 74 6f 5c 5f | 65 62 63 64 69 63 7d 5c |\it to\_|ebcdic}\|
|000024e0| 58 2c 0a 75 73 65 73 20 | 74 68 65 20 63 6f 64 65 |X,.uses |the code|
|000024f0| 20 64 65 66 69 6e 65 64 | 20 69 6e 20 74 68 65 20 | defined| in the |
|00002500| 6f 74 68 65 72 2c 20 5c | 58 3a 53 65 74 20 24 7b |other, \|X:Set ${|
|00002510| 5c 69 74 0a 74 6f 5c 5f | 65 62 63 64 69 63 7d 5b |\it.to\_|ebcdic}[|
|00002520| 69 5d 5c 6c 65 66 74 61 | 72 72 6f 77 20 7b 5c 69 |i]\lefta|rrow {\i|
|00002530| 74 20 55 4e 44 45 46 49 | 4e 45 44 5c 5f 43 4f 44 |t UNDEFI|NED\_COD|
|00002540| 45 7d 24 20 66 6f 72 20 | 61 6c 6c 20 24 69 24 5c |E}$ for |all $i$\|
|00002550| 58 2e 0a 54 68 65 20 70 | 72 6f 67 72 61 6d 2c 20 |X..The p|rogram, |
|00002560| 7b 5c 74 74 20 66 6f 6f | 7d 2c 20 6f 66 20 77 68 |{\tt foo|}, of wh|
|00002570| 69 63 68 20 74 68 69 73 | 20 66 72 61 67 6d 65 6e |ich this| fragmen|
|00002580| 74 20 69 73 20 61 20 70 | 61 72 74 2c 20 63 61 6e |t is a p|art, can|
|00002590| 20 62 65 20 69 6e 70 75 | 74 0a 74 6f 20 7b 5c 74 | be inpu|t.to {\t|
|000025a0| 74 20 43 54 41 4e 47 4c | 45 7d 20 61 6e 64 20 7b |t CTANGL|E} and {|
|000025b0| 5c 74 74 20 43 57 45 41 | 56 45 7d 2c 20 74 6f 20 |\tt CWEA|VE}, to |
|000025c0| 70 72 6f 64 75 63 65 20 | 7b 5c 74 74 20 66 6f 6f |produce |{\tt foo|
|000025d0| 2e 63 7d 20 61 6e 64 20 | 7b 5c 74 74 0a 66 6f 6f |.c} and |{\tt.foo|
|000025e0| 2e 74 65 78 7d 20 72 65 | 73 70 65 63 74 69 76 65 |.tex} re|spective|
|000025f0| 6c 79 2c 20 61 73 20 73 | 68 6f 77 6e 20 69 6e 20 |ly, as s|hown in |
|00002600| 46 69 67 75 72 65 7e 5c | 72 65 66 7b 69 6e 73 74 |Figure~\|ref{inst|
|00002610| 61 6e 63 65 7d 2e 0a 0a | 5c 62 65 67 69 6e 7b 66 |ance}...|\begin{f|
|00002620| 69 67 75 72 65 7d 0a 5c | 63 61 70 74 69 6f 6e 7b |igure}.\|caption{|
|00002630| 54 61 62 6c 65 20 49 6e | 76 65 72 73 69 6f 6e 7d |Table In|version}|
|00002640| 0a 5c 6c 61 62 65 6c 7b | 66 72 61 67 6d 65 6e 74 |.\label{|fragment|
|00002650| 7d 0a 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |}.\begin|{verbati|
|00002660| 6d 7d 0a 40 20 54 68 65 | 20 61 72 72 61 79 20 7c |m}.@ The| array ||
|00002670| 74 6f 5f 61 73 63 69 69 | 7c 20 63 6f 6e 76 65 72 |to_ascii|| conver|
|00002680| 74 73 20 61 6e 20 45 42 | 43 44 49 43 20 63 6f 64 |ts an EB|CDIC cod|
|00002690| 65 20 74 6f 20 0a 61 6e | 20 41 53 43 49 49 20 63 |e to .an| ASCII c|
|000026a0| 6f 64 65 2c 20 6f 72 20 | 74 6f 20 7c 2d 31 7c 20 |ode, or |to |-1| |
|000026b0| 69 66 20 74 68 65 72 65 | 20 69 73 20 6e 6f 20 41 |if there| is no A|
|000026c0| 53 43 49 49 20 0a 65 71 | 75 69 76 61 6c 65 6e 74 |SCII .eq|uivalent|
|000026d0| 20 74 6f 20 74 68 65 20 | 67 69 76 65 6e 20 63 6f | to the |given co|
|000026e0| 64 65 2e 0a 40 64 20 55 | 4e 44 45 46 49 4e 45 44 |de..@d U|NDEFINED|
|000026f0| 5f 43 4f 44 45 20 3d 20 | 2d 31 0a 40 3c 49 6e 76 |_CODE = |-1.@<Inv|
|00002700| 65 72 74 20 7c 74 6f 5f | 61 73 63 69 69 7c 2c 20 |ert |to_|ascii|, |
|00002710| 70 72 6f 64 75 63 69 6e | 67 20 7c 74 6f 5f 65 62 |producin|g |to_eb|
|00002720| 63 64 69 63 7c 40 3e 3d | 0a 20 20 20 20 40 3c 53 |cdic|@>=|. @<S|
|00002730| 65 74 20 7c 74 6f 5f 65 | 62 63 64 69 63 5b 69 5d |et |to_e|bcdic[i]|
|00002740| 3d 55 4e 44 45 46 49 4e | 45 44 5f 43 4f 44 45 7c |=UNDEFIN|ED_CODE||
|00002750| 20 66 6f 72 20 61 6c 6c | 20 7c 69 7c 40 3e 40 3b | for all| |i|@>@;|
|00002760| 0a 20 20 20 20 66 6f 72 | 20 28 69 3d 30 3b 20 69 |. for| (i=0; i|
|00002770| 3c 32 35 36 3b 20 69 2b | 2b 29 0a 20 20 20 20 20 |<256; i+|+). |
|00002780| 20 20 20 69 66 20 28 74 | 6f 5f 61 73 63 69 69 5b | if (t|o_ascii[|
|00002790| 69 5d 20 21 3d 20 55 4e | 44 45 46 49 4e 45 44 5f |i] != UN|DEFINED_|
|000027a0| 43 4f 44 45 29 0a 20 20 | 20 20 20 20 20 20 20 20 |CODE). | |
|000027b0| 20 20 74 6f 5f 65 62 63 | 64 69 63 5b 74 6f 5f 61 | to_ebc|dic[to_a|
|000027c0| 73 63 69 69 5b 69 5d 5d | 3d 69 3b 0a 0a 40 20 40 |scii[i]]|=i;..@ @|
|000027d0| 3c 53 65 74 20 7c 74 6f | 5f 65 62 63 64 69 63 5b |<Set |to|_ebcdic[|
|000027e0| 69 5d 3d 55 4e 44 45 46 | 49 4e 45 44 5f 43 4f 44 |i]=UNDEF|INED_COD|
|000027f0| 45 7c 20 66 6f 72 20 61 | 6c 6c 20 7c 69 7c 40 3e |E| for a|ll |i|@>|
|00002800| 3d 0a 20 20 20 20 66 6f | 72 20 28 69 3d 30 3b 20 |=. fo|r (i=0; |
|00002810| 69 3c 31 32 38 3b 20 69 | 2b 2b 29 20 74 6f 5f 65 |i<128; i|++) to_e|
|00002820| 62 63 64 69 63 5b 69 5d | 20 3d 20 55 4e 44 45 46 |bcdic[i]| = UNDEF|
|00002830| 49 4e 45 44 5f 43 4f 44 | 45 3b 0a 5c 65 6e 64 7b |INED_COD|E;.\end{|
|00002840| 76 65 72 62 61 74 69 6d | 7d 0a 5c 68 72 75 6c 65 |verbatim|}.\hrule|
|00002850| 0a 5c 65 6e 64 7b 66 69 | 67 75 72 65 7d 0a 0a 0a |.\end{fi|gure}...|
|00002860| 0a 7b 5c 74 74 20 54 41 | 4e 47 4c 45 7d 27 73 20 |.{\tt TA|NGLE}'s |
|00002870| 6a 6f 62 20 69 73 20 74 | 6f 20 74 61 6b 65 20 61 |job is t|o take a|
|00002880| 20 20 63 6f 6c 6c 65 63 | 74 69 6f 6e 20 6f 66 20 | collec|tion of |
|00002890| 73 65 63 74 69 6f 6e 73 | 20 61 6e 64 20 74 6f 0a |sections| and to.|
|000028a0| 70 72 6f 64 75 63 65 20 | 61 20 63 6f 6d 70 69 6c |produce |a compil|
|000028b0| 61 62 6c 65 20 70 72 6f | 67 72 61 6d 2e 0a 7b 5c |able pro|gram..{\|
|000028c0| 74 74 20 54 41 4e 47 4c | 45 7d 20 72 65 61 64 73 |tt TANGL|E} reads|
|000028d0| 20 61 6c 6c 20 74 68 65 | 20 73 65 63 74 69 6f 6e | all the| section|
|000028e0| 73 2c 20 73 6b 69 70 70 | 69 6e 67 20 74 68 65 20 |s, skipp|ing the |
|000028f0| 64 6f 63 75 6d 65 6e 74 | 61 74 69 6f 6e 20 70 61 |document|ation pa|
|00002900| 72 74 73 0a 63 6f 6d 70 | 6c 65 74 65 6c 79 2c 20 |rts.comp|letely, |
|00002910| 62 75 74 20 73 74 6f 72 | 69 6e 67 20 74 68 65 20 |but stor|ing the |
|00002920| 6d 61 63 72 6f 20 64 65 | 66 69 6e 69 74 69 6f 6e |macro de|finition|
|00002930| 73 20 66 72 6f 6d 20 74 | 68 65 20 64 65 66 69 6e |s from t|he defin|
|00002940| 69 74 69 6f 6e 20 70 61 | 72 74 73 0a 61 6e 64 20 |ition pa|rts.and |
|00002950| 74 68 65 20 6d 6f 64 75 | 6c 65 20 64 65 66 69 6e |the modu|le defin|
|00002960| 69 74 69 6f 6e 73 20 66 | 72 6f 6d 20 74 68 65 20 |itions f|rom the |
|00002970| 63 6f 64 65 20 70 61 72 | 74 73 2e 0a 41 66 74 65 |code par|ts..Afte|
|00002980| 72 20 69 74 20 68 61 73 | 20 72 65 61 64 20 61 6c |r it has| read al|
|00002990| 6c 20 74 68 65 20 73 65 | 63 74 69 6f 6e 73 2c 20 |l the se|ctions, |
|000029a0| 7b 5c 74 74 20 54 41 4e | 47 4c 45 7d 20 74 68 65 |{\tt TAN|GLE} the|
|000029b0| 6e 0a 77 72 69 74 65 73 | 20 6f 75 74 20 74 68 65 |n.writes| out the|
|000029c0| 20 63 6f 64 65 20 69 6e | 20 74 68 65 20 75 6e 6e | code in| the unn|
|000029d0| 61 6d 65 64 20 6d 6f 64 | 75 6c 65 2e 0a 42 75 74 |amed mod|ule..But|
|000029e0| 20 77 68 65 6e 65 76 65 | 72 20 69 74 20 65 6e 63 | wheneve|r it enc|
|000029f0| 6f 75 6e 74 65 72 73 20 | 61 20 6d 6f 64 75 6c 65 |ounters |a module|
|00002a00| 20 6e 61 6d 65 20 69 6e | 20 74 68 61 74 20 63 6f | name in| that co|
|00002a10| 64 65 2c 20 69 6e 73 74 | 65 61 64 20 6f 66 0a 77 |de, inst|ead of.w|
|00002a20| 72 69 74 69 6e 67 20 6f | 75 74 20 74 68 65 20 6e |riting o|ut the n|
|00002a30| 61 6d 65 2c 20 69 74 20 | 77 72 69 74 65 73 20 6f |ame, it |writes o|
|00002a40| 75 74 20 74 68 65 20 63 | 6f 64 65 20 66 6f 72 20 |ut the c|ode for |
|00002a50| 77 68 69 63 68 20 74 68 | 69 73 20 6e 61 6d 65 0a |which th|is name.|
|00002a60| 73 74 61 6e 64 73 2e 20 | 0a 54 68 61 74 20 63 6f |stands. |.That co|
|00002a70| 64 65 20 6d 61 79 20 69 | 74 73 65 6c 66 20 63 6f |de may i|tself co|
|00002a80| 6e 74 61 69 6e 20 6d 6f | 64 75 6c 65 20 6e 61 6d |ntain mo|dule nam|
|00002a90| 65 73 2c 20 77 68 69 63 | 68 20 61 72 65 20 72 65 |es, whic|h are re|
|00002aa0| 70 6c 61 63 65 64 20 77 | 69 74 68 20 74 68 65 0a |placed w|ith the.|
|00002ab0| 63 6f 64 65 20 66 6f 72 | 20 77 68 69 63 68 20 74 |code for| which t|
|00002ac0| 68 65 79 20 73 74 61 6e | 64 2c 20 61 6e 64 20 73 |hey stan|d, and s|
|00002ad0| 6f 20 6f 6e 20 75 6e 74 | 69 6c 20 7b 5c 74 74 20 |o on unt|il {\tt |
|00002ae0| 54 41 4e 47 4c 45 7d 20 | 72 65 61 63 68 65 73 20 |TANGLE} |reaches |
|00002af0| 63 6f 64 65 0a 77 68 69 | 63 68 20 63 6f 6e 74 61 |code.whi|ch conta|
|00002b00| 69 6e 73 20 6e 6f 20 6f | 63 63 75 72 72 65 6e 63 |ins no o|ccurrenc|
|00002b10| 65 73 20 6f 66 20 6d 6f | 64 75 6c 65 20 6e 61 6d |es of mo|dule nam|
|00002b20| 65 73 2e 0a 7b 5c 74 74 | 20 54 41 4e 47 4c 45 7d |es..{\tt| TANGLE}|
|00002b30| 20 70 72 6f 63 65 73 73 | 65 73 20 6d 61 63 72 6f | process|es macro|
|00002b40| 73 20 73 69 6d 69 6c 61 | 72 6c 79 2c 20 65 78 63 |s simila|rly, exc|
|00002b50| 65 70 74 20 74 68 61 74 | 20 6d 61 63 72 6f 73 20 |ept that| macros |
|00002b60| 6d 61 79 0a 68 61 76 65 | 20 70 61 72 61 6d 65 74 |may.have| paramet|
|00002b70| 65 72 73 20 28 6d 6f 64 | 75 6c 65 73 20 6d 61 79 |ers (mod|ules may|
|00002b80| 20 6e 6f 74 29 2e 0a 0a | 41 73 20 49 27 76 65 20 | not)...|As I've |
|00002b90| 64 65 73 63 72 69 62 65 | 64 20 69 74 2c 20 74 68 |describe|d it, th|
|00002ba0| 65 20 60 60 65 73 73 65 | 6e 63 65 20 6f 66 20 74 |e ``esse|nce of t|
|00002bb0| 61 6e 67 6c 69 6e 67 27 | 27 20 69 73 0a 6c 61 6e |angling'|' is.lan|
|00002bc0| 67 75 61 67 65 2d 69 6e | 64 65 70 65 6e 64 65 6e |guage-in|dependen|
|00002bd0| 74 2e 20 0a 49 6e 20 74 | 68 65 20 66 75 6c 6c 20 |t. .In t|he full |
|00002be0| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 20 6f |implemen|tation o|
|00002bf0| 66 20 7b 5c 74 74 20 54 | 41 4e 47 4c 45 7d 20 74 |f {\tt T|ANGLE} t|
|00002c00| 68 65 72 65 20 61 72 65 | 20 6f 6e 6c 79 20 61 20 |here are| only a |
|00002c10| 66 65 77 0a 6c 61 6e 67 | 75 61 67 65 2d 64 65 70 |few.lang|uage-dep|
|00002c20| 65 6e 64 65 6e 74 20 64 | 65 74 61 69 6c 73 2c 20 |endent d|etails, |
|00002c30| 61 6e 64 20 61 6c 6d 6f | 73 74 20 61 6c 6c 20 6f |and almo|st all o|
|00002c40| 66 20 74 68 65 6d 20 63 | 6f 6d 65 20 75 70 20 6f |f them c|ome up o|
|00002c50| 6e 6c 79 20 69 6e 0a 6c | 65 78 69 63 61 6c 20 61 |nly in.l|exical a|
|00002c60| 6e 61 6c 79 73 69 73 2e | 20 0a 44 75 72 69 6e 67 |nalysis.| .During|
|00002c70| 20 69 74 73 20 69 6e 70 | 75 74 20 70 68 61 73 65 | its inp|ut phase|
|00002c80| 2c 20 7b 5c 74 74 20 54 | 41 4e 47 4c 45 7d 20 63 |, {\tt T|ANGLE} c|
|00002c90| 6f 6e 76 65 72 74 73 20 | 6d 61 63 72 6f 20 64 65 |onverts |macro de|
|00002ca0| 66 69 6e 69 74 69 6f 6e | 73 20 61 6e 64 0a 6d 6f |finition|s and.mo|
|00002cb0| 64 75 6c 65 20 64 65 66 | 69 6e 69 74 69 6f 6e 73 |dule def|initions|
|00002cc0| 20 69 6e 74 6f 20 74 6f | 6b 65 6e 20 6c 69 73 74 | into to|ken list|
|00002cd0| 73 2e 0a 25 25 25 45 76 | 65 72 79 20 74 6f 6b 65 |s..%%%Ev|ery toke|
|00002ce0| 6e 20 69 73 20 72 65 70 | 72 65 73 65 6e 74 65 64 |n is rep|resented|
|00002cf0| 20 75 73 69 6e 67 20 65 | 69 74 68 65 72 20 65 69 | using e|ither ei|
|00002d00| 67 68 74 20 6f 72 20 73 | 69 78 74 65 65 6e 20 62 |ght or s|ixteen b|
|00002d10| 69 74 73 2e 0a 54 68 65 | 20 6d 61 6a 6f 72 20 6b |its..The| major k|
|00002d20| 69 6e 64 73 20 6f 66 20 | 74 6f 6b 65 6e 73 20 61 |inds of |tokens a|
|00002d30| 72 65 0a 6d 6f 64 75 6c | 65 20 6e 61 6d 65 20 74 |re.modul|e name t|
|00002d40| 6f 6b 65 6e 73 2c 20 69 | 64 65 6e 74 69 66 69 65 |okens, i|dentifie|
|00002d50| 72 20 74 6f 6b 65 6e 73 | 2c 20 61 6e 64 20 6f 72 |r tokens|, and or|
|00002d60| 64 69 6e 61 72 79 20 74 | 6f 6b 65 6e 73 2e 0a 49 |dinary t|okens..I|
|00002d70| 64 65 6e 74 69 66 69 65 | 72 20 74 6f 6b 65 6e 73 |dentifie|r tokens|
|00002d80| 20 6d 61 79 20 62 65 20 | 65 78 70 61 6e 64 61 62 | may be |expandab|
|00002d90| 6c 65 20 28 77 68 65 6e | 20 74 68 65 79 20 61 72 |le (when| they ar|
|00002da0| 65 20 6d 61 63 72 6f 20 | 6e 61 6d 65 73 29 20 6f |e macro |names) o|
|00002db0| 72 0a 75 6e 65 78 70 61 | 6e 64 61 62 6c 65 20 28 |r.unexpa|ndable (|
|00002dc0| 77 68 65 6e 20 74 68 65 | 79 20 61 72 65 20 70 72 |when the|y are pr|
|00002dd0| 6f 67 72 61 6d 6d 69 6e | 67 2d 6c 61 6e 67 75 61 |ogrammin|g-langua|
|00002de0| 67 65 20 69 64 65 6e 74 | 69 66 69 65 72 73 29 2e |ge ident|ifiers).|
|00002df0| 0a 4d 6f 64 75 6c 65 20 | 6e 61 6d 65 20 74 6f 6b |.Module |name tok|
|00002e00| 65 6e 73 20 61 72 65 20 | 61 6c 77 61 79 73 20 65 |ens are |always e|
|00002e10| 78 70 61 6e 64 61 62 6c | 65 2c 20 61 6e 64 20 6f |xpandabl|e, and o|
|00002e20| 72 64 69 6e 61 72 79 20 | 74 6f 6b 65 6e 73 20 61 |rdinary |tokens a|
|00002e30| 72 65 0a 6e 65 76 65 72 | 20 65 78 70 61 6e 64 61 |re.never| expanda|
|00002e40| 62 6c 65 2e 0a 7b 5c 74 | 74 20 54 41 4e 47 4c 45 |ble..{\t|t TANGLE|
|00002e50| 7d 20 75 73 65 73 20 61 | 20 73 74 61 63 6b 20 74 |} uses a| stack t|
|00002e60| 6f 20 77 72 69 74 65 20 | 6f 75 74 20 74 68 65 20 |o write |out the |
|00002e70| 74 6f 6b 65 6e 20 6c 69 | 73 74 20 63 6f 72 72 65 |token li|st corre|
|00002e80| 73 70 6f 6e 64 69 6e 67 | 20 74 6f 0a 74 68 65 20 |sponding| to.the |
|00002e90| 75 6e 6e 61 6d 65 64 20 | 6d 6f 64 75 6c 65 2c 20 |unnamed |module, |
|00002ea0| 65 78 70 61 6e 64 69 6e | 67 20 65 78 70 61 6e 64 |expandin|g expand|
|00002eb0| 61 62 6c 65 20 74 6f 6b | 65 6e 73 20 61 73 20 69 |able tok|ens as i|
|00002ec0| 74 20 67 6f 65 73 2e 0a | 4e 6f 20 74 6f 6b 65 6e |t goes..|No token|
|00002ed0| 20 69 73 20 65 76 65 72 | 20 65 78 70 61 6e 64 65 | is ever| expande|
|00002ee0| 64 20 75 6e 74 69 6c 20 | 74 68 65 20 74 69 6d 65 |d until |the time|
|00002ef0| 20 63 6f 6d 65 73 20 74 | 6f 20 77 72 69 74 65 20 | comes t|o write |
|00002f00| 74 68 61 74 20 74 6f 6b | 65 6e 20 6f 6e 0a 74 68 |that tok|en on.th|
|00002f10| 65 20 6f 75 74 70 75 74 | 2e 0a 0a 54 6f 20 62 75 |e output|...To bu|
|00002f20| 69 6c 64 20 74 68 65 20 | 6c 61 6e 67 75 61 67 65 |ild the |language|
|00002f30| 2d 64 65 70 65 6e 64 65 | 6e 74 20 70 61 72 74 20 |-depende|nt part |
|00002f40| 6f 66 20 7b 5c 74 74 20 | 54 41 4e 47 4c 45 7d 2c |of {\tt |TANGLE},|
|00002f50| 20 69 74 20 69 73 20 65 | 6e 6f 75 67 68 20 74 6f | it is e|nough to|
|00002f60| 0a 74 65 6c 6c 20 7b 5c | 74 74 20 54 41 4e 47 4c |.tell {\|tt TANGL|
|00002f70| 45 7d 20 68 6f 77 20 74 | 6f 20 74 6f 6b 65 6e 69 |E} how t|o tokeni|
|00002f80| 7a 65 20 74 68 65 20 69 | 6e 70 75 74 20 61 6e 64 |ze the i|nput and|
|00002f90| 20 68 6f 77 20 74 6f 20 | 77 72 69 74 65 20 6f 75 | how to |write ou|
|00002fa0| 74 20 61 0a 74 6f 6b 65 | 6e 20 6c 69 73 74 2e 0a |t a.toke|n list..|
|00002fb0| 7b 5c 74 74 20 54 41 4e | 47 4c 45 7d 20 75 73 65 |{\tt TAN|GLE} use|
|00002fc0| 73 20 61 20 60 60 6c 6f | 77 65 73 74 20 63 6f 6d |s a ``lo|west com|
|00002fd0| 6d 6f 6e 20 64 65 6e 6f | 6d 69 6e 61 74 6f 72 27 |mon deno|minator'|
|00002fe0| 27 20 6c 65 78 69 63 61 | 6c 20 61 6e 61 6c 79 7a |' lexica|l analyz|
|00002ff0| 65 72 20 74 6f 0a 74 6f | 6b 65 6e 69 7a 65 20 69 |er to.to|kenize i|
|00003000| 74 73 20 69 6e 70 75 74 | 2e 0a 54 68 65 20 73 65 |ts input|..The se|
|00003010| 74 20 6f 66 20 74 6f 6b | 65 6e 73 20 72 65 63 6f |t of tok|ens reco|
|00003020| 67 6e 69 7a 65 64 20 62 | 79 20 74 68 69 73 20 6c |gnized b|y this l|
|00003030| 65 78 69 63 61 6c 20 61 | 6e 61 6c 79 7a 65 72 20 |exical a|nalyzer |
|00003040| 69 73 20 74 68 65 20 75 | 6e 69 6f 6e 20 6f 66 0a |is the u|nion of.|
|00003050| 74 68 65 20 73 65 74 73 | 20 6f 66 20 6c 65 67 61 |the sets| of lega|
|00003060| 6c 20 74 6f 6b 65 6e 73 | 20 6f 66 20 6d 61 6e 79 |l tokens| of many|
|00003070| 20 64 69 66 66 65 72 65 | 6e 74 20 6c 61 6e 67 75 | differe|nt langu|
|00003080| 61 67 65 73 2e 0a 46 6f | 72 20 65 78 61 6d 70 6c |ages..Fo|r exampl|
|00003090| 65 2c 20 64 69 66 66 65 | 72 65 6e 74 20 77 61 79 |e, diffe|rent way|
|000030a0| 73 20 6f 66 20 64 65 6c | 69 6d 69 74 69 6e 67 20 |s of del|imiting |
|000030b0| 73 74 72 69 6e 67 20 6c | 69 74 65 72 61 6c 73 20 |string l|iterals |
|000030c0| 61 72 65 0a 72 65 63 6f | 67 6e 69 7a 65 64 2e 20 |are.reco|gnized. |
|000030d0| 0a 49 64 65 6e 74 69 66 | 69 65 72 73 20 6d 61 79 |.Identif|iers may|
|000030e0| 20 68 61 76 65 20 75 6e | 64 65 72 73 63 6f 72 65 | have un|derscore|
|000030f0| 73 2c 20 65 76 65 6e 20 | 74 68 6f 75 67 68 20 73 |s, even |though s|
|00003100| 6f 6d 65 20 6c 61 6e 67 | 75 61 67 65 73 0a 28 65 |ome lang|uages.(e|
|00003110| 2e 67 2e 7e 50 61 73 63 | 61 6c 29 20 6d 61 79 20 |.g.~Pasc|al) may |
|00003120| 6e 6f 74 20 70 65 72 6d | 69 74 20 75 6e 64 65 72 |not perm|it under|
|00003130| 73 63 6f 72 65 73 20 69 | 6e 20 69 64 65 6e 74 69 |scores i|n identi|
|00003140| 66 69 65 72 73 2c 20 61 | 6e 64 20 6f 74 68 65 72 |fiers, a|nd other|
|00003150| 73 0a 28 65 2e 67 2e 7e | 41 64 61 29 20 6d 61 79 |s.(e.g.~|Ada) may|
|00003160| 20 6e 6f 74 20 70 65 72 | 6d 69 74 20 63 6f 6e 73 | not per|mit cons|
|00003170| 65 63 75 74 69 76 65 20 | 75 6e 64 65 72 73 63 6f |ecutive |undersco|
|00003180| 72 65 73 20 69 6e 20 61 | 6e 20 69 64 65 6e 74 69 |res in a|n identi|
|00003190| 66 69 65 72 2e 0a 49 6e | 20 67 65 6e 65 72 61 6c |fier..In| general|
|000031a0| 2c 20 7b 5c 74 74 20 54 | 41 4e 47 4c 45 7d 20 61 |, {\tt T|ANGLE} a|
|000031b0| 6e 64 20 7b 5c 74 74 20 | 57 45 41 56 45 7d 20 64 |nd {\tt |WEAVE} d|
|000031c0| 6f 20 74 68 65 20 72 69 | 67 68 74 20 74 68 69 6e |o the ri|ght thin|
|000031d0| 67 20 77 69 74 68 20 6c | 65 67 61 6c 0a 70 72 6f |g with l|egal.pro|
|000031e0| 67 72 61 6d 73 2c 20 62 | 75 74 20 74 68 65 79 20 |grams, b|ut they |
|000031f0| 64 6f 20 6e 6f 74 20 64 | 65 74 65 63 74 20 69 6c |do not d|etect il|
|00003200| 6c 65 67 61 6c 69 74 69 | 65 73 20 69 6e 20 61 20 |legaliti|es in a |
|00003210| 70 72 6f 67 72 61 6d 2e | 0a 0a 7b 5c 74 74 20 54 |program.|..{\tt T|
|00003220| 41 4e 47 4c 45 7d 27 73 | 20 6c 65 78 69 63 61 6c |ANGLE}'s| lexical|
|00003230| 20 61 6e 61 6c 79 7a 65 | 72 20 72 65 63 6f 67 6e | analyze|r recogn|
|00003240| 69 7a 65 73 20 61 20 66 | 69 78 65 64 20 73 65 74 |izes a f|ixed set|
|00003250| 20 6f 66 20 74 6f 6b 65 | 6e 73 0a 72 65 70 72 65 | of toke|ns.repre|
|00003260| 73 65 6e 74 69 6e 67 20 | 69 64 65 6e 74 69 66 69 |senting |identifi|
|00003270| 65 72 73 2c 20 73 74 72 | 69 6e 67 20 6c 69 74 65 |ers, str|ing lite|
|00003280| 72 61 6c 73 2c 20 61 6e | 64 20 6e 75 6d 65 72 69 |rals, an|d numeri|
|00003290| 63 20 6c 69 74 65 72 61 | 6c 73 2e 0a 41 6e 79 20 |c litera|ls..Any |
|000032a0| 70 72 69 6e 74 61 62 6c | 65 20 41 53 43 49 49 20 |printabl|e ASCII |
|000032b0| 63 68 61 72 61 63 74 65 | 72 20 77 68 69 63 68 20 |characte|r which |
|000032c0| 69 73 20 6e 6f 74 20 70 | 61 72 74 20 6f 66 20 73 |is not p|art of s|
|000032d0| 6f 6d 65 20 6f 74 68 65 | 72 0a 74 6f 6b 65 6e 20 |ome othe|r.token |
|000032e0| 66 6f 72 6d 73 20 61 20 | 74 6f 6b 65 6e 20 61 6c |forms a |token al|
|000032f0| 6c 20 62 79 20 69 74 73 | 65 6c 66 2e 0a 41 20 7b |l by its|elf..A {|
|00003300| 5c 74 74 20 57 45 42 7d | 20 62 75 69 6c 64 65 72 |\tt WEB}| builder|
|00003310| 20 63 61 6e 20 73 70 65 | 63 69 66 79 20 74 68 61 | can spe|cify tha|
|00003320| 74 20 63 65 72 74 61 69 | 6e 20 73 74 72 69 6e 67 |t certai|n string|
|00003330| 73 20 73 68 6f 75 6c 64 | 0a 62 65 20 74 72 65 61 |s should|.be trea|
|00003340| 74 65 64 20 61 73 20 73 | 69 6e 67 6c 65 20 74 6f |ted as s|ingle to|
|00003350| 6b 65 6e 73 2c 20 61 6e | 64 0a 7b 5c 74 74 20 53 |kens, an|d.{\tt S|
|00003360| 50 49 44 45 52 7d 20 77 | 69 6c 6c 20 63 6f 6e 76 |PIDER} w|ill conv|
|00003370| 65 72 74 20 74 68 65 20 | 73 70 65 63 69 66 69 63 |ert the |specific|
|00003380| 61 74 69 6f 6e 73 20 69 | 6e 74 6f 20 61 70 70 72 |ations i|nto appr|
|00003390| 6f 70 72 69 61 74 65 20 | 63 6f 64 65 20 66 6f 72 |opriate |code for|
|000033a0| 0a 7b 5c 74 74 20 54 41 | 4e 47 4c 45 7d 2e 0a 46 |.{\tt TA|NGLE}..F|
|000033b0| 6f 72 20 65 78 61 6d 70 | 6c 65 2c 20 77 68 65 6e |or examp|le, when|
|000033c0| 20 62 75 69 6c 64 69 6e | 67 20 7b 5c 74 74 20 57 | buildin|g {\tt W|
|000033d0| 45 42 7d 20 66 6f 72 7e | 43 2c 20 77 65 20 74 65 |EB} for~|C, we te|
|000033e0| 6c 6c 20 7b 5c 74 74 20 | 53 50 49 44 45 52 7d 20 |ll {\tt |SPIDER} |
|000033f0| 0a 74 68 61 74 20 74 68 | 65 20 73 74 72 69 6e 67 |.that th|e string|
|00003400| 73 20 7b 5c 74 74 20 2b | 2b 7d 2c 20 7b 5c 74 74 |s {\tt +|+}, {\tt|
|00003410| 20 3d 3d 7d 2c 20 61 6e | 64 20 7b 5c 74 74 20 5c | ==}, an|d {\tt \|
|00003420| 26 5c 26 7d 20 28 61 6e | 64 20 6d 61 6e 79 20 6f |&\&} (an|d many o|
|00003430| 74 68 65 72 73 29 0a 73 | 68 6f 75 6c 64 20 62 65 |thers).s|hould be|
|00003440| 20 74 72 65 61 74 65 64 | 20 61 73 20 73 69 6e 67 | treated| as sing|
|00003450| 6c 65 20 74 6f 6b 65 6e | 73 2c 20 62 79 20 70 75 |le token|s, by pu|
|00003460| 74 74 69 6e 67 20 74 68 | 65 20 73 74 61 74 65 6d |tting th|e statem|
|00003470| 65 6e 74 73 0a 5c 62 65 | 67 69 6e 7b 71 75 6f 74 |ents.\be|gin{quot|
|00003480| 65 7d 5c 74 74 0a 74 6f | 6b 65 6e 20 2b 2b 20 2e |e}\tt.to|ken ++ .|
|00003490| 2e 2e 5c 5c 0a 74 6f 6b | 65 6e 20 3d 3d 20 2e 2e |..\\.tok|en == ..|
|000034a0| 2e 5c 5c 0a 74 6f 6b 65 | 6e 20 5c 26 5c 26 5c 20 |.\\.toke|n \&\&\ |
|000034b0| 2e 2e 2e 0a 5c 65 6e 64 | 7b 71 75 6f 74 65 7d 0a |....\end|{quote}.|
|000034c0| 69 6e 74 6f 20 74 68 65 | 20 6c 61 6e 67 75 61 67 |into the| languag|
|000034d0| 65 20 64 65 73 63 72 69 | 70 74 69 6f 6e 20 66 69 |e descri|ption fi|
|000034e0| 6c 65 2c 20 7b 5c 74 74 | 20 63 2e 73 70 69 64 65 |le, {\tt| c.spide|
|000034f0| 72 7d 2e 0a 0a 7b 5c 74 | 74 20 54 41 4e 47 4c 45 |r}...{\t|t TANGLE|
|00003500| 7d 20 64 69 73 63 61 72 | 64 73 20 63 6f 6d 6d 65 |} discar|ds comme|
|00003510| 6e 74 73 2c 20 72 61 74 | 68 65 72 20 74 68 61 6e |nts, rat|her than|
|00003520| 20 61 74 74 65 6d 70 74 | 69 6e 67 20 74 6f 20 74 | attempt|ing to t|
|00003530| 6f 6b 65 6e 69 7a 65 0a | 74 68 65 6d 2e 0a 43 6f |okenize.|them..Co|
|00003540| 6d 6d 65 6e 74 73 20 61 | 72 65 20 61 73 73 75 6d |mments a|re assum|
|00003550| 65 64 20 74 6f 20 62 65 | 67 69 6e 20 77 69 74 68 |ed to be|gin with|
|00003560| 20 61 20 73 70 65 63 69 | 61 6c 20 73 74 72 69 6e | a speci|al strin|
|00003570| 67 2c 20 61 6e 64 20 74 | 6f 20 65 6e 64 20 65 69 |g, and t|o end ei|
|00003580| 74 68 65 72 0a 77 69 74 | 68 20 61 6e 6f 74 68 65 |ther.wit|h anothe|
|00003590| 72 20 73 74 72 69 6e 67 | 20 6f 72 20 77 69 74 68 |r string| or with|
|000035a0| 20 61 20 6e 65 77 6c 69 | 6e 65 2e 0a 57 65 20 73 | a newli|ne..We s|
|000035b0| 70 65 63 69 66 79 20 43 | 20 63 6f 6d 6d 65 6e 74 |pecify C| comment|
|000035c0| 20 63 6f 6e 76 65 6e 74 | 69 6f 6e 73 20 62 79 20 | convent|ions by |
|000035d0| 74 65 6c 6c 69 6e 67 20 | 7b 5c 74 74 20 53 50 49 |telling |{\tt SPI|
|000035e0| 44 45 52 7d 0a 5c 62 65 | 67 69 6e 7b 71 75 6f 74 |DER}.\be|gin{quot|
|000035f0| 65 7d 5c 74 74 0a 63 6f | 6d 6d 65 6e 74 20 62 65 |e}\tt.co|mment be|
|00003600| 67 69 6e 20 3c 22 2f 2a | 22 3e 20 65 6e 64 20 3c |gin <"/*|"> end <|
|00003610| 22 2a 2f 22 3e 0a 5c 65 | 6e 64 7b 71 75 6f 74 65 |"*/">.\e|nd{quote|
|00003620| 7d 0a 0a 0a 4f 6e 20 6f | 75 74 70 75 74 2c 20 7b |}...On o|utput, {|
|00003630| 5c 74 74 20 54 41 4e 47 | 4c 45 7d 20 63 6f 6e 76 |\tt TANG|LE} conv|
|00003640| 65 72 74 73 20 74 6f 6b | 65 6e 73 20 74 6f 20 74 |erts tok|ens to t|
|00003650| 65 78 74 20 62 79 20 69 | 6e 76 65 72 74 69 6e 67 |ext by i|nverting|
|00003660| 20 74 68 65 0a 70 72 6f | 63 65 73 73 20 6f 66 20 | the.pro|cess of |
|00003670| 6c 65 78 69 63 61 6c 20 | 61 6e 61 6c 79 73 69 73 |lexical |analysis|
|00003680| 2c 20 73 6f 2c 20 66 6f | 72 20 65 78 61 6d 70 6c |, so, fo|r exampl|
|00003690| 65 2c 20 74 68 65 20 74 | 6f 6b 65 6e 20 5c 74 6f |e, the t|oken \to|
|000036a0| 6b 65 6e 7b 2b 2b 7d 20 | 69 73 0a 77 72 69 74 74 |ken{++} |is.writt|
|000036b0| 65 6e 20 6f 75 74 20 61 | 73 20 60 60 7b 5c 74 74 |en out a|s ``{\tt|
|000036c0| 20 2b 2b 7d 27 27 2e 0a | 7b 5c 74 74 20 54 41 4e | ++}''..|{\tt TAN|
|000036d0| 47 4c 45 7d 27 73 20 6f | 75 74 70 75 74 20 70 68 |GLE}'s o|utput ph|
|000036e0| 61 73 65 20 69 6e 73 65 | 72 74 73 20 77 68 69 74 |ase inse|rts whit|
|000036f0| 65 20 73 70 61 63 65 20 | 62 65 74 77 65 65 6e 20 |e space |between |
|00003700| 61 64 6a 61 63 65 6e 74 | 0a 69 64 65 6e 74 69 66 |adjacent|.identif|
|00003710| 69 65 72 73 20 61 6e 64 | 20 6e 75 6d 65 72 69 63 |iers and| numeric|
|00003720| 20 6c 69 74 65 72 61 6c | 73 2c 20 62 75 74 20 6f | literal|s, but o|
|00003730| 74 68 65 72 77 69 73 65 | 20 64 6f 65 73 20 6e 6f |therwise| does no|
|00003740| 74 20 77 72 69 74 65 20 | 77 68 69 74 65 0a 73 70 |t write |white.sp|
|00003750| 61 63 65 2e 0a 54 68 69 | 73 20 63 61 6e 20 63 61 |ace..Thi|s can ca|
|00003760| 75 73 65 20 70 72 6f 62 | 6c 65 6d 73 20 69 6e 20 |use prob|lems in |
|00003770| 73 6f 6d 65 20 63 61 73 | 65 73 3b 20 66 6f 72 20 |some cas|es; for |
|00003780| 65 78 61 6d 70 6c 65 2c | 20 69 6e 20 6f 6c 64 65 |example,| in olde|
|00003790| 72 0a 43 7e 63 6f 6d 70 | 69 6c 65 72 73 20 74 68 |r.C~comp|ilers th|
|000037a0| 65 20 73 74 72 69 6e 67 | 20 0a 60 60 7b 5c 74 74 |e string| .``{\tt|
|000037b0| 20 3d 2d 7d 27 27 20 69 | 73 20 61 6d 62 69 67 75 | =-}'' i|s ambigu|
|000037c0| 6f 75 73 2e 0a 57 65 20 | 63 61 6e 20 73 6f 6c 76 |ous..We |can solv|
|000037d0| 65 20 74 68 69 73 20 70 | 72 6f 62 6c 65 6d 20 62 |e this p|roblem b|
|000037e0| 79 20 74 65 6c 6c 69 6e | 67 20 7b 5c 74 74 20 53 |y tellin|g {\tt S|
|000037f0| 50 49 44 45 52 7d 20 74 | 6f 20 62 75 69 6c 64 20 |PIDER} t|o build |
|00003800| 61 20 7b 5c 74 74 0a 54 | 41 4e 47 4c 45 7d 20 74 |a {\tt.T|ANGLE} t|
|00003810| 68 61 74 20 75 73 65 73 | 20 74 68 65 20 74 65 78 |hat uses| the tex|
|00003820| 74 20 0a 20 60 60 7b 5c | 74 74 20 3d 7e 7d 27 27 |t . ``{\|tt =~}''|
|00003830| 20 77 68 65 6e 20 77 72 | 69 74 69 6e 67 20 74 68 | when wr|iting th|
|00003840| 65 20 5c 74 6f 6b 65 6e | 7b 3d 7d 3a 0a 5c 62 65 |e \token|{=}:.\be|
|00003850| 67 69 6e 7b 71 75 6f 74 | 65 7d 5c 74 74 0a 74 6f |gin{quot|e}\tt.to|
|00003860| 6b 65 6e 20 3d 20 74 61 | 6e 67 6c 65 74 6f 20 3c |ken = ta|ngleto <|
|00003870| 22 3d 20 22 3e 0a 5c 65 | 6e 64 7b 71 75 6f 74 65 |"= ">.\e|nd{quote|
|00003880| 7d 0a 0a 49 6e 20 73 75 | 6d 2c 20 77 65 20 63 61 |}..In su|m, we ca|
|00003890| 6e 20 6d 61 6b 65 20 7b | 5c 74 74 20 54 41 4e 47 |n make {|\tt TANG|
|000038a0| 4c 45 7d 20 6c 61 6e 67 | 75 61 67 65 2d 69 6e 64 |LE} lang|uage-ind|
|000038b0| 65 70 65 6e 64 65 6e 74 | 20 77 69 74 68 20 61 6c |ependent| with al|
|000038c0| 6d 6f 73 74 20 6e 6f 0a | 65 66 66 6f 72 74 2e 0a |most no.|effort..|
|000038d0| 57 65 20 64 6f 20 74 68 | 69 73 20 62 79 20 75 73 |We do th|is by us|
|000038e0| 69 6e 67 20 61 20 6c 6f | 77 65 73 74 20 63 6f 6d |ing a lo|west com|
|000038f0| 6d 6f 6e 20 64 65 6e 6f | 6d 69 6e 61 74 6f 72 20 |mon deno|minator |
|00003900| 6c 65 78 69 63 61 6c 20 | 61 6e 61 6c 79 7a 65 72 |lexical |analyzer|
|00003910| 20 77 68 6f 73 65 0a 6f | 6e 6c 79 20 70 61 72 61 | whose.o|nly para|
|00003920| 6d 65 74 65 72 20 69 73 | 20 61 20 64 65 73 63 72 |meter is| a descr|
|00003930| 69 70 74 69 6f 6e 20 6f | 66 20 63 6f 6d 6d 65 6e |iption o|f commen|
|00003940| 74 73 2c 20 61 6e 64 20 | 62 79 20 70 72 6f 76 69 |ts, and |by provi|
|00003950| 64 69 6e 67 20 61 20 77 | 61 79 20 74 6f 0a 66 69 |ding a w|ay to.fi|
|00003960| 6e 65 2d 74 75 6e 65 20 | 74 68 65 20 77 61 79 20 |ne-tune |the way |
|00003970| 7b 5c 74 74 20 54 41 4e | 47 4c 45 7d 20 77 72 69 |{\tt TAN|GLE} wri|
|00003980| 74 65 73 20 74 6f 6b 65 | 6e 73 2e 0a 0a 0a 0a 5c |tes toke|ns.....\|
|00003990| 6d 65 64 73 6b 69 70 0a | 55 6e 6c 69 6b 65 20 7b |medskip.|Unlike {|
|000039a0| 5c 74 74 20 54 41 4e 47 | 4c 45 7d 2c 20 7b 5c 74 |\tt TANG|LE}, {\t|
|000039b0| 74 20 57 45 41 56 45 7d | 20 64 6f 65 73 20 6e 6f |t WEAVE}| does no|
|000039c0| 20 72 65 61 72 72 61 6e | 67 69 6e 67 20 6f 66 20 | rearran|ging of |
|000039d0| 74 68 65 20 73 65 63 74 | 69 6f 6e 73 3b 0a 69 74 |the sect|ions;.it|
|000039e0| 73 20 6a 6f 62 20 69 73 | 20 74 6f 20 74 72 61 6e |s job is| to tran|
|000039f0| 73 6c 61 74 65 20 69 74 | 73 20 69 6e 70 75 74 20 |slate it|s input |
|00003a00| 69 6e 74 6f 20 61 20 70 | 72 65 74 74 79 70 72 69 |into a p|rettypri|
|00003a10| 6e 74 65 64 20 70 72 6f | 67 72 61 6d 0a 6c 69 73 |nted pro|gram.lis|
|00003a20| 74 69 6e 67 2e 0a 54 68 | 65 20 64 6f 63 75 6d 65 |ting..Th|e docume|
|00003a30| 6e 74 61 74 69 6f 6e 20 | 70 61 72 74 20 6f 66 20 |ntation |part of |
|00003a40| 65 61 63 68 20 73 65 63 | 74 69 6f 6e 20 69 73 20 |each sec|tion is |
|00003a50| 73 69 6d 70 6c 79 20 63 | 6f 70 69 65 64 20 74 6f |simply c|opied to|
|00003a60| 20 74 68 65 20 6f 75 74 | 70 75 74 2c 0a 62 75 74 | the out|put,.but|
|00003a70| 20 74 68 65 20 64 65 66 | 69 6e 69 74 69 6f 6e 20 | the def|inition |
|00003a80| 61 6e 64 20 63 6f 64 65 | 20 70 61 72 74 73 20 61 |and code| parts a|
|00003a90| 72 65 20 70 72 65 74 74 | 79 70 72 69 6e 74 65 64 |re prett|yprinted|
|00003aa0| 2e 0a 7b 5c 74 74 20 57 | 45 41 56 45 7d 27 73 20 |..{\tt W|EAVE}'s |
|00003ab0| 6f 75 74 70 75 74 20 69 | 73 20 68 61 6e 64 65 64 |output i|s handed|
|00003ac0| 20 74 6f 20 61 20 64 6f | 63 75 6d 65 6e 74 20 66 | to a do|cument f|
|00003ad0| 6f 72 6d 61 74 74 65 72 | 2c 20 77 68 69 63 68 20 |ormatter|, which |
|00003ae0| 69 73 0a 61 73 73 75 6d | 65 64 20 74 6f 20 69 6d |is.assum|ed to im|
|00003af0| 70 6c 65 6d 65 6e 74 20 | 61 20 70 72 65 74 74 79 |plement |a pretty|
|00003b00| 70 72 69 6e 74 69 6e 67 | 20 61 6c 67 6f 72 69 74 |printing| algorit|
|00003b10| 68 6d 20 6c 69 6b 65 20 | 74 68 61 74 20 64 65 73 |hm like |that des|
|00003b20| 63 72 69 62 65 64 20 62 | 79 0a 4f 70 70 65 6e 7e |cribed b|y.Oppen~|
|00003b30| 5c 63 69 74 65 7b 6f 70 | 70 65 6e 3a 70 72 65 74 |\cite{op|pen:pret|
|00003b40| 74 79 70 72 69 6e 74 69 | 6e 67 7d 2e 0a 53 69 6e |typrinti|ng}..Sin|
|00003b50| 63 65 20 6d 79 20 7b 5c | 74 74 20 57 45 42 7d 73 |ce my {\|tt WEB}s|
|00003b60| 20 75 73 65 20 7b 5c 54 | 65 58 7d 20 61 73 20 74 | use {\T|eX} as t|
|00003b70| 68 65 20 64 6f 63 75 6d | 65 6e 74 20 66 6f 72 6d |he docum|ent form|
|00003b80| 61 74 74 65 72 2c 20 74 | 68 65 20 62 61 63 6b 2d |atter, t|he back-|
|00003b90| 65 6e 64 0a 70 72 65 74 | 74 79 70 72 69 6e 74 69 |end.pret|typrinti|
|00003ba0| 6e 67 20 69 73 20 69 6d | 70 6c 65 6d 65 6e 74 65 |ng is im|plemente|
|00003bb0| 64 20 62 79 20 7b 5c 54 | 65 58 7d 20 6d 61 63 72 |d by {\T|eX} macr|
|00003bc0| 6f 73 2e 0a 0a 7b 5c 74 | 74 20 57 45 41 56 45 7d |os...{\t|t WEAVE}|
|00003bd0| 20 63 6f 70 69 65 73 20 | 74 68 65 20 64 6f 63 75 | copies |the docu|
|00003be0| 6d 65 6e 74 61 74 69 6f | 6e 20 70 61 72 74 73 20 |mentatio|n parts |
|00003bf0| 61 73 20 74 65 78 74 73 | 2c 20 62 75 74 20 69 74 |as texts|, but it|
|00003c00| 20 63 6f 6e 76 65 72 74 | 73 0a 64 65 66 69 6e 69 | convert|s.defini|
|00003c10| 74 69 6f 6e 20 61 6e 64 | 20 63 6f 64 65 20 70 61 |tion and| code pa|
|00003c20| 72 74 73 20 74 6f 20 74 | 6f 6b 65 6e 20 6c 69 73 |rts to t|oken lis|
|00003c30| 74 73 20 75 73 69 6e 67 | 20 74 68 65 20 73 61 6d |ts using| the sam|
|00003c40| 65 20 6c 65 78 69 63 61 | 6c 0a 61 6e 61 6c 79 7a |e lexica|l.analyz|
|00003c50| 65 72 20 75 73 65 64 20 | 62 79 20 7b 5c 74 74 20 |er used |by {\tt |
|00003c60| 54 41 4e 47 4c 45 7d 2e | 0a 7b 5c 74 74 20 57 45 |TANGLE}.|.{\tt WE|
|00003c70| 41 56 45 7d 27 73 20 70 | 61 72 74 20 6f 66 20 74 |AVE}'s p|art of t|
|00003c80| 68 65 20 70 72 65 74 74 | 79 70 72 69 6e 74 69 6e |he prett|yprintin|
|00003c90| 67 20 74 61 73 6b 20 28 | 61 73 20 64 69 73 74 69 |g task (|as disti|
|00003ca0| 6e 63 74 20 66 72 6f 6d | 0a 7b 5c 54 65 58 7d 27 |nct from|.{\TeX}'|
|00003cb0| 73 20 70 61 72 74 29 20 | 69 73 20 63 6f 6e 76 65 |s part) |is conve|
|00003cc0| 72 74 69 6e 67 20 74 68 | 65 73 65 20 74 6f 6b 65 |rting th|ese toke|
|00003cd0| 6e 20 6c 69 73 74 73 20 | 74 6f 20 73 74 72 65 61 |n lists |to strea|
|00003ce0| 6d 73 20 6f 66 20 7b 5c | 54 65 58 7d 0a 74 65 78 |ms of {\|TeX}.tex|
|00003cf0| 74 2c 20 70 6f 73 73 69 | 62 6c 79 20 77 69 74 68 |t, possi|bly with|
|00003d00| 20 70 72 65 74 74 79 70 | 72 69 6e 74 69 6e 67 20 | prettyp|rinting |
|00003d10| 69 6e 73 74 72 75 63 74 | 69 6f 6e 73 20 69 6e 74 |instruct|ions int|
|00003d20| 65 72 63 61 6c 61 74 65 | 64 20 62 65 74 77 65 65 |ercalate|d betwee|
|00003d30| 6e 0a 74 6f 6b 65 6e 73 | 2e 20 0a 49 66 20 79 6f |n.tokens|. .If yo|
|00003d40| 75 20 6c 69 6b 65 2c 20 | 7b 5c 74 74 20 57 45 41 |u like, |{\tt WEA|
|00003d50| 56 45 7d 27 73 20 6a 6f | 62 20 69 73 20 74 6f 20 |VE}'s jo|b is to |
|00003d60| 70 72 6f 64 75 63 65 20 | 74 68 65 20 69 6e 70 75 |produce |the inpu|
|00003d70| 74 20 74 6f 20 4f 70 70 | 65 6e 27 73 0a 61 6c 67 |t to Opp|en's.alg|
|00003d80| 6f 72 69 74 68 6d 2e 20 | 0a 46 6f 72 20 73 69 6d |orithm. |.For sim|
|00003d90| 70 6c 69 63 69 74 79 2c | 20 77 65 27 6c 6c 20 64 |plicity,| we'll d|
|00003da0| 69 73 63 75 73 73 20 6f | 6e 6c 79 20 74 68 72 65 |iscuss o|nly thre|
|00003db0| 65 20 70 72 65 74 74 79 | 70 72 69 6e 74 69 6e 67 |e pretty|printing|
|00003dc0| 20 69 6e 73 74 72 75 63 | 74 69 6f 6e 73 3a 0a 7b | instruc|tions:.{|
|00003dd0| 5c 65 6d 20 69 6e 64 65 | 6e 74 7d 20 0a 28 69 6e |\em inde|nt} .(in|
|00003de0| 63 72 65 61 73 65 20 74 | 68 65 20 6c 65 76 65 6c |crease t|he level|
|00003df0| 20 6f 66 20 69 6e 64 65 | 6e 74 61 74 69 6f 6e 29 | of inde|ntation)|
|00003e00| 2c 20 7b 5c 65 6d 20 6f | 75 74 64 65 6e 74 7d 20 |, {\em o|utdent} |
|00003e10| 28 64 65 63 72 65 61 73 | 65 20 74 68 65 20 6c 65 |(decreas|e the le|
|00003e20| 76 65 6c 0a 6f 66 20 69 | 6e 64 65 6e 74 61 74 69 |vel.of i|ndentati|
|00003e30| 6f 6e 29 2c 20 61 6e 64 | 20 7b 5c 65 6d 20 66 6f |on), and| {\em fo|
|00003e40| 72 63 65 7d 20 28 66 6f | 72 63 65 20 61 20 6c 69 |rce} (fo|rce a li|
|00003e50| 6e 65 20 62 72 65 61 6b | 29 2e 0a 0a 57 65 20 74 |ne break|)...We t|
|00003e60| 65 6c 6c 20 7b 5c 74 74 | 20 57 45 41 56 45 7d 20 |ell {\tt| WEAVE} |
|00003e70| 68 6f 77 20 74 6f 20 63 | 6f 6e 76 65 72 74 20 74 |how to c|onvert t|
|00003e80| 6f 6b 65 6e 73 20 74 6f | 20 7b 5c 54 65 58 7d 20 |okens to| {\TeX} |
|00003e90| 74 65 78 74 20 62 79 20 | 73 70 65 63 69 66 79 69 |text by |specifyi|
|00003ea0| 6e 67 0a 61 20 7b 5c 65 | 6d 20 74 72 61 6e 73 6c |ng.a {\e|m transl|
|00003eb0| 61 74 69 6f 6e 7d 20 66 | 6f 72 20 65 61 63 68 20 |ation} f|or each |
|00003ec0| 74 6f 6b 65 6e 2e 0a 53 | 75 70 70 6f 73 65 20 77 |token..S|uppose w|
|00003ed0| 65 20 77 61 6e 74 20 74 | 68 65 20 43 20 74 6f 6b |e want t|he C tok|
|00003ee0| 65 6e 20 5c 74 6f 6b 65 | 6e 7b 21 3d 7d 20 74 6f |en \toke|n{!=} to|
|00003ef0| 20 62 65 20 70 72 69 6e | 74 65 64 20 61 73 7e 60 | be prin|ted as~`|
|00003f00| 60 24 5c 6e 65 24 27 27 | 2c 0a 77 68 69 63 68 20 |`$\ne$''|,.which |
|00003f10| 69 73 20 70 72 6f 64 75 | 63 65 64 20 62 79 20 74 |is produ|ced by t|
|00003f20| 68 65 20 7b 5c 54 65 58 | 7d 20 74 65 78 74 20 60 |he {\TeX|} text `|
|00003f30| 60 5c 76 65 72 62 2b 5c | 6e 65 2b 27 27 2e 0a 54 |`\verb+\|ne+''..T|
|00003f40| 68 65 6e 20 77 65 20 77 | 72 69 74 65 0a 5c 62 65 |hen we w|rite.\be|
|00003f50| 67 69 6e 7b 71 75 6f 74 | 65 7d 0a 5c 62 65 67 69 |gin{quot|e}.\begi|
|00003f60| 6e 7b 76 65 72 62 61 74 | 69 6d 7d 0a 74 6f 6b 65 |n{verbat|im}.toke|
|00003f70| 6e 20 21 3d 20 74 72 61 | 6e 73 6c 61 74 69 6f 6e |n != tra|nslation|
|00003f80| 20 3c 22 5c 5c 6e 65 22 | 3e 0a 5c 65 6e 64 7b 76 | <"\\ne"|>.\end{v|
|00003f90| 65 72 62 61 74 69 6d 7d | 20 0a 5c 65 6e 64 7b 71 |erbatim}| .\end{q|
|00003fa0| 75 6f 74 65 7d 0a 28 54 | 77 6f 20 62 61 63 6b 73 |uote}.(T|wo backs|
|00003fb0| 6c 61 73 68 65 73 20 61 | 70 70 65 61 72 20 69 6e |lashes a|ppear in|
|00003fc0| 20 74 68 65 20 74 72 61 | 6e 73 6c 61 74 69 6f 6e | the tra|nslation|
|00003fd0| 20 62 65 63 61 75 73 65 | 20 7b 5c 74 74 20 53 50 | because| {\tt SP|
|00003fe0| 49 44 45 52 7d 20 75 73 | 65 73 0a 43 7e 63 6f 6e |IDER} us|es.C~con|
|00003ff0| 76 65 6e 74 69 6f 6e 73 | 20 66 6f 72 20 73 74 72 |ventions| for str|
|00004000| 69 6e 67 20 6c 69 74 65 | 72 61 6c 73 2e 0a 54 68 |ing lite|rals..Th|
|00004010| 65 20 61 6e 67 6c 65 20 | 62 72 61 63 6b 65 74 73 |e angle |brackets|
|00004020| 20 7b 5c 74 74 20 3c 2e | 2e 2e 3e 7d 20 20 64 65 | {\tt <.|..>} de|
|00004030| 6c 69 6d 69 74 20 74 72 | 61 6e 73 6c 61 74 69 6f |limit tr|anslatio|
|00004040| 6e 73 2e 29 0a 54 68 65 | 20 64 65 66 61 75 6c 74 |ns.).The| default|
|00004050| 20 66 6f 72 20 74 72 61 | 6e 73 6c 61 74 69 6f 6e | for tra|nslation|
|00004060| 20 69 73 20 6a 75 73 74 | 20 61 73 20 69 6e 20 7b | is just| as in {|
|00004070| 5c 74 74 20 54 41 4e 47 | 4c 45 7d 2c 20 73 6f 20 |\tt TANG|LE}, so |
|00004080| 69 66 20 77 65 20 77 61 | 6e 74 0a 60 60 7b 5c 74 |if we wa|nt.``{\t|
|00004090| 74 20 2b 7d 27 27 20 6f | 6e 20 69 6e 70 75 74 20 |t +}'' o|n input |
|000040a0| 74 6f 20 70 72 6f 64 75 | 63 65 20 60 60 24 2b 24 |to produ|ce ``$+$|
|000040b0| 27 27 20 6f 6e 20 6f 75 | 74 70 75 74 20 77 65 20 |'' on ou|tput we |
|000040c0| 6e 65 65 64 20 6e 6f 74 | 20 73 70 65 63 69 66 79 |need not| specify|
|000040d0| 20 61 0a 74 72 61 6e 73 | 6c 61 74 69 6f 6e 20 66 | a.trans|lation f|
|000040e0| 6f 72 20 74 68 65 20 74 | 6f 6b 65 6e 20 5c 74 6f |or the t|oken \to|
|000040f0| 6b 65 6e 7b 2b 7d 2e 0a | 0a 54 68 65 20 70 72 6f |ken{+}..|.The pro|
|00004100| 63 65 73 73 20 6f 66 20 | 64 65 63 69 64 69 6e 67 |cess of |deciding|
|00004110| 20 77 68 65 72 65 20 74 | 6f 20 70 75 74 20 6c 69 | where t|o put li|
|00004120| 6e 65 20 62 72 65 61 6b | 73 20 61 6e 64 20 69 6e |ne break|s and in|
|00004130| 64 65 6e 74 61 74 69 6f | 6e 20 69 73 0a 74 68 65 |dentatio|n is.the|
|00004140| 20 6d 6f 73 74 20 63 6f | 6d 70 6c 69 63 61 74 65 | most co|mplicate|
|00004150| 64 20 70 61 72 74 20 6f | 66 20 7b 5c 74 74 20 57 |d part o|f {\tt W|
|00004160| 45 41 56 45 7d 2e 0a 57 | 65 20 68 61 76 65 20 74 |EAVE}..W|e have t|
|00004170| 6f 20 64 6f 20 74 68 69 | 73 20 62 61 73 65 64 20 |o do thi|s based |
|00004180| 6f 6e 20 74 68 65 20 73 | 65 71 75 65 6e 63 65 20 |on the s|equence |
|00004190| 6f 66 20 74 6f 6b 65 6e | 73 20 77 65 20 68 61 76 |of token|s we hav|
|000041a0| 65 2c 20 62 75 74 20 74 | 68 65 0a 65 78 61 63 74 |e, but t|he.exact|
|000041b0| 20 64 65 74 61 69 6c 73 | 20 6f 66 20 77 68 69 63 | details| of whic|
|000041c0| 68 20 74 6f 6b 65 6e 20 | 69 73 20 77 68 65 72 65 |h token |is where|
|000041d0| 20 75 73 75 61 6c 6c 79 | 20 61 72 65 6e 27 74 20 | usually| aren't |
|000041e0| 6e 65 65 64 65 64 20 74 | 6f 20 64 6f 0a 70 72 65 |needed t|o do.pre|
|000041f0| 74 74 79 70 72 69 6e 74 | 69 6e 67 2e 0a 48 65 6e |ttyprint|ing..Hen|
|00004200| 63 65 20 77 65 20 69 6e | 74 72 6f 64 75 63 65 20 |ce we in|troduce |
|00004210| 74 68 65 20 7b 5c 65 6d | 20 73 63 72 61 70 7d 2c |the {\em| scrap},|
|00004220| 20 77 68 69 63 68 20 61 | 62 73 74 72 61 63 74 73 | which a|bstracts|
|00004230| 20 61 77 61 79 20 66 72 | 6f 6d 20 74 68 65 0a 64 | away fr|om the.d|
|00004240| 65 74 61 69 6c 20 6e 6f | 74 20 6e 65 65 64 65 64 |etail no|t needed|
|00004250| 20 74 6f 20 64 6f 20 70 | 72 65 74 74 79 70 72 69 | to do p|rettypri|
|00004260| 6e 74 69 6e 67 2e 0a 41 | 20 73 63 72 61 70 20 68 |nting..A| scrap h|
|00004270| 61 73 20 74 77 6f 20 70 | 61 72 74 73 3a 20 74 68 |as two p|arts: th|
|00004280| 65 20 74 72 61 6e 73 6c | 61 74 69 6f 6e 2c 20 77 |e transl|ation, w|
|00004290| 68 69 63 68 20 77 65 20 | 68 61 76 65 20 61 6c 72 |hich we |have alr|
|000042a0| 65 61 64 79 20 73 65 65 | 6e 2c 0a 61 6e 64 20 74 |eady see|n,.and t|
|000042b0| 68 65 20 7b 5c 65 6d 20 | 63 61 74 65 67 6f 72 79 |he {\em |category|
|000042c0| 7d 2c 20 77 68 69 63 68 | 0a 20 63 6f 72 72 65 73 |}, which|. corres|
|000042d0| 70 6f 6e 64 73 20 74 6f | 20 61 20 60 60 70 61 72 |ponds to| a ``par|
|000042e0| 74 20 6f 66 20 73 70 65 | 65 63 68 27 27 20 6f 72 |t of spe|ech'' or|
|000042f0| 20 61 20 73 79 6d 62 6f | 6c 20 69 6e 20 61 20 67 | a symbo|l in a g|
|00004300| 72 61 6d 6d 61 72 2e 20 | 0a 7b 5c 74 74 20 57 45 |rammar. |.{\tt WE|
|00004310| 41 56 45 7d 20 75 73 65 | 73 20 63 61 74 65 67 6f |AVE} use|s catego|
|00004320| 72 69 65 73 20 74 6f 20 | 64 65 63 69 64 65 20 77 |ries to |decide w|
|00004330| 68 65 72 65 20 74 6f 20 | 70 75 74 0a 69 6e 64 65 |here to |put.inde|
|00004340| 6e 74 61 74 69 6f 6e 20 | 61 6e 64 20 6c 69 6e 65 |ntation |and line|
|00004350| 20 62 72 65 61 6b 73 2e | 0a 53 69 6e 63 65 20 74 | breaks.|.Since t|
|00004360| 68 65 72 65 20 61 72 65 | 20 75 73 75 61 6c 6c 79 |here are| usually|
|00004370| 20 6d 61 6e 79 20 64 69 | 66 66 65 72 65 6e 74 20 | many di|fferent |
|00004380| 74 6f 6b 65 6e 73 20 68 | 61 76 69 6e 67 20 74 68 |tokens h|aving th|
|00004390| 65 20 73 61 6d 65 20 63 | 61 74 65 67 6f 72 79 2c |e same c|ategory,|
|000043a0| 0a 70 72 65 74 74 79 70 | 72 69 6e 74 69 6e 67 20 |.prettyp|rinting |
|000043b0| 69 73 20 73 69 6d 70 6c | 69 66 69 65 64 20 65 6e |is simpl|ified en|
|000043c0| 6f 72 6d 6f 75 73 6c 79 | 2e 0a 0a 7b 5c 74 74 20 |ormously|...{\tt |
|000043d0| 57 45 41 56 45 7d 20 62 | 65 67 69 6e 73 20 70 72 |WEAVE} b|egins pr|
|000043e0| 6f 63 65 73 73 69 6e 67 | 20 61 20 70 72 6f 67 72 |ocessing| a progr|
|000043f0| 61 6d 20 66 72 61 67 6d | 65 6e 74 20 62 79 20 74 |am fragm|ent by t|
|00004400| 6f 6b 65 6e 69 7a 69 6e | 67 20 74 68 65 0a 66 72 |okenizin|g the.fr|
|00004410| 61 67 6d 65 6e 74 2c 20 | 74 68 65 6e 20 63 6f 6e |agment, |then con|
|00004420| 76 65 72 74 69 6e 67 20 | 65 61 63 68 20 74 6f 6b |verting |each tok|
|00004430| 65 6e 20 69 6e 20 74 68 | 65 20 72 65 73 75 6c 74 |en in th|e result|
|00004440| 69 6e 67 20 74 6f 6b 65 | 6e 20 6c 69 73 74 20 69 |ing toke|n list i|
|00004450| 6e 74 6f 0a 61 20 73 63 | 72 61 70 2e 20 0a 49 74 |nto.a sc|rap. .It|
|00004460| 20 74 68 65 6e 20 61 74 | 74 65 6d 70 74 73 20 74 | then at|tempts t|
|00004470| 6f 20 72 65 64 75 63 65 | 20 74 68 65 20 6c 65 6e |o reduce| the len|
|00004480| 67 74 68 20 6f 66 20 74 | 68 65 20 72 65 73 75 6c |gth of t|he resul|
|00004490| 74 69 6e 67 20 73 63 72 | 61 70 20 6c 69 73 74 20 |ting scr|ap list |
|000044a0| 62 79 0a 63 6f 6d 62 69 | 6e 69 6e 67 20 61 64 6a |by.combi|ning adj|
|000044b0| 61 63 65 6e 74 20 73 63 | 72 61 70 73 20 69 6e 74 |acent sc|raps int|
|000044c0| 6f 20 61 20 73 69 6e 67 | 6c 65 20 73 63 72 61 70 |o a sing|le scrap|
|000044d0| 2c 20 70 6f 73 73 69 62 | 6c 79 20 69 6e 74 65 72 |, possib|ly inter|
|000044e0| 63 61 6c 61 74 69 6e 67 | 0a 61 64 64 69 74 69 6f |calating|.additio|
|000044f0| 6e 61 6c 20 74 72 61 6e | 73 6c 61 74 69 6f 6e 73 |nal tran|slations|
|00004500| 2c 20 77 68 69 63 68 20 | 6d 61 79 20 69 6e 63 6c |, which |may incl|
|00004510| 75 64 65 0a 7b 5c 65 6d | 20 69 6e 64 65 6e 74 7d |ude.{\em| indent}|
|00004520| 2c 20 7b 5c 65 6d 20 6f | 75 74 64 65 6e 74 7d 2c |, {\em o|utdent},|
|00004530| 20 61 6e 64 20 7b 5c 65 | 6d 20 66 6f 72 63 65 7d | and {\e|m force}|
|00004540| 20 69 6e 73 74 72 75 63 | 74 69 6f 6e 73 2e 0a 54 | instruc|tions..T|
|00004550| 68 65 20 73 63 72 61 70 | 73 20 61 72 65 20 63 6f |he scrap|s are co|
|00004560| 6d 62 69 6e 65 64 20 61 | 63 63 6f 72 64 69 6e 67 |mbined a|ccording|
|00004570| 20 74 6f 20 6f 6e 65 20 | 6f 66 20 6d 61 6e 79 20 | to one |of many |
|00004580| 7b 5c 65 6d 20 72 65 64 | 75 63 74 69 6f 6e 20 72 |{\em red|uction r|
|00004590| 75 6c 65 73 7d 2e 0a 7b | 5c 74 74 20 57 45 41 56 |ules}..{|\tt WEAV|
|000045a0| 45 7d 20 64 65 63 69 64 | 65 73 20 77 68 69 63 68 |E} decid|es which|
|000045b0| 20 61 64 6a 61 63 65 6e | 74 20 73 63 72 61 70 73 | adjacen|t scraps|
|000045c0| 20 61 72 65 20 65 6c 69 | 67 69 62 6c 65 20 74 6f | are eli|gible to|
|000045d0| 20 62 65 20 72 65 64 75 | 63 65 64 0a 62 61 73 65 | be redu|ced.base|
|000045e0| 64 20 6f 6e 6c 79 20 6f | 6e 20 74 68 65 20 63 61 |d only o|n the ca|
|000045f0| 74 65 67 6f 72 69 65 73 | 20 6f 66 20 74 68 65 20 |tegories| of the |
|00004600| 73 63 72 61 70 73 20 61 | 6e 64 20 61 20 6b 6e 6f |scraps a|nd a kno|
|00004610| 77 6c 65 64 67 65 20 6f | 66 20 74 68 65 0a 72 65 |wledge o|f the.re|
|00004620| 64 75 63 74 69 6f 6e 20 | 72 75 6c 65 73 2e 0a 54 |duction |rules..T|
|00004630| 68 65 20 72 65 64 75 63 | 74 69 6f 6e 20 72 75 6c |he reduc|tion rul|
|00004640| 65 73 20 61 72 65 20 74 | 68 65 20 70 72 6f 64 75 |es are t|he produ|
|00004650| 63 74 69 6f 6e 73 20 6f | 66 20 74 68 65 20 7b 5c |ctions o|f the {\|
|00004660| 65 6d 20 70 72 65 74 74 | 79 70 72 69 6e 74 69 6e |em prett|yprintin|
|00004670| 67 0a 67 72 61 6d 6d 61 | 72 7d 2e 20 0a 7b 5c 74 |g.gramma|r}. .{\t|
|00004680| 74 20 57 45 41 56 45 7d | 27 73 20 72 65 64 75 63 |t WEAVE}|'s reduc|
|00004690| 74 69 6f 6e 73 20 6f 66 | 20 73 63 72 61 70 73 20 |tions of| scraps |
|000046a0| 61 72 65 20 6c 69 6b 65 | 20 74 68 65 20 72 65 64 |are like| the red|
|000046b0| 75 63 74 69 6f 6e 73 20 | 64 6f 6e 65 20 69 6e 0a |uctions |done in.|
|000046c0| 62 6f 74 74 6f 6d 2d 75 | 70 20 70 61 72 73 69 6e |bottom-u|p parsin|
|000046d0| 67 2e 20 0a 0a 54 6f 20 | 74 61 6b 65 20 61 6e 20 |g. ..To |take an |
|000046e0| 65 78 61 6d 70 6c 65 2c | 20 73 75 70 70 6f 73 65 |example,| suppose|
|000046f0| 20 74 68 61 74 20 77 65 | 20 77 61 6e 74 20 73 74 | that we| want st|
|00004700| 61 74 65 6d 65 6e 74 73 | 20 74 6f 20 62 65 20 73 |atements| to be s|
|00004710| 65 70 61 72 61 74 65 64 | 20 62 79 0a 6c 69 6e 65 |eparated| by.line|
|00004720| 20 62 72 65 61 6b 73 2e | 0a 49 66 20 77 65 20 63 | breaks.|.If we c|
|00004730| 61 6e 20 67 75 61 72 61 | 6e 74 65 65 20 74 68 61 |an guara|ntee tha|
|00004740| 74 20 61 6e 79 20 73 63 | 72 61 70 20 72 65 70 72 |t any sc|rap repr|
|00004750| 65 73 65 6e 74 69 6e 67 | 20 61 20 73 74 61 74 65 |esenting| a state|
|00004760| 6d 65 6e 74 20 68 61 73 | 0a 63 61 74 65 67 6f 72 |ment has|.categor|
|00004770| 79 20 7b 5c 74 74 20 73 | 74 6d 74 7d 2c 20 69 74 |y {\tt s|tmt}, it|
|00004780| 20 77 69 6c 6c 20 62 65 | 20 65 6e 6f 75 67 68 20 | will be| enough |
|00004790| 74 6f 20 73 70 65 63 69 | 66 79 20 74 68 65 20 72 |to speci|fy the r|
|000047a0| 65 64 75 63 74 69 6f 6e | 20 72 75 6c 65 0a 5c 62 |eduction| rule.\b|
|000047b0| 65 67 69 6e 7b 71 75 6f | 74 65 7d 5c 74 74 0a 73 |egin{quo|te}\tt.s|
|000047c0| 74 6d 74 20 3c 66 6f 72 | 63 65 3e 20 73 74 6d 74 |tmt <for|ce> stmt|
|000047d0| 20 2d 2d 3e 20 73 74 6d | 74 0a 5c 65 6e 64 7b 71 | --> stm|t.\end{q|
|000047e0| 75 6f 74 65 7d 0a 77 68 | 69 63 68 20 73 61 79 73 |uote}.wh|ich says|
|000047f0| 20 60 60 74 77 6f 20 61 | 64 6a 61 63 65 6e 74 20 | ``two a|djacent |
|00004800| 7b 5c 74 74 20 73 74 6d | 74 7d 20 73 63 72 61 70 |{\tt stm|t} scrap|
|00004810| 73 20 6d 61 79 20 62 65 | 20 72 65 64 75 63 65 64 |s may be| reduced|
|00004820| 20 74 6f 20 61 20 73 69 | 6e 67 6c 65 0a 7b 5c 74 | to a si|ngle.{\t|
|00004830| 74 20 73 74 6d 74 7d 20 | 73 63 72 61 70 20 62 79 |t stmt} |scrap by|
|00004840| 20 69 6e 74 65 72 63 61 | 6c 61 74 69 6e 67 20 61 | interca|lating a|
|00004850| 20 66 6f 72 63 65 64 20 | 6c 69 6e 65 20 62 72 65 | forced |line bre|
|00004860| 61 6b 20 62 65 74 77 65 | 65 6e 20 74 68 65 6d 2e |ak betwe|en them.|
|00004870| 27 27 0a 0a 53 6f 20 77 | 65 20 74 65 6c 6c 20 7b |''..So w|e tell {|
|00004880| 5c 74 74 20 57 45 41 56 | 45 7d 20 68 6f 77 20 74 |\tt WEAV|E} how t|
|00004890| 6f 20 70 72 65 74 74 79 | 70 72 69 6e 74 20 61 20 |o pretty|print a |
|000048a0| 6c 61 6e 67 75 61 67 65 | 20 62 79 20 74 65 6c 6c |language| by tell|
|000048b0| 69 6e 67 0a 68 6f 77 20 | 74 6f 20 61 73 73 69 67 |ing.how |to assig|
|000048c0| 6e 20 61 20 63 61 74 65 | 67 6f 72 79 20 74 6f 20 |n a cate|gory to |
|000048d0| 65 61 63 68 20 74 6f 6b | 65 6e 20 61 6e 64 20 68 |each tok|en and h|
|000048e0| 6f 77 20 74 6f 20 63 6f | 6d 62 69 6e 65 20 73 63 |ow to co|mbine sc|
|000048f0| 72 61 70 73 2e 0a 48 65 | 72 65 27 73 20 61 6e 6f |raps..He|re's ano|
|00004900| 74 68 65 72 20 65 78 61 | 6d 70 6c 65 3a 20 74 68 |ther exa|mple: th|
|00004910| 65 20 6c 61 6e 67 75 61 | 67 65 20 6f 66 20 43 7e |e langua|ge of C~|
|00004920| 65 78 70 72 65 73 73 69 | 6f 6e 73 2e 0a 20 4c 65 |expressi|ons.. Le|
|00004930| 74 20 7b 5c 74 74 20 6d | 61 74 68 7d 20 62 65 20 |t {\tt m|ath} be |
|00004940| 74 68 65 20 63 61 74 65 | 67 6f 72 79 20 6f 66 20 |the cate|gory of |
|00004950| 65 78 70 72 65 73 73 69 | 6f 6e 73 2c 0a 7b 5c 74 |expressi|ons,.{\t|
|00004960| 74 20 62 69 6e 6f 70 7d | 20 62 65 20 74 68 65 20 |t binop}| be the |
|00004970| 63 61 74 65 67 6f 72 79 | 20 6f 66 20 62 69 6e 61 |category| of bina|
|00004980| 72 79 20 69 6e 66 69 78 | 20 6f 70 65 72 61 74 6f |ry infix| operato|
|00004990| 72 73 2c 20 61 6e 64 0a | 7b 5c 74 74 20 75 6e 6f |rs, and.|{\tt uno|
|000049a0| 70 7d 20 62 65 20 74 68 | 65 20 63 61 74 65 67 6f |p} be th|e catego|
|000049b0| 72 79 20 6f 66 20 62 6f | 74 68 20 75 6e 61 72 79 |ry of bo|th unary|
|000049c0| 20 70 72 65 66 69 78 20 | 61 6e 64 20 75 6e 61 72 | prefix |and unar|
|000049d0| 79 20 70 6f 73 74 66 69 | 78 0a 6f 70 65 72 61 74 |y postfi|x.operat|
|000049e0| 6f 72 73 2e 0a 48 65 72 | 65 20 61 72 65 20 73 6f |ors..Her|e are so|
|000049f0| 6d 65 20 73 61 6d 70 6c | 65 20 74 6f 6b 65 6e 73 |me sampl|e tokens|
|00004a00| 3a 0a 5c 62 65 67 69 6e | 7b 71 75 6f 74 65 7d 0a |:.\begin|{quote}.|
|00004a10| 5c 62 65 67 69 6e 7b 76 | 65 72 62 61 74 69 6d 7d |\begin{v|erbatim}|
|00004a20| 20 0a 74 6f 6b 65 6e 20 | 69 64 65 6e 74 69 66 69 | .token |identifi|
|00004a30| 65 72 20 63 61 74 65 67 | 6f 72 79 20 6d 61 74 68 |er categ|ory math|
|00004a40| 0a 74 6f 6b 65 6e 20 2b | 20 63 61 74 65 67 6f 72 |.token +| categor|
|00004a50| 79 20 62 69 6e 6f 70 0a | 74 6f 6b 65 6e 20 2d 20 |y binop.|token - |
|00004a60| 63 61 74 65 67 6f 72 79 | 20 62 69 6e 6f 70 0a 74 |category| binop.t|
|00004a70| 6f 6b 65 6e 20 3d 20 63 | 61 74 65 67 6f 72 79 20 |oken = c|ategory |
|00004a80| 62 69 6e 6f 70 20 74 72 | 61 6e 73 6c 61 74 69 6f |binop tr|anslatio|
|00004a90| 6e 20 3c 22 5c 5c 6c 65 | 66 74 61 72 72 6f 77 22 |n <"\\le|ftarrow"|
|00004aa0| 3e 0a 74 6f 6b 65 6e 20 | 3d 3d 20 74 72 61 6e 73 |>.token |== trans|
|00004ab0| 6c 61 74 69 6f 6e 20 3c | 22 5c 5c 65 71 75 69 76 |lation <|"\\equiv|
|00004ac0| 22 3e 20 63 61 74 65 67 | 6f 72 79 20 62 69 6e 6f |"> categ|ory bino|
|00004ad0| 70 0a 74 6f 6b 65 6e 20 | 28 20 63 61 74 65 67 6f |p.token |( catego|
|00004ae0| 72 79 20 6f 70 65 6e 0a | 74 6f 6b 65 6e 20 29 20 |ry open.|token ) |
|00004af0| 63 61 74 65 67 6f 72 79 | 20 63 6c 6f 73 65 0a 5c |category| close.\|
|00004b00| 65 6e 64 7b 76 65 72 62 | 61 74 69 6d 7d 0a 5c 65 |end{verb|atim}.\e|
|00004b10| 6e 64 7b 71 75 6f 74 65 | 7d 0a 4e 6f 74 69 63 65 |nd{quote|}.Notice|
|00004b20| 20 77 65 20 70 72 69 6e | 74 20 74 68 65 20 5c 74 | we prin|t the \t|
|00004b30| 6f 6b 65 6e 7b 3d 7d 20 | 74 6f 6b 65 6e 20 28 61 |oken{=} |token (a|
|00004b40| 73 73 69 67 6e 6d 65 6e | 74 29 20 61 73 20 24 5c |ssignmen|t) as $\|
|00004b50| 6c 65 66 74 61 72 72 6f | 77 24 2c 0a 77 68 65 72 |leftarro|w$,.wher|
|00004b60| 65 61 73 20 77 65 20 70 | 72 69 6e 74 20 74 68 65 |eas we p|rint the|
|00004b70| 20 5c 74 6f 6b 65 6e 7b | 3d 3d 7d 7e 74 6f 6b 65 | \token{|==}~toke|
|00004b80| 6e 20 28 63 6f 6d 70 61 | 72 69 73 6f 6e 29 20 61 |n (compa|rison) a|
|00004b90| 73 20 24 5c 65 71 75 69 | 76 24 2e 0a 54 68 69 73 |s $\equi|v$..This|
|00004ba0| 20 6d 61 6b 65 73 20 69 | 74 20 61 20 62 69 74 20 | makes i|t a bit |
|00004bb0| 65 61 73 69 65 72 20 66 | 6f 72 20 75 73 20 74 6f |easier f|or us to|
|00004bc0| 20 73 65 65 20 77 68 65 | 6e 20 61 20 70 72 6f 67 | see whe|n a prog|
|00004bd0| 72 61 6d 6d 65 72 20 68 | 61 73 0a 6d 69 73 74 61 |rammer h|as.mista|
|00004be0| 6b 65 6e 6c 79 20 75 73 | 65 64 20 5c 74 6f 6b 65 |kenly us|ed \toke|
|00004bf0| 6e 7b 3d 7d 20 69 6e 73 | 74 65 61 64 20 6f 66 20 |n{=} ins|tead of |
|00004c00| 5c 74 6f 6b 65 6e 7b 3d | 3d 7d 2e 0a 0a 0a 54 68 |\token{=|=}....Th|
|00004c10| 65 20 70 72 65 74 74 79 | 70 72 69 6e 74 69 6e 67 |e pretty|printing|
|00004c20| 20 67 72 61 6d 6d 61 72 | 20 66 6f 72 20 43 7e 65 | grammar| for C~e|
|00004c30| 78 70 72 65 73 73 69 6f | 6e 73 20 69 73 3a 0a 5c |xpressio|ns is:.\|
|00004c40| 62 65 67 69 6e 7b 71 75 | 6f 74 65 7d 0a 5c 62 65 |begin{qu|ote}.\be|
|00004c50| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0a 6d 61 |gin{verb|atim}.ma|
|00004c60| 74 68 20 62 69 6e 6f 70 | 20 6d 61 74 68 20 2d 2d |th binop| math --|
|00004c70| 3e 20 6d 61 74 68 0a 6d | 61 74 68 20 75 6e 6f 70 |> math.m|ath unop|
|00004c80| 20 2d 2d 3e 20 6d 61 74 | 68 0a 75 6e 6f 70 20 6d | --> mat|h.unop m|
|00004c90| 61 74 68 20 2d 2d 3e 20 | 6d 61 74 68 0a 6f 70 65 |ath --> |math.ope|
|00004ca0| 6e 20 6d 61 74 68 20 63 | 6c 6f 73 65 20 2d 2d 3e |n math c|lose -->|
|00004cb0| 20 6d 61 74 68 0a 5c 65 | 6e 64 7b 76 65 72 62 61 | math.\e|nd{verba|
|00004cc0| 74 69 6d 7d 0a 5c 65 6e | 64 7b 71 75 6f 74 65 7d |tim}.\en|d{quote}|
|00004cd0| 0a 55 73 69 6e 67 20 74 | 68 69 73 20 67 72 61 6d |.Using t|his gram|
|00004ce0| 6d 61 72 2c 20 7b 5c 74 | 74 20 57 45 41 56 45 7d |mar, {\t|t WEAVE}|
|00004cf0| 20 63 61 6e 20 74 61 6b | 65 20 61 20 6c 6f 6e 67 | can tak|e a long|
|00004d00| 20 65 78 70 72 65 73 73 | 69 6f 6e 20 63 6f 6e 73 | express|ion cons|
|00004d10| 69 73 74 69 6e 67 0a 6f | 66 20 6d 61 6e 79 20 73 |isting.o|f many s|
|00004d20| 63 72 61 70 73 2c 20 61 | 6e 64 20 72 65 64 75 63 |craps, a|nd reduc|
|00004d30| 65 20 69 74 20 61 6c 6c | 20 74 6f 20 61 20 73 69 |e it all| to a si|
|00004d40| 6e 67 6c 65 20 73 63 72 | 61 70 20 6f 66 20 63 61 |ngle scr|ap of ca|
|00004d50| 74 65 67 6f 72 79 20 7b | 5c 74 74 0a 6d 61 74 68 |tegory {|\tt.math|
|00004d60| 7d 2e 20 0a 0a 57 68 61 | 74 20 61 62 6f 75 74 20 |}. ..Wha|t about |
|00004d70| 61 6e 20 6f 70 65 72 61 | 74 6f 72 20 6c 69 6b 65 |an opera|tor like|
|00004d80| 20 60 60 7b 5c 74 74 20 | 2a 7d 27 27 2c 20 77 68 | ``{\tt |*}'', wh|
|00004d90| 69 63 68 20 69 73 20 62 | 6f 74 68 20 62 69 6e 61 |ich is b|oth bina|
|00004da0| 72 79 20 69 6e 66 69 78 | 0a 61 6e 64 20 75 6e 61 |ry infix|.and una|
|00004db0| 72 79 20 70 72 65 66 69 | 78 3f 20 0a 54 68 69 73 |ry prefi|x? .This|
|00004dc0| 20 64 6f 65 73 20 74 68 | 65 20 6a 6f 62 3a 0a 5c | does th|e job:.\|
|00004dd0| 62 65 67 69 6e 7b 71 75 | 6f 74 65 7d 0a 5c 62 65 |begin{qu|ote}.\be|
|00004de0| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0a 74 6f |gin{verb|atim}.to|
|00004df0| 6b 65 6e 20 2a 20 63 61 | 74 65 67 6f 72 79 20 75 |ken * ca|tegory u|
|00004e00| 6e 6f 72 62 69 6e 6f 70 | 0a 75 6e 6f 72 62 69 6e |norbinop|.unorbin|
|00004e10| 6f 70 20 6d 61 74 68 20 | 2d 2d 3e 20 6d 61 74 68 |op math |--> math|
|00004e20| 0a 6d 61 74 68 20 75 6e | 6f 72 62 69 6e 6f 70 20 |.math un|orbinop |
|00004e30| 6d 61 74 68 20 2d 2d 3e | 20 6d 61 74 68 0a 5c 65 |math -->| math.\e|
|00004e40| 6e 64 7b 76 65 72 62 61 | 74 69 6d 7d 0a 5c 65 6e |nd{verba|tim}.\en|
|00004e50| 64 7b 71 75 6f 74 65 7d | 0a 0a 25 20 4e 6f 20 4e |d{quote}|..% No N|
|00004e60| 6f 74 65 20 61 62 6f 75 | 74 20 63 6f 6e 74 65 78 |ote abou|t contex|
|00004e70| 74 2d 73 65 6e 73 69 74 | 69 76 65 20 72 65 64 75 |t-sensit|ive redu|
|00004e80| 63 74 69 6f 6e 73 3f 0a | 0a 54 68 65 72 65 20 69 |ctions?.|.There i|
|00004e90| 73 20 61 20 6d 65 63 68 | 61 6e 69 73 6d 20 66 6f |s a mech|anism fo|
|00004ea0| 72 20 61 73 73 69 67 6e | 69 6e 67 20 63 61 74 65 |r assign|ing cate|
|00004eb0| 67 6f 72 69 65 73 20 61 | 6e 64 20 74 72 61 6e 73 |gories a|nd trans|
|00004ec0| 6c 61 74 69 6f 6e 73 20 | 74 6f 0a 72 65 73 65 72 |lations |to.reser|
|00004ed0| 76 65 64 20 77 6f 72 64 | 73 20 61 73 20 77 65 6c |ved word|s as wel|
|00004ee0| 6c 20 61 73 20 74 6f 20 | 74 6f 6b 65 6e 73 2c 20 |l as to |tokens, |
|00004ef0| 75 73 69 6e 67 20 73 6c | 69 67 68 74 6c 79 20 64 |using sl|ightly d|
|00004f00| 69 66 66 65 72 65 6e 74 | 20 73 79 6e 74 61 78 2e |ifferent| syntax.|
|00004f10| 20 0a 0a 54 6f 20 67 69 | 76 65 20 61 6e 20 69 64 | ..To gi|ve an id|
|00004f20| 65 61 20 6f 66 20 74 68 | 65 20 63 6f 6d 70 6c 65 |ea of th|e comple|
|00004f30| 78 69 74 79 20 6f 66 20 | 74 68 65 20 67 72 61 6d |xity of |the gram|
|00004f40| 6d 61 72 73 2c 20 74 68 | 65 20 67 72 61 6d 6d 61 |mars, th|e gramma|
|00004f50| 72 0a 64 65 73 63 72 69 | 62 69 6e 67 20 41 57 4b |r.descri|bing AWK|
|00004f60| 20 75 73 65 73 20 32 34 | 7e 63 61 74 65 67 6f 72 | uses 24|~categor|
|00004f70| 69 65 73 20 69 6e 20 33 | 39 7e 70 72 6f 64 75 63 |ies in 3|9~produc|
|00004f80| 74 69 6f 6e 73 2e 0a 54 | 68 65 20 41 64 61 20 67 |tions..T|he Ada g|
|00004f90| 72 61 6d 6d 61 72 20 75 | 73 65 73 20 34 30 7e 63 |rammar u|ses 40~c|
|00004fa0| 61 74 65 67 6f 72 69 65 | 73 20 69 6e 20 36 35 7e |ategorie|s in 65~|
|00004fb0| 70 72 6f 64 75 63 74 69 | 6f 6e 73 2c 20 61 6e 64 |producti|ons, and|
|00004fc0| 20 74 68 65 0a 43 7e 67 | 72 61 6d 6d 61 72 20 75 | the.C~g|rammar u|
|00004fd0| 73 65 73 20 35 34 7e 63 | 61 74 65 67 6f 72 69 65 |ses 54~c|ategorie|
|00004fe0| 73 20 69 6e 20 31 32 39 | 7e 70 72 6f 64 75 63 74 |s in 129|~product|
|00004ff0| 69 6f 6e 73 2e 0a 0a 5c | 6d 65 64 73 6b 69 70 0a |ions...\|medskip.|
|00005000| 0a 7b 5c 74 74 20 53 50 | 49 44 45 52 7d 2d 67 65 |.{\tt SP|IDER}-ge|
|00005010| 6e 65 72 61 74 65 64 20 | 76 65 72 73 69 6f 6e 73 |nerated |versions|
|00005020| 20 6f 66 20 7b 5c 74 74 | 20 54 41 4e 47 4c 45 7d | of {\tt| TANGLE}|
|00005030| 20 61 6e 64 20 7b 5c 74 | 74 20 57 45 41 56 45 7d | and {\t|t WEAVE}|
|00005040| 20 64 69 66 66 65 72 0a | 73 75 62 74 6c 79 20 66 | differ.|subtly f|
|00005050| 72 6f 6d 20 74 68 65 20 | 6f 72 69 67 69 6e 61 6c |rom the |original|
|00005060| 73 20 77 72 69 74 74 65 | 6e 20 62 79 20 44 6f 6e |s writte|n by Don|
|00005070| 61 6c 64 20 4b 6e 75 74 | 68 2e 0a 54 68 65 20 6d |ald Knut|h..The m|
|00005080| 6f 73 74 20 69 6d 70 6f | 72 74 61 6e 74 20 64 69 |ost impo|rtant di|
|00005090| 66 66 65 72 65 6e 63 65 | 20 69 73 20 74 68 61 74 |fference| is that|
|000050a0| 20 7b 5c 74 74 20 53 50 | 49 44 45 52 7d 2d 67 65 | {\tt SP|IDER}-ge|
|000050b0| 6e 65 72 61 74 65 64 20 | 7b 5c 74 74 20 57 45 42 |nerated |{\tt WEB|
|000050c0| 7d 0a 69 73 20 6e 6f 74 | 20 73 65 6c 66 2d 63 6f |}.is not| self-co|
|000050d0| 6e 74 61 69 6e 65 64 3a | 20 77 68 65 72 65 20 4b |ntained:| where K|
|000050e0| 6e 75 74 68 27 73 20 50 | 61 73 63 61 6c 20 7b 5c |nuth's P|ascal {\|
|000050f0| 74 74 20 57 45 42 7d 20 | 72 65 71 75 69 72 65 64 |tt WEB} |required|
|00005100| 20 6f 6e 6c 79 20 61 0a | 50 61 73 63 61 6c 20 63 | only a.|Pascal c|
|00005110| 6f 6d 70 69 6c 65 72 20 | 74 6f 20 62 72 69 6e 67 |ompiler |to bring|
|00005120| 20 75 70 2c 20 7b 5c 74 | 74 20 53 50 49 44 45 52 | up, {\t|t SPIDER|
|00005130| 7d 20 77 6f 75 6c 64 20 | 6e 65 65 64 20 61 20 43 |} would |need a C|
|00005140| 7e 63 6f 6d 70 69 6c 65 | 72 20 61 6e 64 0a 61 6e |~compile|r and.an|
|00005150| 20 41 57 4b 7e 69 6e 74 | 65 72 70 72 65 74 65 72 | AWK~int|erpreter|
|00005160| 20 74 6f 20 67 65 6e 65 | 72 61 74 65 20 61 20 50 | to gene|rate a P|
|00005170| 61 73 63 61 6c 20 7b 5c | 74 74 20 57 45 42 7d 2c |ascal {\|tt WEB},|
|00005180| 20 61 6e 64 20 61 20 50 | 61 73 63 61 6c 0a 63 6f | and a P|ascal.co|
|00005190| 6d 70 69 6c 65 72 20 66 | 6f 72 20 74 68 65 20 72 |mpiler f|or the r|
|000051a0| 65 73 75 6c 74 69 6e 67 | 20 7b 5c 74 74 20 57 45 |esulting| {\tt WE|
|000051b0| 42 7d 20 74 6f 20 62 65 | 20 6f 66 20 61 6e 79 20 |B} to be| of any |
|000051c0| 75 73 65 2e 0a 4f 74 68 | 65 72 20 64 69 66 66 65 |use..Oth|er diffe|
|000051d0| 72 65 6e 63 65 73 20 61 | 72 65 20 6d 69 6e 6f 72 |rences a|re minor|
|000051e0| 3b 20 66 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 4b |; for ex|ample, K|
|000051f0| 6e 75 74 68 27 73 20 7b | 5c 74 74 20 54 41 4e 47 |nuth's {|\tt TANG|
|00005200| 4c 45 7d 0a 64 6f 65 73 | 20 61 72 69 74 68 6d 65 |LE}.does| arithme|
|00005210| 74 69 63 20 6f 6e 20 63 | 6f 6e 73 74 61 6e 74 73 |tic on c|onstants|
|00005220| 20 61 74 20 7b 5c 74 74 | 20 54 41 4e 47 4c 45 7d | at {\tt| TANGLE}|
|00005230| 20 74 69 6d 65 2c 20 62 | 75 74 20 7b 5c 74 74 0a | time, b|ut {\tt.|
|00005240| 53 50 49 44 45 52 7d 2d | 67 65 6e 65 72 61 74 65 |SPIDER}-|generate|
|00005250| 64 20 7b 5c 74 74 20 54 | 41 4e 47 4c 45 7d 73 20 |d {\tt T|ANGLE}s |
|00005260| 64 6f 20 6e 6f 74 2e 0a | 4b 6e 75 74 68 27 73 20 |do not..|Knuth's |
|00005270| 7b 5c 74 74 20 54 41 4e | 47 4c 45 7d 20 70 72 6f |{\tt TAN|GLE} pro|
|00005280| 76 69 64 65 73 20 74 68 | 72 65 65 20 64 69 66 66 |vides th|ree diff|
|00005290| 65 72 65 6e 74 20 6b 69 | 6e 64 73 20 6f 66 20 6d |erent ki|nds of m|
|000052a0| 61 63 72 6f 73 2c 20 62 | 75 74 0a 6e 6f 6e 65 20 |acros, b|ut.none |
|000052b0| 77 69 74 68 20 6d 6f 72 | 65 20 74 68 61 6e 20 6f |with mor|e than o|
|000052c0| 6e 65 20 70 61 72 61 6d | 65 74 65 72 3b 0a 7b 5c |ne param|eter;.{\|
|000052d0| 74 74 20 53 50 49 44 45 | 52 7d 2d 67 65 6e 65 72 |tt SPIDE|R}-gener|
|000052e0| 61 74 65 64 20 7b 5c 74 | 74 20 54 41 4e 47 4c 45 |ated {\t|t TANGLE|
|000052f0| 7d 73 20 70 72 6f 76 69 | 64 65 20 6f 6e 6c 79 20 |}s provi|de only |
|00005300| 6f 6e 65 20 6b 69 6e 64 | 20 6f 66 20 6d 61 63 72 |one kind| of macr|
|00005310| 6f 2c 0a 62 75 74 20 6d | 61 63 72 6f 73 20 6f 66 |o,.but m|acros of|
|00005320| 20 74 68 61 74 20 6b 69 | 6e 64 20 6d 61 79 20 68 | that ki|nd may h|
|00005330| 61 76 65 20 66 72 6f 6d | 20 7a 65 72 6f 20 74 6f |ave from| zero to|
|00005340| 20 74 68 69 72 74 79 2d | 74 77 6f 20 70 61 72 61 | thirty-|two para|
|00005350| 6d 65 74 65 72 73 2e 0a | 0a 0a 0a 7b 5c 74 74 20 |meters..|...{\tt |
|00005360| 53 50 49 44 45 52 7d 20 | 69 73 20 61 20 7b 5c 74 |SPIDER} |is a {\t|
|00005370| 74 20 57 45 42 7d 20 67 | 65 6e 65 72 61 74 6f 72 |t WEB} g|enerator|
|00005380| 2c 20 61 6b 69 6e 20 74 | 6f 20 70 61 72 73 65 72 |, akin t|o parser|
|00005390| 20 67 65 6e 65 72 61 74 | 6f 72 73 2e 0a 42 6f 74 | generat|ors..Bot|
|000053a0| 68 20 72 65 61 64 20 66 | 6f 72 6d 61 6c 20 64 65 |h read f|ormal de|
|000053b0| 73 63 72 69 70 74 69 6f | 6e 73 20 6f 66 20 73 6f |scriptio|ns of so|
|000053c0| 6d 65 20 70 61 72 74 20 | 6f 66 20 61 20 70 72 6f |me part |of a pro|
|000053d0| 67 72 61 6d 6d 69 6e 67 | 20 6c 61 6e 67 75 61 67 |gramming| languag|
|000053e0| 65 2c 0a 61 6e 64 20 62 | 6f 74 68 20 70 72 6f 64 |e,.and b|oth prod|
|000053f0| 75 63 65 20 63 6f 64 65 | 20 74 68 61 74 20 70 72 |uce code| that pr|
|00005400| 6f 63 65 73 73 65 73 20 | 70 72 6f 67 72 61 6d 73 |ocesses |programs|
|00005410| 20 77 72 69 74 74 65 6e | 20 69 6e 20 74 68 61 74 | written| in that|
|00005420| 20 6c 61 6e 67 75 61 67 | 65 2e 0a 53 69 6e 63 65 | languag|e..Since|
|00005430| 20 62 6f 74 68 20 70 72 | 6f 64 75 63 65 20 63 6f | both pr|oduce co|
|00005440| 64 65 20 74 68 61 74 20 | 69 73 20 70 61 72 74 20 |de that |is part |
|00005450| 6f 66 20 74 68 65 20 60 | 60 63 6f 6d 70 69 6c 65 |of the `|`compile|
|00005460| 72 2c 27 27 20 75 73 69 | 6e 67 20 74 68 65 6d 0a |r,'' usi|ng them.|
|00005470| 64 6f 65 73 6e 27 74 20 | 69 6e 74 72 6f 64 75 63 |doesn't |introduc|
|00005480| 65 20 61 6e 79 20 65 78 | 74 72 61 20 73 74 65 70 |e any ex|tra step|
|00005490| 73 20 69 6e 74 6f 20 74 | 68 65 20 70 72 6f 63 65 |s into t|he proce|
|000054a0| 73 73 69 6e 67 20 6f 66 | 20 75 73 65 72 20 70 72 |ssing of| user pr|
|000054b0| 6f 67 72 61 6d 73 2e 0a | 7b 5c 74 74 20 53 50 49 |ograms..|{\tt SPI|
|000054c0| 44 45 52 7d 20 69 74 73 | 65 6c 66 20 69 73 20 61 |DER} its|elf is a|
|000054d0| 20 6c 61 72 67 65 20 41 | 57 4b 20 73 63 72 69 70 | large A|WK scrip|
|000054e0| 74 2c 20 77 72 69 74 74 | 65 6e 20 61 73 20 61 20 |t, writt|en as a |
|000054f0| 7b 5c 74 74 20 57 45 42 | 7d 0a 70 72 6f 67 72 61 |{\tt WEB|}.progra|
|00005500| 6d 2e 20 20 0a 7b 5c 74 | 74 20 73 70 69 64 65 72 |m. .{\t|t spider|
|00005510| 2e 77 65 62 7d 20 69 73 | 20 61 62 6f 75 74 20 32 |.web} is| about 2|
|00005520| 36 30 30 20 6c 69 6e 65 | 73 20 6c 6f 6e 67 3b 20 |600 line|s long; |
|00005530| 61 62 6f 75 74 20 61 20 | 74 68 69 72 64 20 6f 66 |about a |third of|
|00005540| 20 74 68 65 73 65 20 61 | 72 65 0a 63 6f 6d 6d 65 | these a|re.comme|
|00005550| 6e 74 73 2e 20 0a 0a 0a | 54 68 65 20 6d 61 6a 6f |nts. ...|The majo|
|00005560| 72 20 63 6f 73 74 20 6f | 66 20 75 73 69 6e 67 20 |r cost o|f using |
|00005570| 7b 5c 74 74 20 53 50 49 | 44 45 52 7d 20 69 73 20 |{\tt SPI|DER} is |
|00005580| 74 68 65 20 63 6f 73 74 | 20 6f 66 20 6c 65 61 72 |the cost| of lear|
|00005590| 6e 69 6e 67 20 79 65 74 | 0a 61 6e 6f 74 68 65 72 |ning yet|.another|
|000055a0| 20 6c 61 6e 67 75 61 67 | 65 2e 0a 4c 65 61 72 6e | languag|e..Learn|
|000055b0| 69 6e 67 20 74 68 69 73 | 20 6c 61 6e 67 75 61 67 |ing this| languag|
|000055c0| 65 20 69 73 20 73 75 70 | 70 6f 73 65 64 20 74 6f |e is sup|posed to|
|000055d0| 20 73 75 62 73 74 69 74 | 75 74 65 20 66 6f 72 20 | substit|ute for |
|000055e0| 6c 65 61 72 6e 69 6e 67 | 20 68 6f 77 20 74 6f 0a |learning| how to.|
|000055f0| 6d 6f 64 69 66 79 20 7b | 5c 74 74 20 57 45 42 7d |modify {|\tt WEB}|
|00005600| 2c 20 73 6f 20 69 74 20 | 69 73 20 70 72 6f 62 61 |, so it |is proba|
|00005610| 62 6c 79 20 6e 6f 74 20 | 61 6e 20 65 78 6f 72 62 |bly not |an exorb|
|00005620| 69 74 61 6e 74 20 63 6f | 73 74 2e 0a 53 6f 6d 65 |itant co|st..Some|
|00005630| 20 6f 74 68 65 72 20 6c | 69 6d 69 74 61 74 69 6f | other l|imitatio|
|00005640| 6e 73 20 61 72 65 20 74 | 68 65 20 74 68 65 20 6e |ns are t|he the n|
|00005650| 65 65 64 20 66 6f 72 20 | 61 20 43 7e 63 6f 6d 70 |eed for |a C~comp|
|00005660| 69 6c 65 72 20 61 6e 64 | 20 61 6e 0a 41 57 4b 7e |iler and| an.AWK~|
|00005670| 69 6e 74 65 72 70 72 65 | 74 65 72 2c 20 61 6e 64 |interpre|ter, and|
|00005680| 20 74 68 65 20 6e 65 65 | 64 20 74 6f 20 75 73 65 | the nee|d to use|
|00005690| 20 61 20 6c 6f 77 65 73 | 74 2d 63 6f 6d 6d 6f 6e | a lowes|t-common|
|000056a0| 2d 64 65 6e 6f 6d 69 6e | 61 74 6f 72 0a 6c 65 78 |-denomin|ator.lex|
|000056b0| 69 63 61 6c 20 61 6e 61 | 6c 79 7a 65 72 2e 20 0a |ical ana|lyzer. .|
|000056c0| 0a 54 68 65 20 6d 61 6a | 6f 72 20 62 65 6e 65 66 |.The maj|or benef|
|000056d0| 69 74 20 6f 66 20 75 73 | 69 6e 67 20 7b 5c 74 74 |it of us|ing {\tt|
|000056e0| 20 53 50 49 44 45 52 7d | 20 69 73 20 74 68 65 20 | SPIDER}| is the |
|000056f0| 65 61 73 65 20 77 69 74 | 68 20 77 68 69 63 68 20 |ease wit|h which |
|00005700| 6e 65 77 0a 7b 5c 74 74 | 20 57 45 42 7d 73 20 63 |new.{\tt| WEB}s c|
|00005710| 61 6e 20 62 65 20 62 75 | 69 6c 74 2e 0a 25 5c 72 |an be bu|ilt..%\r|
|00005720| 65 6d 61 72 6b 7b 28 48 | 65 72 65 20 69 73 20 74 |emark{(H|ere is t|
|00005730| 68 65 20 70 6c 61 63 65 | 20 74 6f 20 74 61 6c 6b |he place| to talk|
|00005740| 20 61 62 6f 75 74 20 4f | 62 65 72 6f 6e 2e 29 7d | about O|beron.)}|
|00005750| 0a 54 68 65 20 7b 5c 74 | 74 20 53 50 49 44 45 52 |.The {\t|t SPIDER|
|00005760| 7d 20 64 65 73 63 72 69 | 70 74 69 6f 6e 20 6f 66 |} descri|ption of|
|00005770| 20 61 20 6c 61 6e 67 75 | 61 67 65 20 69 73 20 6d | a langu|age is m|
|00005780| 75 63 68 20 73 6d 61 6c | 6c 65 72 20 74 68 61 6e |uch smal|ler than|
|00005790| 20 74 68 65 0a 7b 5c 74 | 74 20 57 45 42 7d 20 69 | the.{\t|t WEB} i|
|000057a0| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 20 67 65 |mplement|ation ge|
|000057b0| 6e 65 72 61 74 65 64 20 | 66 72 6f 6d 20 74 68 61 |nerated |from tha|
|000057c0| 74 20 64 65 73 63 72 69 | 70 74 69 6f 6e 2c 20 61 |t descri|ption, a|
|000057d0| 6e 64 20 7b 5c 74 74 0a | 53 50 49 44 45 52 7d 20 |nd {\tt.|SPIDER} |
|000057e0| 64 65 73 63 72 69 70 74 | 69 6f 6e 73 20 6f 66 20 |descript|ions of |
|000057f0| 73 69 6d 69 6c 61 72 20 | 6c 61 6e 67 75 61 67 65 |similar |language|
|00005800| 73 20 61 72 65 20 73 69 | 6d 69 6c 61 72 2e 0a 55 |s are si|milar..U|
|00005810| 73 69 6e 67 20 7b 5c 74 | 74 20 53 50 49 44 45 52 |sing {\t|t SPIDER|
|00005820| 7d 20 6f 6e 65 20 63 61 | 6e 20 62 75 69 6c 64 20 |} one ca|n build |
|00005830| 61 20 7b 5c 74 74 20 57 | 45 42 7d 20 77 69 74 68 |a {\tt W|EB} with|
|00005840| 6f 75 74 20 75 6e 64 65 | 72 73 74 61 6e 64 69 6e |out unde|rstandin|
|00005850| 67 20 74 68 65 0a 64 65 | 74 61 69 6c 73 20 6f 66 |g the.de|tails of|
|00005860| 20 7b 5c 74 74 20 57 45 | 42 7d 27 73 20 69 6d 70 | {\tt WE|B}'s imp|
|00005870| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 2c 20 61 6e 64 |lementat|ion, and|
|00005880| 20 6f 6e 65 20 63 61 6e | 20 65 61 73 69 6c 79 20 | one can| easily |
|00005890| 61 64 6a 75 73 74 20 74 | 68 61 74 0a 7b 5c 74 74 |adjust t|hat.{\tt|
|000058a0| 20 57 45 42 7d 20 74 6f | 20 63 68 61 6e 67 65 20 | WEB} to| change |
|000058b0| 61 73 20 61 20 6c 61 6e | 67 75 61 67 65 20 64 65 |as a lan|guage de|
|000058c0| 66 69 6e 69 74 69 6f 6e | 20 63 68 61 6e 67 65 73 |finition| changes|
|000058d0| 2e 0a 25 5c 72 65 6d 61 | 72 6b 7b 43 6f 75 6c 64 |..%\rema|rk{Could|
|000058e0| 20 6d 65 6e 74 69 6f 6e | 20 77 6f 72 6b 20 77 69 | mention| work wi|
|000058f0| 74 68 20 4c 61 72 63 68 | 2f 41 64 61 2d 38 38 7d |th Larch|/Ada-88}|
|00005900| 0a 0a 0a 0a 7b 5c 74 74 | 20 53 50 49 44 45 52 7d |....{\tt| SPIDER}|
|00005910| 20 20 73 68 6f 75 6c 64 | 20 6d 61 6b 65 20 6f 6e | should| make on|
|00005920| 65 20 6c 69 74 65 72 61 | 74 65 20 70 72 6f 67 72 |e litera|te progr|
|00005930| 61 6d 6d 69 6e 67 20 74 | 6f 6f 6c 2c 20 7b 5c 74 |amming t|ool, {\t|
|00005940| 74 20 57 45 42 7d 2c 0a | 61 76 61 69 6c 61 62 6c |t WEB},.|availabl|
|00005950| 65 20 74 6f 20 61 20 6d | 75 63 68 20 6c 61 72 67 |e to a m|uch larg|
|00005960| 65 72 20 61 75 64 69 65 | 6e 63 65 2e 0a 49 20 68 |er audie|nce..I h|
|00005970| 6f 70 65 20 74 68 61 74 | 2c 20 62 79 20 73 65 70 |ope that|, by sep|
|00005980| 61 72 61 74 69 6e 67 20 | 74 68 65 20 6c 61 6e 67 |arating |the lang|
|00005990| 75 61 67 65 2d 69 6e 64 | 65 70 65 6e 64 65 6e 74 |uage-ind|ependent|
|000059a0| 20 70 61 72 74 73 20 6f | 66 20 7b 5c 74 74 20 57 | parts o|f {\tt W|
|000059b0| 45 41 56 45 7d 0a 61 6e | 64 20 7b 5c 74 74 20 54 |EAVE}.an|d {\tt T|
|000059c0| 41 4e 47 4c 45 7d 2c 20 | 7b 5c 74 74 20 53 50 49 |ANGLE}, |{\tt SPI|
|000059d0| 44 45 52 7d 20 77 69 6c | 6c 20 20 65 6e 63 6f 75 |DER} wil|l encou|
|000059e0| 72 61 67 65 20 75 73 20 | 6e 6f 74 20 6a 75 73 74 |rage us |not just|
|000059f0| 20 74 6f 20 74 68 69 6e | 6b 0a 61 62 6f 75 74 20 | to thin|k.about |
|00005a00| 77 68 61 74 20 74 68 65 | 20 65 73 73 65 6e 63 65 |what the| essence|
|00005a10| 20 6f 66 20 74 61 6e 67 | 6c 69 6e 67 20 61 6e 64 | of tang|ling and|
|00005a20| 20 77 65 61 76 69 6e 67 | 20 69 73 2c 20 62 75 74 | weaving| is, but|
|00005a30| 20 61 6c 73 6f 20 61 62 | 6f 75 74 20 77 68 61 74 | also ab|out what|
|00005a40| 0a 74 68 65 20 65 73 73 | 65 6e 63 65 20 6f 66 20 |.the ess|ence of |
|00005a50| 6c 69 74 65 72 61 74 65 | 20 70 72 6f 67 72 61 6d |literate| program|
|00005a60| 6d 69 6e 67 20 69 73 2e | 0a 0a 0a 5c 6d 65 64 73 |ming is.|...\meds|
|00005a70| 6b 69 70 0a 0a 49 20 65 | 6e 6a 6f 79 65 64 20 6d |kip..I e|njoyed m|
|00005a80| 61 6e 79 20 75 73 65 66 | 75 6c 20 64 69 73 63 75 |any usef|ul discu|
|00005a90| 73 73 69 6f 6e 73 20 6f | 66 20 7b 5c 74 74 20 57 |ssions o|f {\tt W|
|00005aa0| 45 42 7d 20 77 69 74 68 | 20 43 68 61 72 6c 69 65 |EB} with| Charlie|
|00005ab0| 20 4d 69 6c 6c 73 2e 0a | 49 20 61 6d 20 67 72 61 | Mills..|I am gra|
|00005ac0| 74 65 66 75 6c 20 74 6f | 0a 53 69 6c 76 69 6f 20 |teful to|.Silvio |
|00005ad0| 4c 65 76 79 20 66 6f 72 | 20 70 72 6f 76 69 64 69 |Levy for| providi|
|00005ae0| 6e 67 20 68 69 73 20 7b | 5c 74 74 20 43 57 45 42 |ng his {|\tt CWEB|
|00005af0| 7d 20 61 73 20 74 68 65 | 20 62 61 73 69 73 20 66 |} as the| basis f|
|00005b00| 6f 72 20 74 68 65 0a 60 | 60 6d 61 73 74 65 72 20 |or the.`|`master |
|00005b10| 63 6f 70 69 65 73 27 27 | 20 6f 66 20 7b 5c 74 74 |copies''| of {\tt|
|00005b20| 20 54 41 4e 47 4c 45 7d | 20 61 6e 64 20 7b 5c 74 | TANGLE}| and {\t|
|00005b30| 74 20 57 45 41 56 45 7d | 2c 20 61 6e 64 20 74 6f |t WEAVE}|, and to|
|00005b40| 0a 44 61 76 65 20 48 61 | 6e 73 6f 6e 20 66 6f 72 |.Dave Ha|nson for|
|00005b50| 20 63 6f 6d 6d 65 6e 74 | 73 20 6f 6e 20 61 6e 20 | comment|s on an |
|00005b60| 65 61 72 6c 69 65 72 20 | 76 65 72 73 69 6f 6e 20 |earlier |version |
|00005b70| 6f 66 20 74 68 69 73 20 | 70 61 70 65 72 2e 0a 0a |of this |paper...|
|00005b80| 5c 62 65 67 69 6e 7b 74 | 68 65 62 69 62 6c 69 6f |\begin{t|hebiblio|
|00005b90| 67 72 61 70 68 79 7d 7b | 76 61 6e 7e 4b 6e 75 74 |graphy}{|van~Knut|
|00005ba0| 68 7e 39 39 39 7d 0a 5c | 62 69 62 69 74 65 6d 5b |h~999}.\|bibitem[|
|00005bb0| 42 65 6e 74 6c 65 79 7e | 38 36 5d 7b 62 65 6e 74 |Bentley~|86]{bent|
|00005bc0| 6c 65 79 3a 6c 70 7d 0a | 4a 6f 6e 20 4c 2e 20 42 |ley:lp}.|Jon L. B|
|00005bd0| 65 6e 74 6c 65 79 2c 20 | 60 60 50 72 6f 67 72 61 |entley, |``Progra|
|00005be0| 6d 6d 69 6e 67 20 50 65 | 61 72 6c 73 2c 27 27 0a |mming Pe|arls,''.|
|00005bf0| 7b 5c 73 6c 20 43 6f 6d | 6d 75 6e 69 63 61 74 69 |{\sl Com|municati|
|00005c00| 6f 6e 73 20 6f 66 20 74 | 68 65 20 41 43 4d 7d 20 |ons of t|he ACM} |
|00005c10| 7b 5c 62 66 20 32 39 3a | 35 7d 20 28 4d 61 79 7e |{\bf 29:|5} (May~|
|00005c20| 31 39 38 36 29 2c 20 33 | 36 34 2d 2d 33 36 38 2c |1986), 3|64--368,|
|00005c30| 20 61 6e 64 0a 7b 5c 62 | 66 20 32 39 3a 36 7d 20 | and.{\b|f 29:6} |
|00005c40| 28 4a 75 6e 65 7e 31 39 | 38 36 29 2c 20 34 37 31 |(June~19|86), 471|
|00005c50| 2d 2d 34 38 33 2e 0a 5c | 62 69 62 69 74 65 6d 5b |--483..\|bibitem[|
|00005c60| 4b 6e 75 74 68 7e 38 34 | 5d 7b 6b 6e 75 74 68 3a |Knuth~84|]{knuth:|
|00005c70| 6c 69 74 65 72 61 74 65 | 2d 70 72 6f 67 72 61 6d |literate|-program|
|00005c80| 6d 69 6e 67 7d 0a 44 6f | 6e 61 6c 64 20 45 2e 20 |ming}.Do|nald E. |
|00005c90| 4b 6e 75 74 68 2c 20 60 | 60 4c 69 74 65 72 61 74 |Knuth, `|`Literat|
|00005ca0| 65 20 50 72 6f 67 72 61 | 6d 6d 69 6e 67 2c 27 27 |e Progra|mming,''|
|00005cb0| 20 7b 5c 73 6c 20 54 68 | 65 20 43 6f 6d 70 75 74 | {\sl Th|e Comput|
|00005cc0| 65 72 20 4a 6f 75 72 6e | 61 6c 7d 0a 7b 5c 62 66 |er Journ|al}.{\bf|
|00005cd0| 20 32 37 3a 32 7d 28 31 | 39 38 34 29 2c 20 39 37 | 27:2}(1|984), 97|
|00005ce0| 2d 31 31 31 2e 0a 5c 62 | 69 62 69 74 65 6d 5b 4c |-111..\b|ibitem[L|
|00005cf0| 65 76 79 7e 38 37 5d 7b | 6c 65 76 79 3a 63 77 65 |evy~87]{|levy:cwe|
|00005d00| 62 7d 0a 53 69 6c 76 69 | 6f 20 4c 65 76 79 2c 20 |b}.Silvi|o Levy, |
|00005d10| 60 60 7b 5c 74 74 20 57 | 45 42 7d 20 41 64 61 70 |``{\tt W|EB} Adap|
|00005d20| 74 65 64 20 74 6f 20 43 | 2c 20 41 6e 6f 74 68 65 |ted to C|, Anothe|
|00005d30| 72 20 41 70 70 72 6f 61 | 63 68 2c 27 27 0a 20 7b |r Approa|ch,''. {|
|00005d40| 5c 73 6c 20 54 55 47 42 | 6f 61 74 7d 20 7b 5c 62 |\sl TUGB|oat} {\b|
|00005d50| 66 20 38 3a 31 7d 28 31 | 39 38 37 29 2c 20 31 32 |f 8:1}(1|987), 12|
|00005d60| 2d 2d 31 33 2e 0a 5c 62 | 69 62 69 74 65 6d 5b 4f |--13..\b|ibitem[O|
|00005d70| 70 70 65 6e 7e 38 30 5d | 7b 6f 70 70 65 6e 3a 70 |ppen~80]|{oppen:p|
|00005d80| 72 65 74 74 79 70 72 69 | 6e 74 69 6e 67 7d 0a 44 |rettypri|nting}.D|
|00005d90| 65 72 65 6b 20 4f 70 70 | 65 6e 2c 20 60 60 50 72 |erek Opp|en, ``Pr|
|00005da0| 65 74 74 79 70 72 69 6e | 74 69 6e 67 2c 27 27 20 |ettyprin|ting,'' |
|00005db0| 54 4f 50 4c 41 53 7e 7b | 5c 62 66 20 32 3a 34 7d |TOPLAS~{|\bf 2:4}|
|00005dc0| 20 28 4f 63 74 6f 62 65 | 72 20 31 39 38 30 29 2c | (Octobe|r 1980),|
|00005dd0| 0a 34 36 35 2d 2d 34 38 | 33 2e 20 0a 5c 62 69 62 |.465--48|3. .\bib|
|00005de0| 69 74 65 6d 5b 52 61 6d | 73 65 79 7e 38 39 5d 7b |item[Ram|sey~89]{|
|00005df0| 72 61 6d 73 65 79 3a 64 | 65 76 65 6c 6f 70 69 6e |ramsey:d|evelopin|
|00005e00| 67 7d 0a 4e 6f 72 6d 61 | 6e 20 52 61 6d 73 65 79 |g}.Norma|n Ramsey|
|00005e10| 2c 20 60 60 44 65 76 65 | 6c 6f 70 69 6e 67 20 46 |, ``Deve|loping F|
|00005e20| 6f 72 6d 61 6c 6c 79 20 | 56 65 72 69 66 69 65 64 |ormally |Verified|
|00005e30| 20 41 64 61 20 50 72 6f | 67 72 61 6d 73 2c 27 27 | Ada Pro|grams,''|
|00005e40| 0a 50 72 6f 63 65 65 64 | 69 6e 67 73 2c 20 7b 5c |.Proceed|ings, {\|
|00005e50| 73 6c 20 46 69 66 74 68 | 20 49 6e 74 65 72 6e 61 |sl Fifth| Interna|
|00005e60| 74 69 6f 6e 61 6c 20 57 | 6f 72 6b 73 68 6f 70 20 |tional W|orkshop |
|00005e70| 6f 6e 20 53 6f 66 74 77 | 61 72 65 0a 53 70 65 63 |on Softw|are.Spec|
|00005e80| 69 66 69 63 61 74 69 6f | 6e 20 61 6e 64 20 44 65 |ificatio|n and De|
|00005e90| 73 69 67 6e 7d 2c 20 74 | 6f 20 61 70 70 65 61 72 |sign}, t|o appear|
|00005ea0| 2e 0a 5c 62 69 62 69 74 | 65 6d 5b 56 61 6e 7e 57 |..\bibit|em[Van~W|
|00005eb0| 79 6b 7e 38 37 5d 7b 63 | 76 77 3a 6c 6f 6f 6d 7d |yk~87]{c|vw:loom}|
|00005ec0| 0a 43 68 72 69 73 74 6f | 70 68 65 72 20 4a 2e 20 |.Christo|pher J. |
|00005ed0| 56 61 6e 7e 57 79 6b 2c | 20 60 60 4c 69 74 65 72 |Van~Wyk,| ``Liter|
|00005ee0| 61 74 65 20 50 72 6f 67 | 72 61 6d 6d 69 6e 67 2c |ate Prog|ramming,|
|00005ef0| 27 27 0a 7b 5c 73 6c 20 | 43 6f 6d 6d 75 6e 69 63 |''.{\sl |Communic|
|00005f00| 61 74 69 6f 6e 73 20 6f | 66 20 74 68 65 20 41 43 |ations o|f the AC|
|00005f10| 4d 7d 20 7b 5c 62 66 20 | 33 30 3a 37 7d 20 28 4a |M} {\bf |30:7} (J|
|00005f20| 75 6c 79 7e 31 39 38 37 | 29 2c 20 35 39 33 2d 2d |uly~1987|), 593--|
|00005f30| 35 39 39 2c 20 61 6e 64 | 0a 7b 5c 62 66 20 33 30 |599, and|.{\bf 30|
|00005f40| 3a 31 32 7d 20 28 44 65 | 63 65 6d 62 65 72 7e 31 |:12} (De|cember~1|
|00005f50| 39 38 37 29 2c 20 31 30 | 30 30 2d 2d 31 30 31 30 |987), 10|00--1010|
|00005f60| 2e 0a 5c 65 6e 64 7b 74 | 68 65 62 69 62 6c 69 6f |..\end{t|hebiblio|
|00005f70| 67 72 61 70 68 79 7d 0a | 0a 5c 65 6e 64 7b 64 6f |graphy}.|.\end{do|
|00005f80| 63 75 6d 65 6e 74 7d 0a | |cument}.| |
+--------+-------------------------+-------------------------+--------+--------+