home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / SPIDER / DOC / SPIDERMA.TEX < prev    next >
LaTeX Document  |  1989-11-30  |  62.3 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 auxiliary file default
98% file LaTeX document, ASCII text default
100% TrID LaTeX 2e document (with rem) 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)
100% xdgMime text/x-matlab default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 20 43 6f 70 79 72 69 | 67 68 74 20 31 39 38 39 |% Copyri|ght 1989|
|00000010| 20 62 79 20 4e 6f 72 6d | 61 6e 20 52 61 6d 73 65 | by Norm|an Ramse|
|00000020| 79 20 61 6e 64 20 4f 64 | 79 73 73 65 79 20 52 65 |y and Od|yssey Re|
|00000030| 73 65 61 72 63 68 20 41 | 73 73 6f 63 69 61 74 65 |search A|ssociate|
|00000040| 73 0a 25 20 54 6f 20 62 | 65 20 75 73 65 64 20 66 |s.% To b|e used f|
|00000050| 6f 72 20 72 65 73 65 61 | 72 63 68 20 70 75 72 70 |or resea|rch purp|
|00000060| 6f 73 65 73 20 6f 6e 6c | 79 0a 25 20 46 6f 72 20 |oses onl|y.% For |
|00000070| 6d 6f 72 65 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |more inf|ormation|
|00000080| 2c 20 73 65 65 20 66 69 | 6c 65 20 43 4f 50 59 52 |, see fi|le COPYR|
|00000090| 49 47 48 54 20 69 6e 20 | 74 68 65 20 70 61 72 65 |IGHT in |the pare|
|000000a0| 6e 74 20 64 69 72 65 63 | 74 6f 72 79 0a 0a 25 20 |nt direc|tory..% |
|000000b0| 73 70 69 64 65 72 6d 61 | 6e 2e 74 65 78 2c 20 77 |spiderma|n.tex, w|
|000000c0| 69 74 68 20 61 70 6f 6c | 6f 67 69 65 73 20 74 6f |ith apol|ogies to|
|000000d0| 20 53 74 61 6e 20 4c 65 | 65 20 0a 0a 5c 64 6f 63 | Stan Le|e ..\doc|
|000000e0| 75 6d 65 6e 74 73 74 79 | 6c 65 5b 31 31 70 74 5d |umentsty|le[11pt]|
|000000f0| 7b 61 72 74 69 63 6c 65 | 7d 0a 5c 73 65 74 63 6f |{article|}.\setco|
|00000100| 75 6e 74 65 72 7b 73 65 | 63 6e 75 6d 64 65 70 74 |unter{se|cnumdept|
|00000110| 68 7d 7b 30 7d 0a 5c 6e | 65 77 63 6f 6d 6d 61 6e |h}{0}.\n|ewcomman|
|00000120| 64 7b 5c 73 79 6e 74 61 | 78 7d 5b 31 5d 7b 5c 6d |d{\synta|x}[1]{\m|
|00000130| 62 6f 78 7b 24 5c 6c 61 | 6e 67 6c 65 5c 68 62 6f |box{$\la|ngle\hbo|
|00000140| 78 7b 5c 73 6c 20 23 31 | 5c 2f 7d 5c 72 61 6e 67 |x{\sl #1|\/}\rang|
|00000150| 6c 65 24 7d 7d 0a 5c 6e | 65 77 63 6f 6d 6d 61 6e |le$}}.\n|ewcomman|
|00000160| 64 7b 5c 70 72 6f 64 75 | 63 65 73 7d 7b 5c 6d 62 |d{\produ|ces}{\mb|
|00000170| 6f 78 7b 24 7b 7d 3a 3a | 3d 7b 7d 24 7d 7d 0a 5c |ox{${}::|={}$}}.\|
|00000180| 6e 65 77 63 6f 6d 6d 61 | 6e 64 7b 5c 6f 70 74 7d |newcomma|nd{\opt}|
|00000190| 5b 31 5d 7b 24 5b 24 23 | 31 24 5d 24 7d 0a 5c 6e |[1]{$[$#|1$]$}.\n|
|000001a0| 65 77 63 6f 6d 6d 61 6e | 64 7b 5c 42 53 7d 7b 5c |ewcomman|d{\BS}{\|
|000001b0| 72 65 6c 61 78 7d 0a 5c | 63 68 61 72 64 65 66 5c |relax}.\|chardef\|
|000001c0| 42 53 3d 60 5c 5c 20 25 | 20 62 61 63 6b 73 6c 61 |BS=`\\ %| backsla|
|000001d0| 73 68 20 69 6e 20 61 20 | 73 74 72 69 6e 67 0a 0a |sh in a |string..|
|000001e0| 5c 74 69 74 6c 65 7b 41 | 20 7b 53 70 69 64 65 72 |\title{A| {Spider|
|000001f0| 7d 20 55 73 65 72 27 73 | 20 47 75 69 64 65 7d 0a |} User's| Guide}.|
|00000200| 5c 61 75 74 68 6f 72 7b | 4e 6f 72 6d 61 6e 20 52 |\author{|Norman R|
|00000210| 61 6d 73 65 79 5c 5c 44 | 65 70 61 72 74 6d 65 6e |amsey\\D|epartmen|
|00000220| 74 20 6f 66 20 43 6f 6d | 70 75 74 65 72 20 53 63 |t of Com|puter Sc|
|00000230| 69 65 6e 63 65 5c 5c 50 | 72 69 6e 63 65 74 6f 6e |ience\\P|rinceton|
|00000240| 20 55 6e 69 76 65 72 73 | 69 74 79 7d 0a 5c 64 61 | Univers|ity}.\da|
|00000250| 74 65 7b 4a 75 6c 79 20 | 31 39 38 39 7d 0a 5c 6e |te{July |1989}.\n|
|00000260| 65 77 63 6f 6d 6d 61 6e | 64 20 7b 5c 57 45 42 7d |ewcomman|d {\WEB}|
|00000270| 7b 7b 5c 74 74 20 57 45 | 42 7d 7d 0a 0a 5c 62 65 |{{\tt WE|B}}..\be|
|00000280| 67 69 6e 7b 64 6f 63 75 | 6d 65 6e 74 7d 0a 5c 6d |gin{docu|ment}.\m|
|00000290| 61 6b 65 74 69 74 6c 65 | 0a 0a 5c 73 65 63 74 69 |aketitle|..\secti|
|000002a0| 6f 6e 7b 49 6e 74 72 6f | 64 75 63 74 69 6f 6e 7d |on{Intro|duction}|
|000002b0| 0a 44 6f 6e 61 6c 64 20 | 4b 6e 75 74 68 20 64 65 |.Donald |Knuth de|
|000002c0| 76 65 6c 6f 70 65 64 20 | 74 68 65 20 7b 5c 74 74 |veloped |the {\tt|
|000002d0| 20 57 45 42 7d 20 73 79 | 73 74 65 6d 20 6f 66 20 | WEB} sy|stem of |
|000002e0| 73 74 72 75 63 74 75 72 | 65 64 20 64 6f 63 75 6d |structur|ed docum|
|000002f0| 65 6e 74 61 74 69 6f 6e | 20 0a 61 73 20 70 61 72 |entation| .as par|
|00000300| 74 20 6f 66 20 74 68 65 | 20 7b 5c 54 65 58 7d 20 |t of the| {\TeX} |
|00000310| 70 72 6f 6a 65 63 74 7e | 5c 63 69 74 65 7b 6b 6e |project~|\cite{kn|
|00000320| 75 74 68 3a 6c 69 74 65 | 72 61 74 65 2d 70 72 6f |uth:lite|rate-pro|
|00000330| 67 72 61 6d 6d 69 6e 67 | 7d 2e 0a 7b 5c 57 45 42 |gramming|}..{\WEB|
|00000340| 7d 20 65 6e 61 62 6c 65 | 73 20 61 20 70 72 6f 67 |} enable|s a prog|
|00000350| 72 61 6d 6d 65 72 20 74 | 6f 20 64 69 76 69 64 65 |rammer t|o divide|
|00000360| 20 68 69 73 20 6f 72 20 | 68 65 72 20 70 72 6f 67 | his or |her prog|
|00000370| 72 61 6d 20 69 6e 74 6f | 20 63 68 75 6e 6b 73 20 |ram into| chunks |
|00000380| 28 63 61 6c 6c 65 64 0a | 7b 5c 65 6d 20 6d 6f 64 |(called.|{\em mod|
|00000390| 75 6c 65 73 7d 29 2c 20 | 74 6f 20 61 73 73 6f 63 |ules}), |to assoc|
|000003a0| 69 61 74 65 20 74 65 78 | 74 20 77 69 74 68 20 65 |iate tex|t with e|
|000003b0| 61 63 68 20 63 68 75 6e | 6b 2c 20 61 6e 64 20 74 |ach chun|k, and t|
|000003c0| 6f 20 70 72 65 73 65 6e | 74 20 74 68 65 0a 63 68 |o presen|t the.ch|
|000003d0| 75 6e 6b 73 20 69 6e 20 | 69 6e 20 61 6e 79 20 6f |unks in |in any o|
|000003e0| 72 64 65 72 2e 0a 49 6e | 20 4b 6e 75 74 68 27 73 |rder..In| Knuth's|
|000003f0| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 2c | impleme|ntation,|
|00000400| 20 74 68 65 20 63 68 75 | 6e 6b 73 20 61 72 65 20 | the chu|nks are |
|00000410| 70 69 65 63 65 73 20 6f | 66 20 50 41 53 43 41 4c |pieces o|f PASCAL|
|00000420| 20 70 72 6f 67 72 61 6d | 73 2c 0a 61 6e 64 20 74 | program|s,.and t|
|00000430| 68 65 20 63 68 75 6e 6b | 73 20 61 72 65 20 66 6f |he chunk|s are fo|
|00000440| 72 6d 61 74 74 65 64 20 | 75 73 69 6e 67 20 7b 5c |rmatted |using {\|
|00000450| 54 65 58 7d 2e 0a 0a 20 | 20 54 68 65 20 7b 5c 74 |TeX}... | The {\t|
|00000460| 74 20 57 45 42 7d 20 69 | 64 65 61 20 73 75 67 67 |t WEB} i|dea sugg|
|00000470| 65 73 74 73 20 61 20 77 | 61 79 20 6f 66 20 63 6f |ests a w|ay of co|
|00000480| 6d 62 69 6e 69 6e 67 20 | 7b 5c 65 6d 20 61 6e 79 |mbining |{\em any|
|00000490| 7d 0a 70 72 6f 67 72 61 | 6d 6d 69 6e 67 20 6c 61 |}.progra|mming la|
|000004a0| 6e 67 75 61 67 65 20 77 | 69 74 68 20 7b 5c 65 6d |nguage w|ith {\em|
|000004b0| 20 61 6e 79 7d 20 64 6f | 63 75 6d 65 6e 74 20 66 | any} do|cument f|
|000004c0| 6f 72 6d 61 74 74 69 6e | 67 20 6c 61 6e 67 75 61 |ormattin|g langua|
|000004d0| 67 65 2c 0a 62 75 74 20 | 75 6e 74 69 6c 20 72 65 |ge,.but |until re|
|000004e0| 63 65 6e 74 6c 79 20 74 | 68 65 72 65 20 77 61 73 |cently t|here was|
|000004f0| 20 6e 6f 20 73 6f 66 74 | 77 61 72 65 20 73 75 70 | no soft|ware sup|
|00000500| 70 6f 72 74 20 66 6f 72 | 20 77 72 69 74 69 6e 67 |port for| writing|
|00000510| 20 61 6e 79 74 68 69 6e | 67 0a 62 75 74 20 50 41 | anythin|g.but PA|
|00000520| 53 43 41 4c 20 70 72 6f | 67 72 61 6d 73 20 75 73 |SCAL pro|grams us|
|00000530| 69 6e 67 20 7b 5c 74 74 | 20 57 45 42 7d 2e 0a 49 |ing {\tt| WEB}..I|
|00000540| 6e 7e 31 39 38 37 2c 20 | 53 69 6c 76 69 6f 20 4c |n~1987, |Silvio L|
|00000550| 65 76 79 20 72 65 77 72 | 6f 74 65 20 74 68 65 20 |evy rewr|ote the |
|00000560| 7b 5c 74 74 20 57 45 42 | 7d 20 73 79 73 74 65 6d |{\tt WEB|} system|
|00000570| 20 69 6e 20 43 20 66 6f | 72 20 43 2c 0a 77 68 69 | in C fo|r C,.whi|
|00000580| 6c 65 20 72 65 74 61 69 | 6e 69 6e 67 20 7b 5c 54 |le retai|ning {\T|
|00000590| 65 58 7d 20 61 73 20 74 | 68 65 20 66 6f 72 6d 61 |eX} as t|he forma|
|000005a0| 74 74 69 6e 67 20 6c 61 | 6e 67 75 61 67 65 7e 5c |tting la|nguage~\|
|000005b0| 63 69 74 65 7b 6c 65 76 | 79 3a 63 77 65 62 7d 2e |cite{lev|y:cweb}.|
|000005c0| 0a 49 20 68 61 76 65 20 | 68 61 73 20 6d 6f 64 69 |.I have |has modi|
|000005d0| 66 69 65 64 20 4c 65 76 | 79 27 73 20 69 6d 70 6c |fied Lev|y's impl|
|000005e0| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 62 79 20 72 65 |ementati|on by re|
|000005f0| 6d 6f 76 69 6e 67 20 74 | 68 65 20 70 61 72 74 73 |moving t|he parts|
|00000600| 0a 74 68 61 74 20 20 6d | 61 6b 65 20 43 20 74 68 |.that m|ake C th|
|00000610| 65 20 74 61 72 67 65 74 | 20 70 72 6f 67 72 61 6d |e target| program|
|00000620| 6d 69 6e 67 20 6c 61 6e | 67 75 61 67 65 2c 20 61 |ming lan|guage, a|
|00000630| 6e 64 20 49 20 68 61 76 | 65 0a 20 61 64 64 65 64 |nd I hav|e. added|
|00000640| 20 61 20 74 68 69 72 64 | 20 74 6f 6f 6c 2c 20 7b | a third| tool, {|
|00000650| 53 70 69 64 65 72 7d 2c | 20 77 68 69 63 68 20 63 |Spider},| which c|
|00000660| 6f 6d 70 6c 65 6d 65 6e | 74 73 20 7b 5c 74 74 20 |omplemen|ts {\tt |
|00000670| 57 45 41 56 45 7d 0a 61 | 6e 64 20 7b 5c 74 74 20 |WEAVE}.a|nd {\tt |
|00000680| 54 41 4e 47 4c 45 7d 2e | 0a 7b 53 70 69 64 65 72 |TANGLE}.|.{Spider|
|00000690| 7d 20 72 65 61 64 73 20 | 61 20 64 65 73 63 72 69 |} reads |a descri|
|000006a0| 70 74 69 6f 6e 20 6f 66 | 20 61 20 70 72 6f 67 72 |ption of| a progr|
|000006b0| 61 6d 6d 69 6e 67 20 6c | 61 6e 67 75 61 67 65 2c |amming l|anguage,|
|000006c0| 20 61 6e 64 20 77 72 69 | 74 65 73 0a 73 6f 75 72 | and wri|tes.sour|
|000006d0| 63 65 20 63 6f 64 65 20 | 66 6f 72 20 61 20 7b 5c |ce code |for a {\|
|000006e0| 74 74 20 57 45 41 56 45 | 7d 20 61 6e 64 20 7b 5c |tt WEAVE|} and {\|
|000006f0| 74 74 20 54 41 4e 47 4c | 45 7d 20 77 68 69 63 68 |tt TANGL|E} which|
|00000700| 20 73 75 70 70 6f 72 74 | 20 74 68 61 74 0a 6c 61 | support| that.la|
|00000710| 6e 67 75 61 67 65 2e 20 | 0a 55 73 69 6e 67 20 7b |nguage. |.Using {|
|00000720| 53 70 69 64 65 72 7d 2c | 20 61 20 43 7e 63 6f 6d |Spider},| a C~com|
|00000730| 70 69 6c 65 72 2c 20 61 | 6e 64 20 61 6e 20 41 77 |piler, a|nd an Aw|
|00000740| 6b 7e 69 6e 74 65 72 70 | 72 65 74 65 72 2c 20 61 |k~interp|reter, a|
|00000750| 6e 20 65 78 70 65 72 69 | 65 6e 63 65 64 0a 73 79 |n experi|enced.sy|
|00000760| 73 74 65 6d 73 20 70 72 | 6f 67 72 61 6d 6d 65 72 |stems pr|ogrammer|
|00000770| 20 63 61 6e 20 67 65 6e | 65 72 61 74 65 20 20 61 | can gen|erate a|
|00000780| 20 7b 5c 74 74 20 57 45 | 42 7d 20 73 79 73 74 65 | {\tt WE|B} syste|
|00000790| 6d 20 66 6f 72 0a 61 6e | 20 41 6c 67 6f 6c 2d 6c |m for.an| Algol-l|
|000007a0| 69 6b 65 20 6c 61 6e 67 | 75 61 67 65 20 69 6e 20 |ike lang|uage in |
|000007b0| 61 20 66 65 77 20 68 6f | 75 72 73 2e 0a 0a 54 68 |a few ho|urs...Th|
|000007c0| 69 73 20 64 6f 63 75 6d | 65 6e 74 20 65 78 70 6c |is docum|ent expl|
|000007d0| 61 69 6e 73 20 68 6f 77 | 20 74 6f 20 75 73 65 20 |ains how| to use |
|000007e0| 7b 53 70 69 64 65 72 7d | 20 74 6f 20 67 65 6e 65 |{Spider}| to gene|
|000007f0| 72 61 74 65 20 61 20 7b | 5c 57 45 42 7d 0a 73 79 |rate a {|\WEB}.sy|
|00000800| 73 74 65 6d 20 66 6f 72 | 20 61 6e 79 20 70 72 6f |stem for| any pro|
|00000810| 67 72 61 6d 6d 69 6e 67 | 20 6c 61 6e 67 75 61 67 |gramming| languag|
|00000820| 65 2e 0a 28 54 68 65 20 | 63 68 6f 69 63 65 20 6f |e..(The |choice o|
|00000830| 66 20 70 72 6f 67 72 61 | 6d 6d 69 6e 67 20 6c 61 |f progra|mming la|
|00000840| 6e 67 75 61 67 65 20 69 | 73 20 6c 69 6d 69 74 65 |nguage i|s limite|
|00000850| 64 20 6f 6e 6c 79 20 62 | 79 20 74 68 65 20 6c 65 |d only b|y the le|
|00000860| 78 69 63 61 6c 0a 73 74 | 72 75 63 74 75 72 65 20 |xical.st|ructure |
|00000870| 62 75 69 6c 74 20 69 6e | 74 6f 20 53 70 69 64 65 |built in|to Spide|
|00000880| 72 79 20 7b 5c 74 74 20 | 57 45 42 7d 2c 20 61 73 |ry {\tt |WEB}, as|
|00000890| 20 77 65 20 73 68 61 6c | 6c 20 73 65 65 2e 29 0a | we shal|l see.).|
|000008a0| 59 6f 75 20 73 68 6f 75 | 6c 64 20 63 6f 6e 73 75 |You shou|ld consu|
|000008b0| 6c 74 20 74 68 65 20 63 | 6f 6d 70 61 6e 69 6f 6e |lt the c|ompanion|
|000008c0| 20 64 6f 63 75 6d 65 6e | 74 2c 20 60 60 54 68 65 | documen|t, ``The|
|000008d0| 20 53 70 69 64 65 72 79 | 20 7b 5c 57 45 42 7d 20 | Spidery| {\WEB} |
|000008e0| 73 79 73 74 65 6d 20 6f | 66 0a 73 74 72 75 63 74 |system o|f.struct|
|000008f0| 75 72 65 64 20 64 6f 63 | 75 6d 65 6e 74 61 74 69 |ured doc|umentati|
|00000900| 6f 6e 2c 27 27 20 74 6f | 20 6c 65 61 72 6e 20 68 |on,'' to| learn h|
|00000910| 6f 77 20 74 6f 20 75 73 | 65 20 74 68 65 20 67 65 |ow to us|e the ge|
|00000920| 6e 65 72 61 74 65 64 20 | 7b 5c 57 45 42 7d 20 73 |nerated |{\WEB} s|
|00000930| 79 73 74 65 6d 2e 0a 0a | 5c 70 61 72 61 67 72 61 |ystem...|\paragra|
|00000940| 70 68 7b 50 72 65 72 65 | 71 75 69 73 69 74 65 73 |ph{Prere|quisites|
|00000950| 7d 0a 49 66 20 79 6f 75 | 20 61 72 65 20 67 6f 69 |}.If you| are goi|
|00000960| 6e 67 20 74 6f 20 75 73 | 65 20 7b 53 70 69 64 65 |ng to us|e {Spide|
|00000970| 72 7d 20 74 6f 20 62 75 | 69 6c 64 20 61 20 7b 5c |r} to bu|ild a {\|
|00000980| 57 45 42 7d 20 73 79 73 | 74 65 6d 2c 0a 79 6f 75 |WEB} sys|tem,.you|
|00000990| 20 20 73 68 6f 75 6c 64 | 20 62 65 20 63 6f 6d 66 | should| be comf|
|000009a0| 6f 72 74 61 62 6c 65 20 | 75 73 69 6e 67 20 7b 5c |ortable |using {\|
|000009b0| 74 74 20 57 45 42 7d 2e | 0a 54 6f 20 67 65 74 20 |tt WEB}.|.To get |
|000009c0| 61 6e 20 69 64 65 61 20 | 68 6f 77 20 7b 5c 74 74 |an idea |how {\tt|
|000009d0| 20 57 45 42 7d 20 77 6f | 72 6b 73 2c 20 79 6f 75 | WEB} wo|rks, you|
|000009e0| 20 73 68 6f 75 6c 64 20 | 68 61 76 65 20 72 65 61 | should |have rea|
|000009f0| 64 20 4b 6e 75 74 68 27 | 73 0a 69 6e 74 72 6f 64 |d Knuth'|s.introd|
|00000a00| 75 63 74 6f 72 79 20 61 | 72 74 69 63 6c 65 20 0a |uctory a|rticle .|
|00000a10| 6f 6e 20 7b 5c 57 45 42 | 7d 7e 5c 63 69 74 65 7b |on {\WEB|}~\cite{|
|00000a20| 6b 6e 75 74 68 3a 6c 69 | 74 65 72 61 74 65 2d 70 |knuth:li|terate-p|
|00000a30| 72 6f 67 72 61 6d 6d 69 | 6e 67 7d 2c 20 61 73 20 |rogrammi|ng}, as |
|00000a40| 77 65 6c 6c 20 61 73 20 | 74 68 65 20 7b 5c 57 45 |well as |the {\WE|
|00000a50| 42 7d 0a 75 73 65 72 73 | 27 20 6d 61 6e 75 61 6c |B}.users|' manual|
|00000a60| 2e 0a 28 54 68 65 20 7b | 5c 57 45 42 7d 20 75 73 |..(The {|\WEB} us|
|00000a70| 65 72 27 73 20 6d 61 6e | 75 61 6c 20 69 73 20 70 |er's man|ual is p|
|00000a80| 72 65 74 74 79 20 68 65 | 61 76 79 20 67 6f 69 6e |retty he|avy goin|
|00000a90| 67 2c 20 73 6f 20 79 6f | 75 20 6d 61 79 20 77 61 |g, so yo|u may wa|
|00000aa0| 6e 74 20 74 6f 0a 63 6f | 6e 73 75 6c 74 20 74 68 |nt to.co|nsult th|
|00000ab0| 65 20 42 69 62 6c 69 6f | 67 72 61 70 68 79 20 66 |e Biblio|graphy f|
|00000ac0| 6f 72 20 6d 6f 72 65 20 | 69 6e 74 72 6f 64 75 63 |or more |introduc|
|00000ad0| 74 6f 72 79 20 6d 61 74 | 65 72 69 61 6c 20 6f 6e |tory mat|erial on|
|00000ae0| 20 7b 5c 57 45 42 7d 2e | 0a 57 61 79 6e 65 20 53 | {\WEB}.|.Wayne S|
|00000af0| 65 77 65 6c 6c 27 73 20 | 7b 5c 69 74 20 57 65 61 |ewell's |{\it Wea|
|00000b00| 76 69 6e 67 20 61 20 50 | 72 6f 67 72 61 6d 3a 20 |ving a P|rogram: |
|00000b10| 4c 69 74 65 72 61 74 65 | 20 50 72 6f 67 72 61 6d |Literate| Program|
|00000b20| 6d 69 6e 67 20 69 6e 20 | 7b 5c 74 74 0a 57 45 42 |ming in |{\tt.WEB|
|00000b30| 7d 7d 0a 6d 61 79 20 62 | 65 20 68 65 6c 70 66 75 |}}.may b|e helpfu|
|00000b40| 6c 7e 5c 63 69 74 65 7b | 73 65 77 65 6c 6c 3a 77 |l~\cite{|sewell:w|
|00000b50| 65 61 76 69 6e 67 7d 2e | 29 0a 0a 49 6e 20 77 68 |eaving}.|)..In wh|
|00000b60| 61 74 20 66 6f 6c 6c 6f | 77 73 20 77 65 20 77 69 |at follo|ws we wi|
|00000b70| 6c 6c 20 61 73 73 75 6d | 65 20 74 68 61 74 20 79 |ll assum|e that y|
|00000b80| 6f 75 20 6b 6e 6f 77 20 | 77 68 61 74 20 7b 5c 74 |ou know |what {\t|
|00000b90| 74 20 57 45 41 56 45 7d | 20 61 6e 64 20 7b 5c 74 |t WEAVE}| and {\t|
|00000ba0| 74 0a 54 41 4e 47 4c 45 | 7d 20 61 72 65 2c 20 77 |t.TANGLE|} are, w|
|00000bb0| 68 61 74 20 69 6e 70 75 | 74 20 74 68 65 79 20 65 |hat inpu|t they e|
|00000bc0| 78 70 65 63 74 2c 20 61 | 6e 64 20 77 68 61 74 20 |xpect, a|nd what |
|00000bd0| 6f 75 74 70 75 74 20 74 | 68 65 79 20 70 72 6f 64 |output t|hey prod|
|00000be0| 75 63 65 2e 0a 0a 5c 70 | 61 72 61 67 72 61 70 68 |uce...\p|aragraph|
|00000bf0| 7b 50 6c 61 6e 20 6f 66 | 20 74 68 69 73 20 67 75 |{Plan of| this gu|
|00000c00| 69 64 65 7d 0a 57 65 27 | 6c 6c 20 62 65 67 69 6e |ide}.We'|ll begin|
|00000c10| 20 77 69 74 68 20 61 20 | 72 65 76 69 65 77 20 6f | with a |review o|
|00000c20| 66 20 77 65 61 76 69 6e | 67 20 61 6e 64 20 74 61 |f weavin|g and ta|
|00000c30| 6e 67 6c 69 6e 67 2c 20 | 73 6f 20 74 68 61 74 20 |ngling, |so that |
|00000c40| 77 65 20 63 61 6e 20 67 | 65 74 0a 61 6e 20 69 64 |we can g|et.an id|
|00000c50| 65 61 20 77 68 61 74 20 | 69 73 20 6e 65 63 65 73 |ea what |is neces|
|00000c60| 73 61 72 79 20 74 6f 20 | 62 75 69 6c 64 20 61 20 |sary to |build a |
|00000c70| 6c 61 6e 67 75 61 67 65 | 2d 69 6e 64 65 70 65 6e |language|-indepen|
|00000c80| 64 65 6e 74 20 7b 5c 57 | 45 42 7d 2e 0a 54 68 65 |dent {\W|EB}..The|
|00000c90| 6e 20 77 65 27 6c 6c 20 | 70 72 65 73 65 6e 74 20 |n we'll |present |
|00000ca0| 61 20 64 69 73 63 75 73 | 73 69 6f 6e 20 6f 66 20 |a discus|sion of |
|00000cb0| 74 68 65 20 66 65 61 74 | 75 72 65 73 20 6f 66 20 |the feat|ures of |
|00000cc0| 7b 53 70 69 64 65 72 7d | 20 74 68 61 74 0a 74 65 |{Spider}| that.te|
|00000cd0| 6c 6c 20 7b 5c 57 45 42 | 7d 20 61 62 6f 75 74 20 |ll {\WEB|} about |
|00000ce0| 74 68 65 20 70 72 6f 67 | 72 61 6d 6d 69 6e 67 20 |the prog|ramming |
|00000cf0| 6c 61 6e 67 75 61 67 65 | 2e 0a 57 65 27 6c 6c 20 |language|..We'll |
|00000d00| 64 65 66 69 6e 65 20 74 | 68 65 73 65 20 69 6e 20 |define t|hese in |
|00000d10| 64 65 74 61 69 6c 20 61 | 6e 64 20 67 69 76 65 20 |detail a|nd give |
|00000d20| 73 6f 6d 65 20 65 78 61 | 6d 70 6c 65 73 2c 20 61 |some exa|mples, a|
|00000d30| 6e 64 20 74 68 65 6e 20 | 0a 77 65 27 6c 6c 20 63 |nd then |.we'll c|
|00000d40| 6c 6f 73 65 20 77 69 74 | 68 20 61 20 63 6f 6d 70 |lose wit|h a comp|
|00000d50| 6c 65 74 65 20 64 65 73 | 63 72 69 70 74 69 6f 6e |lete des|cription|
|00000d60| 20 6f 66 20 74 68 65 20 | 7b 53 70 69 64 65 72 7d | of the |{Spider}|
|00000d70| 20 6c 61 6e 67 75 61 67 | 65 0a 61 6e 64 20 74 6f | languag|e.and to|
|00000d80| 6f 6c 73 2e 0a 0a 5c 73 | 65 63 74 69 6f 6e 7b 48 |ols...\s|ection{H|
|00000d90| 6f 77 20 7b 5c 74 74 20 | 57 45 41 56 45 7d 20 61 |ow {\tt |WEAVE} a|
|00000da0| 6e 64 20 7b 5c 74 74 20 | 54 41 4e 47 4c 45 7d 20 |nd {\tt |TANGLE} |
|00000db0| 73 65 65 20 74 68 65 20 | 77 6f 72 6c 64 7d 0a 42 |see the |world}.B|
|00000dc0| 6f 74 68 20 7b 5c 74 74 | 20 57 45 41 56 45 7d 20 |oth {\tt| WEAVE} |
|00000dd0| 61 6e 64 20 7b 5c 74 74 | 20 54 41 4e 47 4c 45 7d |and {\tt| TANGLE}|
|00000de0| 20 6f 70 65 72 61 74 65 | 20 6f 6e 20 74 68 65 20 | operate| on the |
|00000df0| 73 61 6d 65 20 69 6e 70 | 75 74 2c 20 61 20 7b 5c |same inp|ut, a {\|
|00000e00| 57 45 42 7d 0a 66 69 6c | 65 2e 0a 7b 5c 74 74 20 |WEB}.fil|e..{\tt |
|00000e10| 57 45 41 56 45 7d 20 6d | 75 73 74 20 65 78 61 6d |WEAVE} m|ust exam|
|00000e20| 69 6e 65 20 74 68 69 73 | 20 69 6e 70 75 74 20 61 |ine this| input a|
|00000e30| 6e 64 20 70 72 6f 64 75 | 63 65 20 61 20 7b 5c 54 |nd produ|ce a {\T|
|00000e40| 65 58 7d 20 74 65 78 74 | 2c 20 77 68 69 6c 65 0a |eX} text|, while.|
|00000e50| 7b 5c 74 74 20 54 41 4e | 47 4c 45 7d 20 6d 75 73 |{\tt TAN|GLE} mus|
|00000e60| 74 20 70 72 6f 64 75 63 | 65 20 61 20 70 72 6f 67 |t produc|e a prog|
|00000e70| 72 61 6d 20 74 65 78 74 | 20 66 72 6f 6d 20 74 68 |ram text| from th|
|00000e80| 65 20 73 61 6d 65 20 69 | 6e 70 75 74 2e 0a 54 68 |e same i|nput..Th|
|00000e90| 65 20 69 6e 70 75 74 20 | 63 6f 6e 73 69 73 74 73 |e input |consists|
|00000ea0| 20 6f 66 20 7b 5c 54 65 | 58 7d 20 70 61 72 74 73 | of {\Te|X} parts|
|00000eb0| 2c 20 64 65 66 69 6e 69 | 74 69 6f 6e 20 70 61 72 |, defini|tion par|
|00000ec0| 74 73 2c 20 61 6e 64 20 | 63 6f 64 65 20 70 61 72 |ts, and |code par|
|00000ed0| 74 73 2e 0a 54 68 65 20 | 7b 5c 54 65 58 7d 20 70 |ts..The |{\TeX} p|
|00000ee0| 61 72 74 73 20 61 72 65 | 20 74 68 65 20 65 61 73 |arts are| the eas|
|00000ef0| 69 65 73 74 20 74 6f 20 | 63 6f 6e 73 69 64 65 72 |iest to |consider|
|00000f00| 3a 20 7b 5c 74 74 20 57 | 45 41 56 45 7d 20 6a 75 |: {\tt W|EAVE} ju|
|00000f10| 73 74 20 63 6f 70 69 65 | 73 0a 74 68 65 6d 20 61 |st copie|s.them a|
|00000f20| 6e 64 20 7b 5c 74 74 20 | 54 41 4e 47 4c 45 7d 20 |nd {\tt |TANGLE} |
|00000f30| 74 68 72 6f 77 73 20 74 | 68 65 6d 20 61 77 61 79 |throws t|hem away|
|00000f40| 2e 0a 54 68 65 20 64 65 | 66 69 6e 69 74 69 6f 6e |..The de|finition|
|00000f50| 20 70 61 72 74 73 20 61 | 72 65 20 61 20 62 69 74 | parts a|re a bit|
|00000f60| 20 6d 6f 72 65 20 63 6f | 6d 70 6c 69 63 61 74 65 | more co|mplicate|
|00000f70| 64 3a 20 7b 5c 74 74 20 | 57 45 41 56 45 7d 27 73 |d: {\tt |WEAVE}'s|
|00000f80| 20 6a 6f 62 20 69 73 0a | 74 6f 20 74 79 70 65 73 | job is.|to types|
|00000f90| 65 74 20 74 68 65 6d 2c | 20 77 68 69 6c 65 20 7b |et them,| while {|
|00000fa0| 5c 74 74 20 54 41 4e 47 | 4c 45 7d 20 6d 75 73 74 |\tt TANG|LE} must|
|00000fb0| 20 72 65 6d 65 6d 62 65 | 72 20 74 68 65 20 64 65 | remembe|r the de|
|00000fc0| 66 69 6e 69 74 69 6f 6e | 73 20 61 6e 64 0a 65 78 |finition|s and.ex|
|00000fd0| 70 61 6e 64 20 74 68 65 | 6d 20 61 74 20 74 68 65 |pand the|m at the|
|00000fe0| 20 70 72 6f 70 65 72 20 | 74 69 6d 65 2e 0a 54 68 | proper |time..Th|
|00000ff0| 65 20 63 6f 64 65 20 70 | 61 72 74 73 20 61 72 65 |e code p|arts are|
|00001000| 20 74 68 65 20 6d 6f 73 | 74 20 63 6f 6d 70 6c 65 | the mos|t comple|
|00001010| 78 20 6f 66 20 61 6c 6c | 3a 20 7b 5c 74 74 20 57 |x of all|: {\tt W|
|00001020| 45 41 56 45 7d 20 6d 75 | 73 74 0a 70 72 65 74 74 |EAVE} mu|st.prett|
|00001030| 79 70 72 69 6e 74 20 74 | 68 65 6d 2c 20 61 6e 64 |yprint t|hem, and|
|00001040| 20 7b 5c 74 74 20 54 41 | 4e 47 4c 45 7d 20 6d 75 | {\tt TA|NGLE} mu|
|00001050| 73 74 20 72 65 61 72 72 | 61 6e 67 65 20 74 68 65 |st rearr|ange the|
|00001060| 6d 20 69 6e 74 6f 20 61 | 20 63 6f 68 65 72 65 6e |m into a| coheren|
|00001070| 74 0a 70 72 6f 67 72 61 | 6d 20 74 65 78 74 2e 0a |t.progra|m text..|
|00001080| 0a 5c 70 61 72 61 67 72 | 61 70 68 7b 4c 65 78 69 |.\paragr|aph{Lexi|
|00001090| 63 61 6c 20 61 6e 61 6c | 79 73 69 73 20 69 6e 20 |cal anal|ysis in |
|000010a0| 7b 5c 57 45 42 7d 7d 0a | 42 6f 74 68 20 7b 5c 74 |{\WEB}}.|Both {\t|
|000010b0| 74 20 57 45 41 56 45 7d | 20 61 6e 64 20 7b 5c 74 |t WEAVE}| and {\t|
|000010c0| 74 20 54 41 4e 47 4c 45 | 7d 20 69 6e 74 65 72 70 |t TANGLE|} interp|
|000010d0| 72 65 74 20 74 68 65 20 | 63 6f 64 65 20 70 61 72 |ret the |code par|
|000010e0| 74 73 20 61 73 20 61 20 | 73 74 72 65 61 6d 0a 6f |ts as a |stream.o|
|000010f0| 66 20 7b 5c 65 6d 20 74 | 6f 6b 65 6e 73 7d 2e 0a |f {\em t|okens}..|
|00001100| 53 69 6e 63 65 20 6e 6f | 74 20 61 6c 6c 20 70 72 |Since no|t all pr|
|00001110| 6f 67 72 61 6d 6d 69 6e | 67 20 6c 61 6e 67 75 61 |ogrammin|g langua|
|00001120| 67 65 73 20 68 61 76 65 | 20 74 68 65 20 73 61 6d |ges have| the sam|
|00001130| 65 20 74 6f 6b 65 6e 73 | 2c 20 69 74 20 69 73 20 |e tokens|, it is |
|00001140| 0a 7b 53 70 69 64 65 72 | 7d 27 73 20 6a 6f 62 20 |.{Spider|}'s job |
|00001150| 74 6f 20 74 65 6c 6c 20 | 7b 5c 74 74 20 57 45 41 |to tell |{\tt WEA|
|00001160| 56 45 7d 20 61 6e 64 20 | 7b 5c 74 74 20 54 41 4e |VE} and |{\tt TAN|
|00001170| 47 4c 45 7d 20 68 6f 77 | 20 74 6f 20 74 6f 6b 65 |GLE} how| to toke|
|00001180| 6e 69 7a 65 20 74 68 65 | 0a 69 6e 70 75 74 2e 25 |nize the|.input.%|
|00001190| 0a 5c 66 6f 6f 74 6e 6f | 74 65 7b 25 0a 54 68 65 |.\footno|te{%.The|
|000011a0| 20 63 75 72 72 65 6e 74 | 20 69 6d 70 6c 65 6d 65 | current| impleme|
|000011b0| 6e 74 61 74 69 6f 6e 20 | 6f 66 20 7b 5c 74 74 20 |ntation |of {\tt |
|000011c0| 57 45 42 7d 27 73 20 6c | 65 78 69 63 61 6c 20 61 |WEB}'s l|exical a|
|000011d0| 6e 61 6c 79 73 69 73 20 | 69 73 20 6c 69 6d 69 74 |nalysis |is limit|
|000011e0| 65 64 2e 0a 49 74 20 73 | 68 6f 75 6c 64 20 62 65 |ed..It s|hould be|
|000011f0| 20 72 65 70 6c 61 63 65 | 64 20 77 69 74 68 20 73 | replace|d with s|
|00001200| 6f 6d 65 74 68 69 6e 67 | 20 75 73 69 6e 67 20 72 |omething| using r|
|00001210| 65 67 75 6c 61 72 0a 65 | 78 70 72 65 73 73 69 6f |egular.e|xpressio|
|00001220| 6e 73 2e 25 20 0a 7d 0a | 41 20 53 70 69 64 65 72 |ns.% .}.|A Spider|
|00001230| 79 20 7b 5c 57 45 42 7d | 20 73 79 73 74 65 6d 20 |y {\WEB}| system |
|00001240| 63 61 6e 20 72 65 63 6f | 67 6e 69 7a 65 20 74 68 |can reco|gnize th|
|00001250| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 6b 69 6e 64 |e follow|ing kind|
|00001260| 73 20 6f 66 0a 74 6f 6b | 65 6e 73 3a 0a 5c 62 65 |s of.tok|ens:.\be|
|00001270| 67 69 6e 7b 69 74 65 6d | 69 7a 65 7d 0a 5c 69 74 |gin{item|ize}.\it|
|00001280| 65 6d 20 69 64 65 6e 74 | 69 66 69 65 72 73 0a 5c |em ident|ifiers.\|
|00001290| 69 74 65 6d 20 6e 75 6d | 65 72 69 63 20 61 6e 64 |item num|eric and|
|000012a0| 20 73 74 72 69 6e 67 20 | 63 6f 6e 73 74 61 6e 74 | string |constant|
|000012b0| 73 0a 5c 69 74 65 6d 20 | 6e 65 77 6c 69 6e 65 73 |s.\item |newlines|
|000012c0| 0a 5c 69 74 65 6d 20 60 | 60 70 73 65 75 64 6f 2d |.\item `|`pseudo-|
|000012d0| 73 65 6d 69 63 6f 6c 6f | 6e 73 27 27 20 28 74 68 |semicolo|ns'' (th|
|000012e0| 65 20 74 6f 6b 65 6e 20 | 7b 5c 74 74 20 40 3b 7d |e token |{\tt @;}|
|000012f0| 29 0a 5c 69 74 65 6d 20 | 72 65 73 65 72 76 65 64 |).\item |reserved|
|00001300| 20 77 6f 72 64 73 0a 5c | 69 74 65 6d 20 6e 6f 6e | words.\|item non|
|00001310| 2d 61 6c 70 68 61 6e 75 | 6d 65 72 69 63 20 74 6f |-alphanu|meric to|
|00001320| 6b 65 6e 73 0a 5c 65 6e | 64 7b 69 74 65 6d 69 7a |kens.\en|d{itemiz|
|00001330| 65 7d 0a 0a 7b 5c 74 74 | 20 54 41 4e 47 4c 45 7d |e}..{\tt| TANGLE}|
|00001340| 20 72 65 61 72 72 61 6e | 67 65 73 20 74 68 65 73 | rearran|ges thes|
|00001350| 65 20 74 6f 6b 65 6e 73 | 20 69 6e 74 6f 20 6f 6e |e tokens| into on|
|00001360| 65 20 6c 6f 6e 67 20 70 | 72 6f 67 72 61 6d 0a 74 |e long p|rogram.t|
|00001370| 65 78 74 2c 20 74 68 65 | 6e 20 77 72 69 74 65 73 |ext, the|n writes|
|00001380| 20 6f 75 74 20 74 68 65 | 20 70 72 6f 67 72 61 6d | out the| program|
|00001390| 20 74 65 78 74 20 74 6f | 6b 65 6e 20 62 79 20 74 | text to|ken by t|
|000013a0| 6f 6b 65 6e 2e 0a 4e 6f | 72 6d 61 6c 6c 79 2c 20 |oken..No|rmally, |
|000013b0| 7b 5c 74 74 20 54 41 4e | 47 4c 45 7d 20 70 75 74 |{\tt TAN|GLE} put|
|000013c0| 73 20 6e 6f 20 77 68 69 | 74 65 20 73 70 61 63 65 |s no whi|te space|
|000013d0| 20 62 65 74 77 65 65 6e | 20 74 6f 6b 65 6e 73 2c | between| tokens,|
|000013e0| 20 62 75 74 20 69 74 0a | 77 69 6c 6c 20 70 75 74 | but it.|will put|
|000013f0| 20 62 6c 61 6e 6b 73 20 | 62 65 74 77 65 65 6e 20 | blanks |between |
|00001400| 61 64 6a 61 63 65 6e 74 | 20 69 64 65 6e 74 69 66 |adjacent| identif|
|00001410| 69 65 72 2c 20 72 65 73 | 65 72 76 65 64 20 77 6f |ier, res|erved wo|
|00001420| 72 64 2c 20 61 6e 64 0a | 6e 75 6d 65 72 69 63 20 |rd, and.|numeric |
|00001430| 63 6f 6e 73 74 61 6e 74 | 20 74 6f 6b 65 6e 73 2e |constant| tokens.|
|00001440| 0a 54 68 75 73 20 74 68 | 65 20 69 6e 70 75 74 0a |.Thus th|e input.|
|00001450| 5c 62 65 67 69 6e 7b 71 | 75 6f 74 65 7d 0a 5c 74 |\begin{q|uote}.\t|
|00001460| 74 20 69 66 20 30 20 3e | 20 78 2d 79 20 74 68 65 |t if 0 >| x-y the|
|00001470| 6e 20 7a 20 3a 3d 20 2d | 31 3b 0a 5c 65 6e 64 7b |n z := -|1;.\end{|
|00001480| 71 75 6f 74 65 7d 0a 77 | 69 6c 6c 20 62 65 20 77 |quote}.w|ill be w|
|00001490| 72 69 74 74 65 6e 20 6f | 75 74 20 61 73 0a 5c 62 |ritten o|ut as.\b|
|000014a0| 65 67 69 6e 7b 71 75 6f | 74 65 7d 0a 5c 74 74 20 |egin{quo|te}.\tt |
|000014b0| 69 66 20 30 3e 78 2d 79 | 20 74 68 65 6e 20 7a 3a |if 0>x-y| then z:|
|000014c0| 3d 2d 31 3b 0a 5c 65 6e | 64 7b 71 75 6f 74 65 7d |=-1;.\en|d{quote}|
|000014d0| 0a 61 6e 64 20 6e 6f 74 | 0a 5c 62 65 67 69 6e 7b |.and not|.\begin{|
|000014e0| 71 75 6f 74 65 7d 0a 5c | 74 74 20 69 66 30 3e 78 |quote}.\|tt if0>x|
|000014f0| 2d 79 74 68 65 6e 7a 3a | 3d 2d 31 3b 0a 5c 65 6e |-ythenz:|=-1;.\en|
|00001500| 64 7b 71 75 6f 74 65 7d | 0a 77 68 69 63 68 20 77 |d{quote}|.which w|
|00001510| 6f 75 6c 64 6e 27 74 20 | 70 61 72 73 65 2e 0a 57 |ouldn't |parse..W|
|00001520| 68 65 6e 20 69 74 20 69 | 73 20 64 65 73 69 72 61 |hen it i|s desira|
|00001530| 62 6c 65 20 74 6f 20 68 | 61 76 65 20 7b 5c 74 74 |ble to h|ave {\tt|
|00001540| 20 54 41 4e 47 4c 45 7d | 20 74 72 61 6e 73 6c 61 | TANGLE}| transla|
|00001550| 74 65 0a 74 68 65 20 74 | 6f 6b 65 6e 73 20 64 69 |te.the t|okens di|
|00001560| 66 66 65 72 65 6e 74 6c | 79 2c 20 65 61 63 68 20 |fferentl|y, each |
|00001570| 74 6f 6b 65 6e 20 63 61 | 6e 20 62 65 20 67 69 76 |token ca|n be giv|
|00001580| 65 6e 20 61 20 7b 5c 74 | 74 20 74 61 6e 67 6c 65 |en a {\t|t tangle|
|00001590| 74 6f 7d 0a 61 74 74 72 | 69 62 75 74 65 2c 20 77 |to}.attr|ibute, w|
|000015a0| 68 69 63 68 20 73 70 65 | 63 69 66 69 65 73 20 77 |hich spe|cifies w|
|000015b0| 68 61 74 20 20 70 72 6f | 67 72 61 6d 20 74 65 78 |hat pro|gram tex|
|000015c0| 74 20 69 73 20 70 72 69 | 6e 74 65 64 20 6f 75 74 |t is pri|nted out|
|000015d0| 20 66 6f 72 20 74 68 61 | 74 0a 74 6f 6b 65 6e 2e | for tha|t.token.|
|000015e0| 0a 46 6f 72 20 65 78 61 | 6d 70 6c 65 2c 20 0a 74 |.For exa|mple, .t|
|000015f0| 68 65 20 7b 5c 74 74 20 | 73 70 69 64 65 72 7d 20 |he {\tt |spider} |
|00001600| 66 69 6c 65 20 75 73 65 | 64 20 74 6f 20 67 65 6e |file use|d to gen|
|00001610| 65 72 61 74 65 20 43 7e | 7b 5c 57 45 42 7d 20 66 |erate C~|{\WEB} f|
|00001620| 6f 72 63 65 73 20 74 68 | 65 20 7b 5c 74 74 20 3d |orces th|e {\tt =|
|00001630| 7d 0a 74 6f 6b 65 6e 74 | 6f 20 62 65 20 70 72 69 |}.tokent|o be pri|
|00001640| 6e 74 65 64 20 6f 75 74 | 20 61 73 20 74 68 65 20 |nted out| as the |
|00001650| 73 74 72 69 6e 67 20 7b | 5c 74 74 20 22 3d 5c 20 |string {|\tt "=\ |
|00001660| 22 7d 2c 20 62 65 63 61 | 75 73 65 20 69 6e 20 43 |"}, beca|use in C|
|00001670| 20 74 68 65 20 73 74 72 | 69 6e 67 0a 7b 5c 74 74 | the str|ing.{\tt|
|00001680| 20 22 3d 2d 22 7d 20 63 | 61 6e 20 62 65 20 61 6d | "=-"} c|an be am|
|00001690| 62 69 67 75 6f 75 73 2e | 0a 0a 7b 5c 74 74 20 57 |biguous.|..{\tt W|
|000016a0| 45 41 56 45 7d 20 6d 75 | 73 74 20 74 75 72 6e 20 |EAVE} mu|st turn |
|000016b0| 74 68 65 20 74 6f 6b 65 | 6e 20 73 74 72 65 61 6d |the toke|n stream|
|000016c0| 20 69 6e 74 6f 20 61 20 | 7b 5c 54 65 58 7d 20 74 | into a |{\TeX} t|
|000016d0| 65 78 74 20 74 68 61 74 | 20 77 69 6c 6c 0a 63 61 |ext that| will.ca|
|000016e0| 75 73 65 20 74 68 65 20 | 63 6f 64 65 20 74 6f 20 |use the |code to |
|000016f0| 62 65 20 70 72 65 74 74 | 79 70 72 69 6e 74 65 64 |be prett|yprinted|
|00001700| 2e 0a 49 74 20 64 6f 65 | 73 20 73 6f 20 69 6e 20 |..It doe|s so in |
|00001710| 74 68 72 65 65 20 73 74 | 65 70 73 3a 0a 5c 62 65 |three st|eps:.\be|
|00001720| 67 69 6e 7b 65 6e 75 6d | 65 72 61 74 65 7d 0a 5c |gin{enum|erate}.\|
|00001730| 69 74 65 6d 20 0a 7b 5c | 74 74 20 57 45 41 56 45 |item .{\|tt WEAVE|
|00001740| 7d 20 74 75 72 6e 73 20 | 65 61 63 68 20 74 6f 6b |} turns |each tok|
|00001750| 65 6e 20 69 6e 74 6f 20 | 61 20 7b 5c 65 6d 20 73 |en into |a {\em s|
|00001760| 63 72 61 70 7d 2e 0a 41 | 20 73 63 72 61 70 20 68 |crap}..A| scrap h|
|00001770| 61 73 20 74 77 6f 20 69 | 6d 70 6f 72 74 61 6e 74 |as two i|mportant|
|00001780| 20 70 72 6f 70 65 72 74 | 69 65 73 3a 20 69 74 73 | propert|ies: its|
|00001790| 20 73 79 6e 74 61 63 74 | 69 63 20 0a 7b 5c 65 6d | syntact|ic .{\em|
|000017a0| 20 63 61 74 65 67 6f 72 | 79 7d 20 61 6e 64 20 69 | categor|y} and i|
|000017b0| 74 73 20 7b 5c 65 6d 20 | 74 72 61 6e 73 6c 61 74 |ts {\em |translat|
|000017c0| 69 6f 6e 7d 2e 0a 54 68 | 65 20 63 61 74 65 67 6f |ion}..Th|e catego|
|000017d0| 72 69 65 73 20 61 72 65 | 20 73 79 6d 62 6f 6c 73 |ries are| symbols|
|000017e0| 20 69 6e 20 61 20 70 72 | 65 74 74 79 70 72 69 6e | in a pr|ettyprin|
|000017f0| 74 69 6e 67 20 67 72 61 | 6d 6d 61 72 3b 20 74 68 |ting gra|mmar; th|
|00001800| 61 74 20 67 72 61 6d 6d | 61 72 0a 74 65 6c 6c 73 |at gramm|ar.tells|
|00001810| 20 7b 5c 74 74 20 57 45 | 41 56 45 7d 20 68 6f 77 | {\tt WE|AVE} how|
|00001820| 20 74 6f 20 63 6f 6d 62 | 69 6e 65 20 74 68 65 20 | to comb|ine the |
|00001830| 73 63 72 61 70 73 0a 77 | 69 74 68 20 70 72 65 74 |scraps.w|ith pret|
|00001840| 74 79 70 72 69 6e 74 69 | 6e 67 20 69 6e 73 74 72 |typrinti|ng instr|
|00001850| 75 63 74 69 6f 6e 73 2e | 0a 54 68 65 20 74 72 61 |uctions.|.The tra|
|00001860| 6e 73 6c 61 74 69 6f 6e | 73 20 61 72 65 20 74 68 |nslation|s are th|
|00001870| 65 20 7b 5c 54 65 58 7d | 20 74 65 78 74 73 20 74 |e {\TeX}| texts t|
|00001880| 68 61 74 20 77 69 6c 6c | 20 74 65 6c 6c 20 7b 5c |hat will| tell {\|
|00001890| 54 65 58 7d 20 65 78 61 | 63 74 6c 79 0a 68 6f 77 |TeX} exa|ctly.how|
|000018a0| 20 74 6f 20 70 72 69 6e | 74 20 74 68 65 20 73 63 | to prin|t the sc|
|000018b0| 72 61 70 73 2e 0a 5c 69 | 74 65 6d 0a 7b 5c 74 74 |raps..\i|tem.{\tt|
|000018c0| 20 57 45 41 56 45 7d 20 | 72 65 64 75 63 65 73 20 | WEAVE} |reduces |
|000018d0| 74 68 65 20 73 63 72 61 | 70 20 73 74 72 65 61 6d |the scra|p stream|
|000018e0| 20 62 79 20 63 6f 6d 62 | 69 6e 69 6e 67 20 73 63 | by comb|ining sc|
|000018f0| 72 61 70 73 20 61 63 63 | 6f 72 64 69 6e 67 20 74 |raps acc|ording t|
|00001900| 6f 0a 74 68 65 20 70 72 | 6f 64 75 63 74 69 6f 6e |o.the pr|oduction|
|00001910| 73 20 6f 66 20 69 74 73 | 20 70 72 65 74 74 79 70 |s of its| prettyp|
|00001920| 72 69 6e 74 69 6e 67 20 | 67 72 61 6d 6d 61 72 2e |rinting |grammar.|
|00001930| 0a 28 7b 5c 74 74 20 57 | 45 41 56 45 7d 20 64 6f |.({\tt W|EAVE} do|
|00001940| 65 73 20 61 20 6b 69 6e | 64 20 6f 66 20 73 68 69 |es a kin|d of shi|
|00001950| 66 74 2d 72 65 64 75 63 | 65 20 70 61 72 73 69 6e |ft-reduc|e parsin|
|00001960| 67 20 6f 66 20 70 72 6f | 67 72 61 6d 20 66 72 61 |g of pro|gram fra|
|00001970| 67 6d 65 6e 74 73 2e 29 | 0a 57 68 69 6c 65 20 63 |gments.)|.While c|
|00001980| 6f 6d 62 69 6e 69 6e 67 | 20 74 68 65 20 74 72 61 |ombining| the tra|
|00001990| 6e 73 6c 61 74 69 6f 6e | 73 2c 20 7b 5c 74 74 20 |nslation|s, {\tt |
|000019a0| 57 45 41 56 45 7d 20 61 | 64 64 73 20 7b 5c 54 65 |WEAVE} a|dds {\Te|
|000019b0| 58 7d 20 74 65 78 74 20 | 74 68 61 74 0a 77 69 6c |X} text |that.wil|
|000019c0| 6c 20 63 61 75 73 65 20 | 69 6e 64 65 6e 74 69 6e |l cause |indentin|
|000019d0| 67 2c 20 6f 75 74 64 65 | 6e 74 69 6e 67 2c 20 6c |g, outde|nting, l|
|000019e0| 69 6e 65 20 62 72 65 61 | 6b 69 6e 67 2c 20 61 6e |ine brea|king, an|
|000019f0| 64 20 73 6f 20 6f 6e 2e | 0a 5c 69 74 65 6d 0a 49 |d so on.|.\item.I|
|00001a00| 64 65 61 6c 6c 79 2c 20 | 7b 5c 74 74 20 57 45 41 |deally, |{\tt WEA|
|00001a10| 56 45 7d 20 6b 65 65 70 | 73 20 72 65 64 75 63 69 |VE} keep|s reduci|
|00001a20| 6e 67 20 73 63 72 61 70 | 73 20 75 6e 74 69 6c 20 |ng scrap|s until |
|00001a30| 69 74 20 68 61 73 20 61 | 20 73 69 6e 67 6c 65 20 |it has a| single |
|00001a40| 73 63 72 61 70 20 77 69 | 74 68 0a 61 20 76 65 72 |scrap wi|th.a ver|
|00001a50| 79 20 6c 6f 6e 67 20 74 | 72 61 6e 73 6c 61 74 69 |y long t|ranslati|
|00001a60| 6f 6e 2c 20 62 75 74 20 | 70 65 72 68 61 70 73 20 |on, but |perhaps |
|00001a70| 69 74 20 77 69 6c 6c 20 | 65 6e 64 20 75 70 0a 77 |it will |end up.w|
|00001a80| 69 74 68 20 61 6e 20 69 | 72 72 65 64 75 63 69 62 |ith an i|rreducib|
|00001a90| 6c 65 20 73 65 71 75 65 | 6e 63 65 20 6f 66 20 73 |le seque|nce of s|
|00001aa0| 63 72 61 70 73 2e 0a 49 | 6e 20 61 6e 79 20 63 61 |craps..I|n any ca|
|00001ab0| 73 65 2c 20 61 66 74 65 | 72 20 6e 6f 20 6d 6f 72 |se, afte|r no mor|
|00001ac0| 65 20 72 65 64 75 63 74 | 69 6f 6e 73 20 63 61 6e |e reduct|ions can|
|00001ad0| 20 62 65 20 64 6f 6e 65 | 2c 20 74 68 65 20 74 72 | be done|, the tr|
|00001ae0| 61 6e 73 6c 61 74 69 6f | 6e 73 20 6f 66 20 74 68 |anslatio|ns of th|
|00001af0| 65 0a 72 65 6d 61 69 6e | 69 6e 67 20 73 63 72 61 |e.remain|ing scra|
|00001b00| 70 73 20 61 72 65 20 6f | 75 74 70 75 74 20 6f 6e |ps are o|utput on|
|00001b10| 65 20 61 74 20 61 20 74 | 69 6d 65 2e 0a 5c 65 6e |e at a t|ime..\en|
|00001b20| 64 7b 65 6e 75 6d 65 72 | 61 74 65 7d 0a 0a 5c 73 |d{enumer|ate}..\s|
|00001b30| 65 63 74 69 6f 6e 7b 55 | 73 69 6e 67 20 7b 53 70 |ection{U|sing {Sp|
|00001b40| 69 64 65 72 7d 20 74 6f | 20 74 65 6c 6c 20 7b 5c |ider} to| tell {\|
|00001b50| 57 45 42 7d 20 68 6f 77 | 20 74 6f 20 74 6f 6b 65 |WEB} how| to toke|
|00001b60| 6e 69 7a 65 7d 0a 7b 53 | 70 69 64 65 72 7d 20 64 |nize}.{S|pider} d|
|00001b70| 69 76 69 64 65 73 20 74 | 6f 6b 65 6e 73 20 69 6e |ivides t|okens in|
|00001b80| 74 6f 20 74 77 6f 20 63 | 6c 61 73 73 65 73 3b 20 |to two c|lasses; |
|00001b90| 72 65 73 65 72 76 65 64 | 20 77 6f 72 64 73 20 61 |reserved| words a|
|00001ba0| 6e 64 0a 6f 74 68 65 72 | 2e 0a 54 68 65 20 72 65 |nd.other|..The re|
|00001bb0| 73 65 72 76 65 64 20 77 | 6f 72 64 73 20 61 73 20 |served w|ords as |
|00001bc0| 73 70 65 63 69 66 69 65 | 64 20 75 73 69 6e 67 20 |specifie|d using |
|00001bd0| 74 68 65 20 7b 5c 74 74 | 20 72 65 73 65 72 76 65 |the {\tt| reserve|
|00001be0| 64 7d 20 61 6e 64 20 7b | 5c 74 74 20 69 6c 6b 7d |d} and {|\tt ilk}|
|00001bf0| 0a 63 6f 6d 6d 61 6e 64 | 73 3b 20 74 68 65 20 6f |.command|s; the o|
|00001c00| 74 68 65 72 20 74 6f 6b | 65 6e 73 20 61 72 65 20 |ther tok|ens are |
|00001c10| 73 70 65 63 69 66 69 65 | 64 20 75 73 69 6e 67 20 |specifie|d using |
|00001c20| 74 68 65 20 7b 5c 74 74 | 20 74 6f 6b 65 6e 7d 0a |the {\tt| token}.|
|00001c30| 63 6f 6d 6d 61 6e 64 2e | 0a 28 54 68 69 73 20 73 |command.|.(This s|
|00001c40| 6f 6d 65 77 68 61 74 20 | 75 6e 75 73 75 61 6c 20 |omewhat |unusual |
|00001c50| 73 65 74 75 70 20 69 73 | 20 64 69 63 74 61 74 65 |setup is| dictate|
|00001c60| 64 20 62 79 20 74 68 65 | 20 77 61 79 20 7b 5c 74 |d by the| way {\t|
|00001c70| 74 0a 57 45 41 56 45 7d | 20 77 6f 72 6b 73 3b 20 |t.WEAVE}| works; |
|00001c80| 69 74 73 20 61 64 76 61 | 6e 74 61 67 65 20 69 73 |its adva|ntage is|
|00001c90| 20 74 68 61 74 20 69 73 | 20 69 73 20 65 61 73 79 | that is| is easy|
|00001ca0| 20 74 6f 20 64 65 66 69 | 6e 65 20 61 20 77 68 6f | to defi|ne a who|
|00001cb0| 6c 65 20 67 72 6f 75 70 | 0a 6f 66 20 72 65 73 65 |le group|.of rese|
|00001cc0| 72 76 65 64 20 77 6f 72 | 64 73 20 74 68 61 74 20 |rved wor|ds that |
|00001cd0| 77 69 6c 6c 20 62 65 20 | 74 72 65 61 74 65 64 20 |will be |treated |
|00001ce0| 69 64 65 6e 74 69 63 61 | 6c 6c 79 2e 29 0a 48 65 |identica|lly.).He|
|00001cf0| 72 65 27 73 20 68 6f 77 | 20 69 74 20 77 6f 72 6b |re's how| it work|
|00001d00| 73 3a 20 74 68 65 20 7b | 5c 74 74 20 72 65 73 65 |s: the {|\tt rese|
|00001d10| 72 76 65 64 7d 20 63 6f | 6d 6d 61 6e 64 20 64 65 |rved} co|mmand de|
|00001d20| 73 69 67 6e 61 74 65 73 | 0a 20 61 20 70 61 72 74 |signates|. a part|
|00001d30| 69 63 75 6c 61 72 20 69 | 64 65 6e 74 69 66 69 65 |icular i|dentifie|
|00001d40| 72 20 61 73 20 61 20 72 | 65 73 65 72 76 65 64 20 |r as a r|eserved |
|00001d50| 77 6f 72 64 2c 20 61 6e | 64 20 73 61 79 73 0a 77 |word, an|d says.w|
|00001d60| 68 61 74 20 7b 5c 65 6d | 20 69 6c 6b 7d 20 69 74 |hat {\em| ilk} it|
|00001d70| 20 62 65 6c 6f 6e 67 73 | 20 74 6f 2e 0a 54 68 65 | belongs| to..The|
|00001d80| 20 7b 5c 74 74 20 74 6f | 6b 65 6e 7d 20 61 6e 64 | {\tt to|ken} and|
|00001d90| 20 7b 5c 74 74 20 69 6c | 6b 7d 20 63 6f 6d 6d 61 | {\tt il|k} comma|
|00001da0| 6e 64 73 20 74 65 6c 6c | 20 7b 5c 74 74 20 57 45 |nds tell| {\tt WE|
|00001db0| 41 56 45 7d 20 61 6e 64 | 20 7b 5c 74 74 0a 54 41 |AVE} and| {\tt.TA|
|00001dc0| 4e 47 4c 45 7d 20 77 68 | 61 74 20 74 6f 20 64 6f |NGLE} wh|at to do|
|00001dd0| 20 77 69 74 68 20 61 20 | 70 61 72 74 69 63 75 6c | with a |particul|
|00001de0| 61 72 20 74 6f 6b 65 6e | 2c 20 6f 72 20 77 69 74 |ar token|, or wit|
|00001df0| 68 20 61 6c 6c 20 74 68 | 65 20 72 65 73 65 72 76 |h all th|e reserv|
|00001e00| 65 64 0a 77 6f 72 64 73 | 20 6f 66 20 61 20 70 61 |ed.words| of a pa|
|00001e10| 72 74 69 63 75 6c 61 72 | 20 69 6c 6b 2e 0a 46 6f |rticular| ilk..Fo|
|00001e20| 72 20 65 61 63 68 20 74 | 6f 6b 65 6e 20 6f 72 20 |r each t|oken or |
|00001e30| 69 6c 6b 20 6f 6e 65 20 | 63 61 6e 20 73 70 65 63 |ilk one |can spec|
|00001e40| 69 66 79 20 74 68 65 20 | 7b 5c 65 6d 20 74 61 6e |ify the |{\em tan|
|00001e50| 67 6c 65 74 6f 7d 20 66 | 69 65 6c 64 2c 20 74 68 |gleto} f|ield, th|
|00001e60| 65 0a 74 6f 6b 65 6e 27 | 73 20 7b 5c 65 6d 20 6d |e.token'|s {\em m|
|00001e70| 61 74 68 6e 65 73 73 7d | 20 28 77 68 65 74 68 65 |athness}| (whethe|
|00001e80| 72 20 69 74 20 68 61 73 | 20 74 6f 20 62 65 20 74 |r it has| to be t|
|00001e90| 79 70 65 73 65 74 20 69 | 6e 20 6d 61 74 68 20 6d |ypeset i|n math m|
|00001ea0| 6f 64 65 29 2c 20 61 6e | 64 0a 69 74 73 20 7b 5c |ode), an|d.its {\|
|00001eb0| 65 6d 20 63 61 74 65 67 | 6f 72 79 7d 20 61 6e 64 |em categ|ory} and|
|00001ec0| 20 7b 5c 65 6d 20 74 72 | 61 6e 73 6c 61 74 69 6f | {\em tr|anslatio|
|00001ed0| 6e 7d 20 28 66 6f 72 20 | 63 6f 6e 76 65 72 73 69 |n} (for |conversi|
|00001ee0| 6f 6e 20 74 6f 20 73 63 | 72 61 70 73 29 2e 0a 41 |on to sc|raps)..A|
|00001ef0| 6c 6c 20 62 75 74 20 74 | 68 65 20 63 61 74 65 67 |ll but t|he categ|
|00001f00| 6f 72 79 20 63 61 6e 20 | 68 61 76 65 20 64 65 66 |ory can |have def|
|00001f10| 61 75 6c 74 73 2c 20 73 | 65 74 20 77 69 74 68 20 |aults, s|et with |
|00001f20| 74 68 65 20 7b 5c 74 74 | 20 64 65 66 61 75 6c 74 |the {\tt| default|
|00001f30| 73 7d 0a 63 6f 6d 6d 61 | 6e 64 2e 0a 43 68 6f 69 |s}.comma|nd..Choi|
|00001f40| 63 65 20 6f 66 20 63 61 | 74 65 67 6f 72 79 20 6e |ce of ca|tegory n|
|00001f50| 61 6d 65 73 20 69 73 20 | 75 70 20 74 6f 20 74 68 |ames is |up to th|
|00001f60| 65 20 75 73 65 72 2e 0a | 0a 57 65 20 77 69 6c 6c |e user..|.We will|
|00001f70| 20 64 69 73 63 75 73 73 | 20 74 68 65 20 74 6f 6b | discuss| the tok|
|00001f80| 65 6e 69 7a 61 74 69 6f | 6e 20 63 6f 6d 6d 61 6e |enizatio|n comman|
|00001f90| 64 73 20 6d 6f 72 65 20 | 6c 61 74 65 72 20 77 68 |ds more |later wh|
|00001fa0| 65 6e 20 77 65 20 70 72 | 65 73 65 6e 74 0a 74 68 |en we pr|esent.th|
|00001fb0| 65 20 73 79 6e 74 61 78 | 20 6f 66 20 7b 53 70 69 |e syntax| of {Spi|
|00001fc0| 64 65 72 7d 20 69 6e 20 | 64 65 74 61 69 6c 2e 0a |der} in |detail..|
|00001fd0| 4d 65 61 6e 77 68 69 6c | 65 2c 20 0a 68 65 72 65 |Meanwhil|e, .here|
|00001fe0| 20 61 72 65 20 73 6f 6d | 65 20 65 78 61 6d 70 6c | are som|e exampl|
|00001ff0| 65 20 74 6f 6b 65 6e 69 | 7a 61 74 69 6f 6e 20 63 |e tokeni|zation c|
|00002000| 6f 6d 6d 61 6e 64 73 20 | 66 72 6f 6d 20 74 68 65 |ommands |from the|
|00002010| 20 7b 5c 74 74 20 73 70 | 69 64 65 72 7d 20 66 69 | {\tt sp|ider} fi|
|00002020| 6c 65 0a 66 6f 72 7e 43 | 3a 0a 5c 62 65 67 69 6e |le.for~C|:.\begin|
|00002030| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 74 6f 6b 65 6e |{verbati|m}.token|
|00002040| 20 2b 20 63 61 74 65 67 | 6f 72 79 20 75 6e 6f 72 | + categ|ory unor|
|00002050| 62 69 6e 6f 70 0a 74 6f | 6b 65 6e 20 2d 20 63 61 |binop.to|ken - ca|
|00002060| 74 65 67 6f 72 79 20 75 | 6e 6f 72 62 69 6e 6f 70 |tegory u|norbinop|
|00002070| 0a 74 6f 6b 65 6e 20 2a | 20 63 61 74 65 67 6f 72 |.token *| categor|
|00002080| 79 20 75 6e 6f 72 62 69 | 6e 6f 70 0a 74 6f 6b 65 |y unorbi|nop.toke|
|00002090| 6e 20 3d 20 63 61 74 65 | 67 6f 72 79 20 65 71 75 |n = cate|gory equ|
|000020a0| 61 6c 73 20 74 72 61 6e | 73 6c 61 74 69 6f 6e 20 |als tran|slation |
|000020b0| 3c 22 5c 5c 6c 65 66 74 | 61 72 72 6f 77 22 3e 20 |<"\\left|arrow"> |
|000020c0| 74 61 6e 67 6c 65 74 6f | 20 3c 22 3d 22 2d 73 70 |tangleto| <"="-sp|
|000020d0| 61 63 65 3e 0a 74 6f 6b | 65 6e 20 7e 20 63 61 74 |ace>.tok|en ~ cat|
|000020e0| 65 67 6f 72 79 20 75 6e | 6f 70 20 74 72 61 6e 73 |egory un|op trans|
|000020f0| 6c 61 74 69 6f 6e 20 3c | 22 5c 5c 54 49 22 3e 0a |lation <|"\\TI">.|
|00002100| 74 6f 6b 65 6e 20 26 20 | 63 61 74 65 67 6f 72 79 |token & |category|
|00002110| 20 75 6e 6f 72 62 69 6e | 6f 70 20 74 72 61 6e 73 | unorbin|op trans|
|00002120| 6c 61 74 69 6f 6e 20 3c | 22 5c 5c 61 6d 70 22 3e |lation <|"\\amp">|
|00002130| 0a 74 6f 6b 65 6e 20 5e | 20 74 72 61 6e 73 6c 61 |.token ^| transla|
|00002140| 74 69 6f 6e 20 3c 22 5c | 5c 5e 22 3e 20 63 61 74 |tion <"\|\^"> cat|
|00002150| 65 67 6f 72 79 20 62 69 | 6e 6f 70 0a 74 6f 6b 65 |egory bi|nop.toke|
|00002160| 6e 20 3f 20 74 72 61 6e | 73 6c 61 74 69 6f 6e 20 |n ? tran|slation |
|00002170| 3c 22 5c 5c 3f 22 3e 20 | 63 61 74 65 67 6f 72 79 |<"\\?"> |category|
|00002180| 20 71 75 65 73 74 69 6f | 6e 0a 74 6f 6b 65 6e 20 | questio|n.token |
|00002190| 25 20 74 72 61 6e 73 6c | 61 74 69 6f 6e 20 3c 22 |% transl|ation <"|
|000021a0| 5c 5c 25 22 3e 20 63 61 | 74 65 67 6f 72 79 20 62 |\\%"> ca|tegory b|
|000021b0| 69 6e 6f 70 0a 74 6f 6b | 65 6e 20 23 20 74 72 61 |inop.tok|en # tra|
|000021c0| 6e 73 6c 61 74 69 6f 6e | 20 3c 22 5c 5c 23 22 3e |nslation| <"\\#">|
|000021d0| 20 63 61 74 65 67 6f 72 | 79 20 73 68 61 72 70 0a | categor|y sharp.|
|000021e0| 74 6f 6b 65 6e 20 21 20 | 63 61 74 65 67 6f 72 79 |token ! |category|
|000021f0| 20 75 6e 6f 70 20 74 72 | 61 6e 73 6c 61 74 69 6f | unop tr|anslatio|
|00002200| 6e 20 3c 22 5c 5c 6e 65 | 67 22 3e 0a 74 6f 6b 65 |n <"\\ne|g">.toke|
|00002210| 6e 20 28 20 63 61 74 65 | 67 6f 72 79 20 6c 70 61 |n ( cate|gory lpa|
|00002220| 72 0a 74 6f 6b 65 6e 20 | 29 20 63 61 74 65 67 6f |r.token |) catego|
|00002230| 72 79 20 72 70 61 72 0a | 74 6f 6b 65 6e 20 5b 20 |ry rpar.|token [ |
|00002240| 63 61 74 65 67 6f 72 79 | 20 6c 70 61 72 0a 74 6f |category| lpar.to|
|00002250| 6b 65 6e 20 5d 20 63 61 | 74 65 67 6f 72 79 20 72 |ken ] ca|tegory r|
|00002260| 70 61 72 0a 74 6f 6b 65 | 6e 20 7b 20 74 72 61 6e |par.toke|n { tran|
|00002270| 73 6c 61 74 69 6f 6e 20 | 3c 22 5c 5c 7b 22 3e 20 |slation |<"\\{"> |
|00002280| 63 61 74 65 67 6f 72 79 | 20 6c 62 72 61 63 65 0a |category| lbrace.|
|00002290| 74 6f 6b 65 6e 20 7d 20 | 74 72 61 6e 73 6c 61 74 |token } |translat|
|000022a0| 69 6f 6e 20 3c 22 5c 5c | 7d 22 3e 20 63 61 74 65 |ion <"\\|}"> cate|
|000022b0| 67 6f 72 79 20 72 62 72 | 61 63 65 0a 74 6f 6b 65 |gory rbr|ace.toke|
|000022c0| 6e 20 2b 2b 20 63 61 74 | 65 67 6f 72 79 20 75 6e |n ++ cat|egory un|
|000022d0| 6f 70 20 74 72 61 6e 73 | 6c 61 74 69 6f 6e 20 3c |op trans|lation <|
|000022e0| 22 5c 5c 50 50 22 3e 0a | 74 6f 6b 65 6e 20 2d 2d |"\\PP">.|token --|
|000022f0| 20 63 61 74 65 67 6f 72 | 79 20 75 6e 6f 70 20 74 | categor|y unop t|
|00002300| 72 61 6e 73 6c 61 74 69 | 6f 6e 20 3c 22 5c 5c 4d |ranslati|on <"\\M|
|00002310| 4d 22 3e 0a 74 6f 6b 65 | 6e 20 21 3d 20 74 72 61 |M">.toke|n != tra|
|00002320| 6e 73 6c 61 74 69 6f 6e | 20 3c 22 5c 5c 49 22 3e |nslation| <"\\I">|
|00002330| 20 63 61 74 65 67 6f 72 | 79 20 62 69 6e 6f 70 0a | categor|y binop.|
|00002340| 74 6f 6b 65 6e 20 3d 3d | 20 74 72 61 6e 73 6c 61 |token ==| transla|
|00002350| 74 69 6f 6e 20 3c 22 5c | 5c 53 22 3e 20 63 61 74 |tion <"\|\S"> cat|
|00002360| 65 67 6f 72 79 20 62 69 | 6e 6f 70 0a 74 6f 6b 65 |egory bi|nop.toke|
|00002370| 6e 20 26 26 20 74 72 61 | 6e 73 6c 61 74 69 6f 6e |n && tra|nslation|
|00002380| 20 3c 22 5c 5c 57 22 3e | 20 63 61 74 65 67 6f 72 | <"\\W">| categor|
|00002390| 79 20 62 69 6e 6f 70 0a | 0a 69 6c 6b 20 63 61 73 |y binop.|.ilk cas|
|000023a0| 65 5f 6c 69 6b 65 20 63 | 61 74 65 67 6f 72 79 20 |e_like c|ategory |
|000023b0| 63 61 73 65 0a 69 6c 6b | 20 69 6e 74 5f 6c 69 6b |case.ilk| int_lik|
|000023c0| 65 20 63 61 74 65 67 6f | 72 79 20 69 6e 74 0a 0a |e catego|ry int..|
|000023d0| 72 65 73 65 72 76 65 64 | 20 61 75 74 6f 20 69 6c |reserved| auto il|
|000023e0| 6b 20 69 6e 74 5f 6c 69 | 6b 65 0a 72 65 73 65 72 |k int_li|ke.reser|
|000023f0| 76 65 64 20 62 72 65 61 | 6b 20 69 6c 6b 20 63 61 |ved brea|k ilk ca|
|00002400| 73 65 5f 6c 69 6b 65 0a | 72 65 73 65 72 76 65 64 |se_like.|reserved|
|00002410| 20 63 61 73 65 20 69 6c | 6b 20 63 61 73 65 5f 6c | case il|k case_l|
|00002420| 69 6b 65 0a 72 65 73 65 | 72 76 65 64 20 63 68 61 |ike.rese|rved cha|
|00002430| 72 20 69 6c 6b 20 69 6e | 74 5f 6c 69 6b 65 0a 5c |r ilk in|t_like.\|
|00002440| 65 6e 64 7b 76 65 72 62 | 61 74 69 6d 7d 0a 54 68 |end{verb|atim}.Th|
|00002450| 65 73 65 20 73 68 6f 77 | 20 74 68 65 20 64 65 66 |ese show| the def|
|00002460| 69 6e 69 74 69 6f 6e 73 | 20 6f 66 20 73 6f 6d 65 |initions| of some|
|00002470| 20 6f 66 20 74 68 65 20 | 74 6f 6b 65 6e 73 20 75 | of the |tokens u|
|00002480| 73 65 64 20 69 6e 20 43 | 2e 0a 4e 6f 74 69 63 65 |sed in C|..Notice|
|00002490| 20 74 68 65 20 7b 5c 74 | 74 20 74 61 6e 67 6c 65 | the {\t|t tangle|
|000024a0| 74 6f 7d 20 6f 70 74 69 | 6f 6e 20 69 73 20 61 6c |to} opti|on is al|
|000024b0| 6d 6f 73 74 20 61 6c 77 | 61 79 73 20 6c 65 66 74 |most alw|ays left|
|000024c0| 20 74 6f 20 64 65 66 61 | 75 6c 74 2c 20 61 6e 64 | to defa|ult, and|
|000024d0| 0a 74 68 65 20 7b 5c 74 | 74 20 74 72 61 6e 73 6c |.the {\t|t transl|
|000024e0| 61 74 69 6f 6e 7d 20 6f | 70 74 69 6f 6e 20 69 73 |ation} o|ption is|
|000024f0| 20 6f 66 74 65 6e 20 6c | 65 66 74 20 74 6f 20 64 | often l|eft to d|
|00002500| 65 66 61 75 6c 74 2e 0a | 0a 4f 6e 63 65 20 74 68 |efault..|.Once th|
|00002510| 65 20 74 6f 6b 65 6e 73 | 20 61 72 65 20 73 70 65 |e tokens| are spe|
|00002520| 63 69 66 69 65 64 2c 20 | 61 6e 64 20 65 61 63 68 |cified, |and each|
|00002530| 20 68 61 73 20 61 20 7b | 5c 74 74 20 74 61 6e 67 | has a {|\tt tang|
|00002540| 6c 65 74 6f 7d 20 73 74 | 72 69 6e 67 2c 0a 77 65 |leto} st|ring,.we|
|00002550| 20 63 61 6e 20 61 6c 6d | 6f 73 74 20 63 6f 6e 73 | can alm|ost cons|
|00002560| 74 72 75 63 74 20 61 20 | 7b 5c 74 74 20 54 41 4e |truct a |{\tt TAN|
|00002570| 47 4c 45 7d 20 66 6f 72 | 20 74 68 65 20 6c 61 6e |GLE} for| the lan|
|00002580| 67 75 61 67 65 2e 20 0a | 20 42 65 66 6f 72 65 20 |guage. .| Before |
|00002590| 77 65 20 63 61 6e 20 63 | 6f 6e 73 74 72 75 63 74 |we can c|onstruct|
|000025a0| 20 61 20 7b 5c 74 74 20 | 57 45 41 56 45 7d 2c 20 | a {\tt |WEAVE}, |
|000025b0| 77 65 20 68 61 76 65 20 | 74 6f 20 74 65 6c 6c 20 |we have |to tell |
|000025c0| 69 74 20 68 6f 77 20 74 | 6f 0a 63 6f 6d 62 69 6e |it how t|o.combin|
|000025d0| 65 20 61 6e 64 20 72 65 | 64 75 63 65 20 73 63 72 |e and re|duce scr|
|000025e0| 61 70 73 2e 0a 0a 5c 73 | 65 63 74 69 6f 6e 7b 55 |aps...\s|ection{U|
|000025f0| 73 69 6e 67 20 7b 53 70 | 69 64 65 72 7d 20 74 6f |sing {Sp|ider} to|
|00002600| 20 74 65 6c 6c 20 7b 5c | 74 74 20 57 45 41 56 45 | tell {\|tt WEAVE|
|00002610| 7d 20 68 6f 77 20 74 6f | 20 72 65 64 75 63 65 20 |} how to| reduce |
|00002620| 73 63 72 61 70 73 7d 0a | 54 68 65 20 6d 6f 73 74 |scraps}.|The most|
|00002630| 20 69 6e 74 72 69 63 61 | 74 65 20 70 61 72 74 20 | intrica|te part |
|00002640| 6f 66 20 7b 5c 74 74 20 | 57 45 41 56 45 7d 20 69 |of {\tt |WEAVE} i|
|00002650| 73 20 69 74 73 20 6d 65 | 63 68 61 6e 69 73 6d 20 |s its me|chanism |
|00002660| 66 6f 72 20 63 6f 6e 76 | 65 72 74 69 6e 67 0a 70 |for conv|erting.p|
|00002670| 72 6f 67 72 61 6d 6d 69 | 6e 67 20 6c 61 6e 67 75 |rogrammi|ng langu|
|00002680| 61 67 65 20 63 6f 64 65 | 20 69 6e 74 6f 20 5c 54 |age code| into \T|
|00002690| 65 58 5c 20 63 6f 64 65 | 2e 0a 7b 5c 74 74 20 57 |eX\ code|..{\tt W|
|000026a0| 45 41 56 45 7d 20 75 73 | 65 73 20 61 20 73 69 6d |EAVE} us|es a sim|
|000026b0| 70 6c 65 20 62 6f 74 74 | 6f 6d 2d 75 70 20 70 61 |ple bott|om-up pa|
|000026c0| 72 73 69 6e 67 20 61 6c | 67 6f 72 69 74 68 6d 2c |rsing al|gorithm,|
|000026d0| 20 73 69 6e 63 65 20 69 | 74 0a 20 6d 75 73 74 20 | since i|t. must |
|000026e0| 64 65 61 6c 20 77 69 74 | 68 20 66 72 61 67 6d 65 |deal wit|h fragme|
|000026f0| 6e 74 61 72 79 0a 63 6f | 6e 73 74 72 75 63 74 69 |ntary.co|nstructi|
|00002700| 6f 6e 73 20 77 68 6f 73 | 65 20 6f 76 65 72 61 6c |ons whos|e overal|
|00002710| 6c 20 60 60 70 61 72 74 | 20 6f 66 20 73 70 65 65 |l ``part| of spee|
|00002720| 63 68 27 27 20 69 73 20 | 6e 6f 74 20 6b 6e 6f 77 |ch'' is |not know|
|00002730| 6e 2e 0a 0a 54 68 65 20 | 69 6e 70 75 74 20 69 73 |n...The |input is|
|00002740| 20 72 65 70 72 65 73 65 | 6e 74 65 64 20 61 73 20 | represe|nted as |
|00002750| 61 20 73 65 71 75 65 6e | 63 65 20 6f 66 20 20 7b |a sequen|ce of {|
|00002760| 5c 65 6d 20 73 63 72 61 | 70 73 7d 2c 20 0a 77 68 |\em scra|ps}, .wh|
|00002770| 65 72 65 20 65 61 63 68 | 20 73 63 72 61 70 20 6f |ere each| scrap o|
|00002780| 66 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 63 6f |f inform|ation co|
|00002790| 6e 73 69 73 74 73 0a 6f | 66 20 74 77 6f 20 70 61 |nsists.o|f two pa|
|000027a0| 72 74 73 2c 20 69 74 73 | 20 7b 5c 65 6d 20 63 61 |rts, its| {\em ca|
|000027b0| 74 65 67 6f 72 79 7d 20 | 61 6e 64 20 69 74 73 20 |tegory} |and its |
|000027c0| 7b 5c 65 6d 20 74 72 61 | 6e 73 6c 61 74 69 6f 6e |{\em tra|nslation|
|000027d0| 7d 2e 20 0a 54 68 65 20 | 63 61 74 65 67 6f 72 79 |}. .The |category|
|000027e0| 0a 69 73 20 65 73 73 65 | 6e 74 69 61 6c 6c 79 20 |.is esse|ntially |
|000027f0| 61 20 73 79 6e 74 61 63 | 74 69 63 20 63 6c 61 73 |a syntac|tic clas|
|00002800| 73 2c 20 61 6e 64 20 74 | 68 65 20 74 72 61 6e 73 |s, and t|he trans|
|00002810| 6c 61 74 69 6f 6e 20 72 | 65 70 72 65 73 65 6e 74 |lation r|epresent|
|00002820| 73 0a 7b 5c 54 65 58 7d | 20 63 6f 64 65 2e 0a 52 |s.{\TeX}| code..R|
|00002830| 75 6c 65 73 20 6f 66 20 | 73 79 6e 74 61 78 20 61 |ules of |syntax a|
|00002840| 6e 64 20 73 65 6d 61 6e | 74 69 63 73 20 74 65 6c |nd seman|tics tel|
|00002850| 6c 20 75 73 20 68 6f 77 | 20 74 6f 0a 63 6f 6d 62 |l us how| to.comb|
|00002860| 69 6e 65 20 61 64 6a 61 | 63 65 6e 74 20 73 63 72 |ine adja|cent scr|
|00002870| 61 70 73 20 69 6e 74 6f | 20 6c 61 72 67 65 72 20 |aps into| larger |
|00002880| 6f 6e 65 73 2c 20 61 6e | 64 20 69 66 20 77 65 20 |ones, an|d if we |
|00002890| 61 72 65 20 6c 75 63 6b | 79 20 61 6e 20 65 6e 74 |are luck|y an ent|
|000028a0| 69 72 65 0a 70 72 6f 67 | 72 61 6d 20 74 65 78 74 |ire.prog|ram text|
|000028b0| 20 74 68 61 74 20 73 74 | 61 72 74 73 20 6f 75 74 | that st|arts out|
|000028c0| 20 61 73 20 68 75 6e 64 | 72 65 64 73 20 6f 66 20 | as hund|reds of |
|000028d0| 73 6d 61 6c 6c 20 73 63 | 72 61 70 73 20 77 69 6c |small sc|raps wil|
|000028e0| 6c 20 6a 6f 69 6e 0a 74 | 6f 67 65 74 68 65 72 20 |l join.t|ogether |
|000028f0| 69 6e 74 6f 20 6f 6e 65 | 20 67 69 67 61 6e 74 69 |into one| giganti|
|00002900| 63 20 73 63 72 61 70 20 | 77 68 6f 73 65 20 74 72 |c scrap |whose tr|
|00002910| 61 6e 73 6c 61 74 69 6f | 6e 20 69 73 20 74 68 65 |anslatio|n is the|
|00002920| 20 64 65 73 69 72 65 64 | 20 5c 54 65 58 5c 0a 63 | desired| \TeX\.c|
|00002930| 6f 64 65 2e 20 0a 49 66 | 20 77 65 20 61 72 65 20 |ode. .If| we are |
|00002940| 75 6e 6c 75 63 6b 79 2c | 20 77 65 20 77 69 6c 6c |unlucky,| we will|
|00002950| 20 62 65 20 6c 65 66 74 | 20 77 69 74 68 20 73 65 | be left| with se|
|00002960| 76 65 72 61 6c 20 73 63 | 72 61 70 73 20 74 68 61 |veral sc|raps tha|
|00002970| 74 20 64 6f 6e 27 74 0a | 63 6f 6d 62 69 6e 65 3b |t don't.|combine;|
|00002980| 20 74 68 65 69 72 20 74 | 72 61 6e 73 6c 61 74 69 | their t|ranslati|
|00002990| 6f 6e 73 20 77 69 6c 6c | 20 73 69 6d 70 6c 79 20 |ons will| simply |
|000029a0| 62 65 20 6f 75 74 70 75 | 74 2c 20 6f 6e 65 20 62 |be outpu|t, one b|
|000029b0| 79 20 6f 6e 65 2e 0a 0a | 54 68 65 20 63 6f 6d 62 |y one...|The comb|
|000029c0| 69 6e 61 74 69 6f 6e 20 | 72 75 6c 65 73 20 61 72 |ination |rules ar|
|000029d0| 65 20 67 69 76 65 6e 20 | 61 73 20 63 6f 6e 74 65 |e given |as conte|
|000029e0| 78 74 2d 73 65 6e 73 69 | 74 69 76 65 20 70 72 6f |xt-sensi|tive pro|
|000029f0| 64 75 63 74 69 6f 6e 73 | 20 74 68 61 74 20 61 72 |ductions| that ar|
|00002a00| 65 0a 61 70 70 6c 69 65 | 64 20 66 72 6f 6d 20 6c |e.applie|d from l|
|00002a10| 65 66 74 20 74 6f 20 72 | 69 67 68 74 2e 20 53 75 |eft to r|ight. Su|
|00002a20| 70 70 6f 73 65 20 74 68 | 61 74 20 77 65 20 61 72 |ppose th|at we ar|
|00002a30| 65 20 63 75 72 72 65 6e | 74 6c 79 20 77 6f 72 6b |e curren|tly work|
|00002a40| 69 6e 67 20 6f 6e 20 74 | 68 65 0a 73 65 71 75 65 |ing on t|he.seque|
|00002a50| 6e 63 65 20 6f 66 20 73 | 63 72 61 70 73 20 24 73 |nce of s|craps $s|
|00002a60| 5f 31 5c 2c 73 5f 32 5c | 6c 64 6f 74 73 20 73 5f |_1\,s_2\|ldots s_|
|00002a70| 6e 24 2e 20 57 65 20 74 | 72 79 20 66 69 72 73 74 |n$. We t|ry first|
|00002a80| 20 74 6f 20 66 69 6e 64 | 20 74 68 65 20 6c 6f 6e | to find| the lon|
|00002a90| 67 65 73 74 0a 70 72 6f | 64 75 63 74 69 6f 6e 20 |gest.pro|duction |
|00002aa0| 74 68 61 74 20 61 70 70 | 6c 69 65 73 20 74 6f 20 |that app|lies to |
|00002ab0| 61 6e 20 69 6e 69 74 69 | 61 6c 20 73 75 62 73 74 |an initi|al subst|
|00002ac0| 72 69 6e 67 20 24 73 5f | 31 5c 2c 73 5f 32 5c 6c |ring $s_|1\,s_2\l|
|00002ad0| 64 6f 74 73 5c 2c 24 3b | 20 62 75 74 20 69 66 0a |dots\,$;| but if.|
|00002ae0| 6e 6f 20 73 75 63 68 20 | 70 72 6f 64 75 63 74 69 |no such |producti|
|00002af0| 6f 6e 73 20 65 78 69 73 | 74 2c 20 77 65 20 66 69 |ons exis|t, we fi|
|00002b00| 6e 64 20 74 6f 20 66 69 | 6e 64 20 74 68 65 20 6c |nd to fi|nd the l|
|00002b10| 6f 6e 67 65 73 74 20 70 | 72 6f 64 75 63 74 69 6f |ongest p|roductio|
|00002b20| 6e 0a 61 70 70 6c 69 63 | 61 62 6c 65 20 74 6f 20 |n.applic|able to |
|00002b30| 74 68 65 20 6e 65 78 74 | 20 73 75 62 73 74 72 69 |the next| substri|
|00002b40| 6e 67 20 24 73 5f 32 5c | 2c 73 5f 33 5c 6c 64 6f |ng $s_2\|,s_3\ldo|
|00002b50| 74 73 5c 2c 24 3b 20 61 | 6e 64 20 69 66 20 74 68 |ts\,$; a|nd if th|
|00002b60| 61 74 20 66 61 69 6c 73 | 2c 20 77 65 0a 74 72 79 |at fails|, we.try|
|00002b70| 20 74 6f 20 6d 61 74 63 | 68 20 24 73 5f 33 5c 2c | to matc|h $s_3\,|
|00002b80| 73 5f 34 5c 6c 64 6f 74 | 73 5c 2c 24 2c 20 65 74 |s_4\ldot|s\,$, et|
|00002b90| 20 63 65 74 65 72 61 2e | 0a 0a 41 20 70 72 6f 64 | cetera.|..A prod|
|00002ba0| 75 63 74 69 6f 6e 20 61 | 70 70 6c 69 65 73 20 69 |uction a|pplies i|
|00002bb0| 66 20 74 68 65 20 63 61 | 74 65 67 6f 72 79 20 63 |f the ca|tegory c|
|00002bc0| 6f 64 65 73 20 68 61 76 | 65 20 61 20 67 69 76 65 |odes hav|e a give|
|00002bd0| 6e 20 70 61 74 74 65 72 | 6e 2e 20 46 6f 72 0a 65 |n patter|n. For.e|
|00002be0| 78 61 6d 70 6c 65 2c 20 | 69 66 20 6f 6e 65 20 6f |xample, |if one o|
|00002bf0| 66 20 74 68 65 20 70 72 | 6f 64 75 63 74 69 6f 6e |f the pr|oduction|
|00002c00| 73 20 69 73 0a 24 24 5c | 68 62 6f 78 7b 5c 74 74 |s is.$$\|hbox{\tt|
|00002c10| 20 6f 70 65 6e 20 5b 20 | 6d 61 74 68 20 73 65 6d | open [ |math sem|
|00002c20| 69 20 3c 22 5c 42 53 5c | 42 53 2c 22 2d 6f 70 74 |i <"\BS\|BS,"-opt|
|00002c30| 2d 35 3e 20 5d 20 2d 2d | 3e 0a 6f 70 65 6e 20 6d |-5> ] --|>.open m|
|00002c40| 61 74 68 7d 24 24 20 0a | 74 68 65 6e 20 69 74 20 |ath}$$ .|then it |
|00002c50| 6d 65 61 6e 73 20 74 68 | 61 74 20 74 68 72 65 65 |means th|at three|
|00002c60| 20 63 6f 6e 73 65 63 75 | 74 69 76 65 20 73 63 72 | consecu|tive scr|
|00002c70| 61 70 73 20 77 68 6f 73 | 65 20 72 65 73 70 65 63 |aps whos|e respec|
|00002c80| 74 69 76 65 20 63 61 74 | 65 67 6f 72 69 65 73 20 |tive cat|egories |
|00002c90| 61 72 65 0a 7b 5c 74 74 | 20 6f 70 65 6e 7d 2c 20 |are.{\tt| open}, |
|00002ca0| 7b 5c 74 74 20 6d 61 74 | 68 7d 2c 20 61 6e 64 20 |{\tt mat|h}, and |
|00002cb0| 7b 5c 74 74 20 73 65 6d | 69 7d 20 61 72 65 20 63 |{\tt sem|i} are c|
|00002cc0| 6f 6e 5c 2d 76 65 72 74 | 65 64 20 74 6f 20 74 77 |on\-vert|ed to tw|
|00002cd0| 6f 20 73 63 72 61 70 73 | 20 77 68 6f 73 65 20 63 |o scraps| whose c|
|00002ce0| 61 74 65 67 6f 72 69 65 | 73 0a 61 72 65 20 7b 5c |ategorie|s.are {\|
|00002cf0| 74 74 20 6f 70 65 6e 7d | 20 61 6e 64 20 7b 5c 74 |tt open}| and {\t|
|00002d00| 74 20 6d 61 74 68 7d 2e | 20 0a 20 54 68 65 20 7b |t math}.| . The {|
|00002d10| 5c 74 74 20 6f 70 65 6e | 7d 20 73 63 72 61 70 20 |\tt open|} scrap |
|00002d20| 68 61 73 20 6e 6f 74 20 | 63 68 61 6e 67 65 64 2c |has not |changed,|
|00002d30| 20 77 68 69 6c 65 20 74 | 68 65 20 73 74 72 69 6e | while t|he strin|
|00002d40| 67 20 0a 7b 5c 74 74 20 | 3c 22 5c 42 53 5c 42 53 |g .{\tt |<"\BS\BS|
|00002d50| 2c 22 2d 6f 70 74 2d 35 | 3e 7d 20 0a 69 6e 64 69 |,"-opt-5|>} .indi|
|00002d60| 63 61 74 65 73 20 74 68 | 61 74 20 74 68 65 20 6e |cates th|at the n|
|00002d70| 65 77 20 7b 5c 74 74 20 | 6d 61 74 68 7d 20 73 63 |ew {\tt |math} sc|
|00002d80| 72 61 70 0a 68 61 73 20 | 61 20 74 72 61 6e 73 6c |rap.has |a transl|
|00002d90| 61 74 69 6f 6e 20 63 6f | 6d 70 6f 73 65 64 20 6f |ation co|mposed o|
|00002da0| 66 20 74 68 65 20 74 72 | 61 6e 73 6c 61 74 69 6f |f the tr|anslatio|
|00002db0| 6e 20 6f 66 20 74 68 65 | 20 6f 72 69 67 69 6e 61 |n of the| origina|
|00002dc0| 6c 0a 7b 5c 74 74 20 6d | 61 74 68 7d 20 73 63 72 |l.{\tt m|ath} scr|
|00002dd0| 61 70 20 66 6f 6c 6c 6f | 77 65 64 20 62 79 20 74 |ap follo|wed by t|
|00002de0| 68 65 20 74 72 61 6e 73 | 6c 61 74 69 6f 6e 20 6f |he trans|lation o|
|00002df0| 66 20 74 68 65 20 7b 5c | 74 74 20 73 65 6d 69 7d |f the {\|tt semi}|
|00002e00| 20 73 63 72 61 70 20 66 | 6f 6c 6c 6f 77 65 64 0a | scrap f|ollowed.|
|00002e10| 62 79 20 60 7b 5c 74 74 | 20 5c 42 53 2c 7d 27 20 |by `{\tt| \BS,}' |
|00002e20| 66 6f 6c 6c 6f 77 65 64 | 20 62 79 20 60 7b 5c 74 |followed| by `{\t|
|00002e30| 74 20 6f 70 74 7d 27 20 | 66 6f 6c 6c 6f 77 65 64 |t opt}' |followed|
|00002e40| 20 62 79 20 60 7b 5c 74 | 74 35 7d 27 2e 20 28 49 | by `{\t|t5}'. (I|
|00002e50| 6e 20 74 68 65 20 5c 54 | 65 58 5c 20 66 69 6c 65 |n the \T|eX\ file|
|00002e60| 2c 0a 74 68 69 73 20 77 | 69 6c 6c 20 73 70 65 63 |,.this w|ill spec|
|00002e70| 69 66 79 20 61 6e 20 61 | 64 64 69 74 69 6f 6e 61 |ify an a|dditiona|
|00002e80| 6c 20 74 68 69 6e 20 73 | 70 61 63 65 20 61 66 74 |l thin s|pace aft|
|00002e90| 65 72 20 74 68 65 20 73 | 65 6d 69 63 6f 6c 6f 6e |er the s|emicolon|
|00002ea0| 2c 20 66 6f 6c 6c 6f 77 | 65 64 0a 62 79 20 61 6e |, follow|ed.by an|
|00002eb0| 20 6f 70 74 69 6f 6e 61 | 6c 20 6c 69 6e 65 20 62 | optiona|l line b|
|00002ec0| 72 65 61 6b 20 77 69 74 | 68 20 70 65 6e 61 6c 74 |reak wit|h penalt|
|00002ed0| 79 20 35 30 2e 29 20 0a | 54 72 61 6e 73 6c 61 74 |y 50.) .|Translat|
|00002ee0| 69 6f 6e 73 20 61 72 65 | 20 65 6e 63 6c 6f 73 65 |ions are| enclose|
|00002ef0| 64 20 69 6e 20 61 6e 67 | 6c 65 20 62 72 61 63 6b |d in ang|le brack|
|00002f00| 65 74 73 2c 20 61 6e 64 | 20 6d 61 79 20 63 6f 6e |ets, and| may con|
|00002f10| 74 61 69 6e 20 71 75 6f | 74 65 64 0a 73 74 72 69 |tain quo|ted.stri|
|00002f20| 6e 67 73 20 28 75 73 69 | 6e 67 20 74 68 65 20 43 |ngs (usi|ng the C|
|00002f30| 20 63 6f 6e 76 65 6e 74 | 69 6f 6e 73 20 74 6f 20 | convent|ions to |
|00002f40| 65 73 63 61 70 65 20 62 | 61 63 6b 73 6c 61 73 68 |escape b|ackslash|
|00002f50| 65 73 20 61 6e 64 20 73 | 6f 20 6f 6e 29 2c 20 6f |es and s|o on), o|
|00002f60| 72 0a 6d 61 79 20 63 6f | 6e 74 61 69 6e 20 73 70 |r.may co|ntain sp|
|00002f70| 65 63 69 61 6c 20 6b 65 | 79 77 6f 72 64 73 2e 0a |ecial ke|ywords..|
|00002f80| 0a 42 65 66 6f 72 65 20 | 67 69 76 69 6e 67 20 65 |.Before |giving e|
|00002f90| 78 61 6d 70 6c 65 73 20 | 6f 66 20 75 73 65 66 75 |xamples |of usefu|
|00002fa0| 6c 20 70 72 6f 64 75 63 | 74 69 6f 6e 73 2c 20 77 |l produc|tions, w|
|00002fb0| 65 27 6c 6c 20 62 72 65 | 61 6b 20 74 6f 20 67 69 |e'll bre|ak to gi|
|00002fc0| 76 65 20 74 68 65 0a 64 | 65 74 61 69 6c 65 64 20 |ve the.d|etailed |
|00002fd0| 73 79 6e 74 61 78 20 6f | 66 20 74 68 65 20 7b 53 |syntax o|f the {S|
|00002fe0| 70 69 64 65 72 7d 20 73 | 75 62 73 65 74 20 63 6f |pider} s|ubset co|
|00002ff0| 76 65 72 65 64 20 73 6f | 20 66 61 72 2e 0a 0a 0a |vered so| far....|
|00003000| 0a 5c 73 65 63 74 69 6f | 6e 7b 53 79 6e 74 61 78 |.\sectio|n{Syntax|
|00003010| 20 6f 66 20 7b 5c 74 74 | 20 73 70 69 64 65 72 7d | of {\tt| spider}|
|00003020| 20 66 69 6c 65 73 7d 0a | 0a 7b 53 70 69 64 65 72 | files}.|.{Spider|
|00003030| 7d 20 69 73 20 61 6e 20 | 41 77 6b 20 70 72 6f 67 |} is an |Awk prog|
|00003040| 72 61 6d 20 77 68 69 63 | 68 20 63 6f 6e 76 65 72 |ram whic|h conver|
|00003050| 74 73 20 61 20 64 65 73 | 63 72 69 70 74 69 6f 6e |ts a des|cription|
|00003060| 20 6f 66 20 61 0a 6c 61 | 6e 67 75 61 67 65 20 69 | of a.la|nguage i|
|00003070| 6e 74 6f 20 43 7e 63 6f | 64 65 20 66 6f 72 20 7b |nto C~co|de for {|
|00003080| 5c 74 74 20 57 45 41 56 | 45 7d 20 61 6e 64 20 7b |\tt WEAV|E} and {|
|00003090| 5c 74 74 20 54 41 4e 47 | 4c 45 7d 2e 0a 53 69 6e |\tt TANG|LE}..Sin|
|000030a0| 63 65 20 7b 53 70 69 64 | 65 72 7d 20 69 73 20 61 |ce {Spid|er} is a|
|000030b0| 6e 20 41 77 6b 20 70 72 | 6f 67 72 61 6d 2c 20 69 |n Awk pr|ogram, i|
|000030c0| 74 73 20 69 6e 70 75 74 | 20 69 73 20 61 20 73 65 |ts input| is a se|
|000030d0| 71 75 65 6e 63 65 20 6f | 66 0a 6c 69 6e 65 73 2c |quence o|f.lines,|
|000030e0| 20 61 6e 64 20 61 6c 6c | 20 7b 53 70 69 64 65 72 | and all| {Spider|
|000030f0| 7d 20 63 6f 6d 6d 61 6e | 64 73 20 6d 75 73 74 20 |} comman|ds must |
|00003100| 66 69 74 20 6f 6e 20 6f | 6e 65 20 6c 69 6e 65 2e |fit on o|ne line.|
|00003110| 0a 0a 5c 70 61 72 61 67 | 72 61 70 68 7b 43 6f 6d |..\parag|raph{Com|
|00003120| 6d 65 6e 74 73 20 61 6e | 64 20 62 6c 61 6e 6b 20 |ments an|d blank |
|00003130| 6c 69 6e 65 73 7d 0a 42 | 65 63 61 75 73 65 20 7b |lines}.B|ecause {|
|00003140| 5c 65 6d 20 61 6e 79 7d | 20 63 68 61 72 61 63 74 |\em any}| charact|
|00003150| 65 72 20 73 65 71 75 65 | 6e 63 65 20 63 61 6e 20 |er seque|nce can |
|00003160| 62 65 20 61 20 74 6f 6b | 65 6e 20 6f 66 20 61 20 |be a tok|en of a |
|00003170| 70 72 6f 67 72 61 6d 6d | 69 6e 67 0a 6c 61 6e 67 |programm|ing.lang|
|00003180| 75 61 67 65 2c 20 77 65 | 20 63 61 6e 27 74 20 6a |uage, we| can't j|
|00003190| 75 73 74 20 64 65 73 69 | 67 6e 61 74 65 20 61 20 |ust desi|gnate a |
|000031a0| 70 61 72 74 69 63 75 6c | 61 72 20 73 65 71 75 65 |particul|ar seque|
|000031b0| 6e 63 65 20 61 73 20 61 | 20 60 60 62 65 67 69 6e |nce as a| ``begin|
|000031c0| 0a 63 6f 6d 6d 65 6e 74 | 27 27 20 6d 61 72 6b 65 |.comment|'' marke|
|000031d0| 72 2e 0a 53 6f 20 69 6e | 20 7b 53 70 69 64 65 72 |r..So in| {Spider|
|000031e0| 7d 20 74 68 65 72 65 20 | 61 72 65 20 6e 6f 20 63 |} there |are no c|
|000031f0| 6f 6d 6d 65 6e 74 73 2c | 20 6f 6e 6c 79 20 7b 5c |omments,| only {\|
|00003200| 65 6d 20 63 6f 6d 6d 65 | 6e 74 20 6c 69 6e 65 73 |em comme|nt lines|
|00003210| 7d 2e 0a 41 20 63 6f 6d | 6d 65 6e 74 20 6c 69 6e |}..A com|ment lin|
|00003220| 65 20 69 73 20 6f 6e 65 | 20 77 68 6f 73 65 20 66 |e is one| whose f|
|00003230| 69 72 73 74 20 63 68 61 | 72 61 63 74 65 72 20 69 |irst cha|racter i|
|00003240| 73 20 60 60 7b 5c 74 74 | 20 5c 23 7d 27 27 2e 0a |s ``{\tt| \#}''..|
|00003250| 54 68 65 20 7b 53 70 69 | 64 65 72 7d 20 70 72 6f |The {Spi|der} pro|
|00003260| 63 65 73 73 6f 72 20 69 | 67 6e 6f 72 65 73 20 63 |cessor i|gnores c|
|00003270| 6f 6d 6d 65 6e 74 20 6c | 69 6e 65 73 20 61 6e 64 |omment l|ines and|
|00003280| 20 62 6c 61 6e 6b 20 6c | 69 6e 65 73 2e 0a 0a 5c | blank l|ines...\|
|00003290| 70 61 72 61 67 72 61 70 | 68 7b 46 69 65 6c 64 73 |paragrap|h{Fields|
|000032a0| 7d 0a 45 61 63 68 20 63 | 6f 6d 6d 61 6e 64 20 69 |}.Each c|ommand i|
|000032b0| 6e 20 74 68 65 20 7b 5c | 74 74 20 73 70 69 64 65 |n the {\|tt spide|
|000032c0| 72 7d 20 66 69 6c 65 20 | 63 6f 6e 73 69 73 74 73 |r} file |consists|
|000032d0| 20 6f 66 20 61 20 73 65 | 71 75 65 6e 63 65 20 6f | of a se|quence o|
|000032e0| 66 20 7b 5c 65 6d 0a 66 | 69 65 6c 64 73 7d 2e 0a |f {\em.f|ields}..|
|000032f0| 54 68 65 73 65 20 61 72 | 65 20 6a 75 73 74 20 74 |These ar|e just t|
|00003300| 68 65 20 41 77 6b 20 66 | 69 65 6c 64 73 2c 20 61 |he Awk f|ields, a|
|00003310| 6e 64 20 74 68 65 79 20 | 61 72 65 20 73 65 70 61 |nd they |are sepa|
|00003320| 72 61 74 65 64 20 62 79 | 20 77 68 69 74 65 20 73 |rated by| white s|
|00003330| 70 61 63 65 2e 0a 54 68 | 69 73 20 66 65 61 74 75 |pace..Th|is featu|
|00003340| 72 65 20 6f 66 20 7b 53 | 70 69 64 65 72 7d 20 28 |re of {S|pider} (|
|00003350| 69 6e 68 65 72 69 74 65 | 64 20 66 72 6f 6d 20 41 |inherite|d from A|
|00003360| 77 6b 29 20 66 6f 72 62 | 69 64 73 20 74 68 65 20 |wk) forb|ids the |
|00003370| 75 73 65 20 6f 66 0a 77 | 68 69 74 65 20 73 70 61 |use of.w|hite spa|
|00003380| 63 65 20 77 69 74 68 69 | 6e 20 61 20 66 69 65 6c |ce withi|n a fiel|
|00003390| 64 2e 0a 0a 5c 73 75 62 | 73 65 63 74 69 6f 6e 7b |d...\sub|section{|
|000033a0| 54 72 61 6e 73 6c 61 74 | 69 6f 6e 73 7d 0a 4d 6f |Translat|ions}.Mo|
|000033b0| 73 74 20 66 69 65 6c 64 | 73 20 69 6e 20 61 20 7b |st field|s in a {|
|000033c0| 53 70 69 64 65 72 7d 20 | 66 69 6c 65 20 61 72 65 |Spider} |file are|
|000033d0| 20 73 69 6d 70 6c 65 20 | 69 64 65 6e 74 69 66 69 | simple |identifi|
|000033e0| 65 72 73 2c 20 6f 72 20 | 70 65 72 68 61 70 73 0a |ers, or |perhaps.|
|000033f0| 73 74 72 69 6e 67 73 20 | 6f 66 20 6e 6f 6e 2d 61 |strings |of non-a|
|00003400| 6c 70 68 61 6e 75 6d 65 | 72 69 63 20 63 68 61 72 |lphanume|ric char|
|00003410| 61 63 74 65 72 73 2e 0a | 54 68 65 20 6d 61 6a 6f |acters..|The majo|
|00003420| 72 20 65 78 63 65 70 74 | 69 6f 6e 20 69 73 20 7b |r except|ion is {|
|00003430| 5c 65 6d 20 74 72 61 6e | 73 6c 61 74 69 6f 6e 73 |\em tran|slations|
|00003440| 7d 2e 0a 54 72 61 6e 73 | 6c 61 74 69 6f 6e 73 20 |}..Trans|lations |
|00003450| 61 72 65 20 61 6c 77 61 | 79 73 20 73 75 72 72 6f |are alwa|ys surro|
|00003460| 75 6e 64 65 64 20 62 79 | 20 61 6e 67 6c 65 20 62 |unded by| angle b|
|00003470| 72 61 63 6b 65 74 73 20 | 28 7b 5c 74 74 20 3c 3e |rackets |({\tt <>|
|00003480| 7d 29 2c 0a 61 6e 64 20 | 63 6f 6e 73 69 73 74 20 |}),.and |consist |
|00003490| 6f 66 20 61 20 28 70 6f | 73 73 69 62 6c 79 20 65 |of a (po|ssibly e|
|000034a0| 6d 70 74 79 29 20 6c 69 | 73 74 20 6f 66 20 74 72 |mpty) li|st of tr|
|000034b0| 61 6e 73 6c 61 74 69 6f | 6e 20 70 69 65 63 65 73 |anslatio|n pieces|
|000034c0| 2e 0a 54 68 65 20 70 69 | 65 63 65 73 20 6f 6e 20 |..The pi|eces on |
|000034d0| 61 20 6c 69 73 74 20 61 | 72 65 20 73 65 70 61 72 |a list a|re separ|
|000034e0| 61 74 65 64 20 62 79 20 | 64 61 73 68 65 73 20 28 |ated by |dashes (|
|000034f0| 7b 5c 74 74 20 2d 7d 29 | 2e 0a 41 20 70 69 65 63 |{\tt -})|..A piec|
|00003500| 65 20 69 73 20 6f 6e 65 | 20 6f 66 3a 0a 5c 62 65 |e is one| of:.\be|
|00003510| 67 69 6e 7b 69 74 65 6d | 69 7a 65 7d 0a 5c 69 74 |gin{item|ize}.\it|
|00003520| 65 6d 20 41 20 71 75 6f | 74 65 64 20 73 74 72 69 |em A quo|ted stri|
|00003530| 6e 67 2e 0a 54 68 69 73 | 20 73 74 72 69 6e 67 20 |ng..This| string |
|00003540| 6d 61 79 20 63 6f 6e 74 | 61 69 6e 20 65 6d 62 65 |may cont|ain embe|
|00003550| 64 64 65 64 20 71 75 6f | 74 65 73 20 65 73 63 61 |dded quo|tes esca|
|00003560| 70 65 64 20 62 79 20 60 | 60 5c 76 65 72 62 2b 5c |ped by `|`\verb+\|
|00003570| 2b 27 27 2c 20 62 75 74 | 0a 69 74 20 7b 5c 65 6d |+'', but|.it {\em|
|00003580| 20 6d 75 73 74 20 6e 6f | 74 7d 20 63 6f 6e 74 61 | must no|t} conta|
|00003590| 69 6e 20 65 6d 62 65 64 | 64 65 64 20 77 68 69 74 |in embed|ded whit|
|000035a0| 65 20 73 70 61 63 65 20 | 6f 72 20 61 6e 20 65 6d |e space |or an em|
|000035b0| 62 65 64 64 65 64 20 64 | 61 73 68 2e 0a 5c 69 74 |bedded d|ash..\it|
|000035c0| 65 6d 20 54 68 65 20 60 | 60 73 65 6c 66 27 27 20 |em The `|`self'' |
|000035d0| 6d 61 72 6b 65 72 2c 20 | 60 60 7b 5c 74 74 20 2a |marker, |``{\tt *|
|000035e0| 7d 27 27 2c 0a 20 72 65 | 66 65 72 73 20 74 6f 20 |}'',. re|fers to |
|000035f0| 74 68 65 20 73 65 71 75 | 65 6e 63 65 20 6f 66 20 |the sequ|ence of |
|00003600| 63 68 61 72 61 63 74 65 | 72 73 20 6d 61 6b 69 6e |characte|rs makin|
|00003610| 67 20 75 70 20 74 68 65 | 20 74 6f 6b 65 6e 20 62 |g up the| token b|
|00003620| 65 69 6e 67 0a 74 72 61 | 6e 73 6c 61 74 65 64 2e |eing.tra|nslated.|
|00003630| 0a 54 68 65 20 73 65 6c | 66 20 6d 61 72 6b 65 72 |.The sel|f marker|
|00003640| 20 69 73 20 70 65 72 6d | 69 74 74 65 64 20 6f 6e | is perm|itted on|
|00003650| 6c 79 20 69 6e 20 63 65 | 72 74 61 69 6e 20 63 6f |ly in ce|rtain co|
|00003660| 6e 74 65 78 74 73 2c 20 | 61 6e 64 20 69 74 73 20 |ntexts, |and its |
|00003670| 70 72 65 63 69 73 65 0a | 6d 65 61 6e 69 6e 67 20 |precise.|meaning |
|00003680| 64 65 70 65 6e 64 73 20 | 6f 6e 20 74 68 65 20 63 |depends |on the c|
|00003690| 6f 6e 74 65 78 74 2e 0a | 5c 69 74 65 6d 20 41 20 |ontext..|\item A |
|000036a0| 64 69 67 69 74 2e 0a 5c | 69 74 65 6d 20 41 20 6b |digit..\|item A k|
|000036b0| 65 79 20 77 6f 72 64 2e | 0a 54 68 65 20 6b 65 79 |ey word.|.The key|
|000036c0| 20 77 6f 72 64 73 20 6b | 6e 6f 77 6e 20 74 6f 20 | words k|nown to |
|000036d0| 7b 53 70 69 64 65 72 7d | 20 61 72 65 0a 5c 62 65 |{Spider}| are.\be|
|000036e0| 67 69 6e 7b 64 65 73 63 | 72 69 70 74 69 6f 6e 7d |gin{desc|ription}|
|000036f0| 20 0a 5c 69 74 65 6d 20 | 5b 5c 74 74 20 73 70 61 | .\item |[\tt spa|
|00003700| 63 65 5d 20 53 74 61 6e | 64 73 20 66 6f 72 20 6f |ce] Stan|ds for o|
|00003710| 6e 65 20 73 70 61 63 65 | 20 28 7b 5c 74 74 20 22 |ne space| ({\tt "|
|00003720| 5c 20 22 7d 29 2e 0a 5c | 69 74 65 6d 5b 5c 74 74 |\ "})..\|item[\tt|
|00003730| 20 64 61 73 68 5d 20 53 | 74 61 6e 64 73 20 66 6f | dash] S|tands fo|
|00003740| 72 20 61 20 64 61 73 68 | 20 28 7b 5c 74 74 20 22 |r a dash| ({\tt "|
|00003750| 2d 22 7d 29 2e 0a 5c 65 | 6e 64 7b 64 65 73 63 72 |-"})..\e|nd{descr|
|00003760| 69 70 74 69 6f 6e 7d 0a | 54 68 65 20 6f 74 68 65 |iption}.|The othe|
|00003770| 72 20 6b 65 79 20 77 6f | 72 64 73 20 61 72 65 20 |r key wo|rds are |
|00003780| 70 61 73 73 65 64 20 6f | 6e 20 74 6f 20 7b 5c 74 |passed o|n to {\t|
|00003790| 74 20 57 45 41 56 45 7d | 2e 0a 0a 7b 5c 74 74 20 |t WEAVE}|...{\tt |
|000037a0| 57 45 41 56 45 7d 20 72 | 65 63 6f 67 6e 69 7a 65 |WEAVE} r|ecognize|
|000037b0| 73 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |s the fo|llowing |
|000037c0| 6b 65 79 20 77 6f 72 64 | 73 3a 0a 5c 62 65 67 69 |key word|s:.\begi|
|000037d0| 6e 7b 64 65 73 63 72 69 | 70 74 69 6f 6e 7d 0a 5c |n{descri|ption}.\|
|000037e0| 69 74 65 6d 5b 5c 74 74 | 20 62 72 65 61 6b 5c 5f |item[\tt| break\_|
|000037f0| 73 70 61 63 65 5d 20 64 | 65 6e 6f 74 65 73 20 61 |space] d|enotes a|
|00003800| 6e 20 6f 70 74 69 6f 6e | 61 6c 20 6c 69 6e 65 20 |n option|al line |
|00003810| 62 72 65 61 6b 20 6f 72 | 20 61 6e 20 65 6e 20 73 |break or| an en s|
|00003820| 70 61 63 65 3b 0a 5c 69 | 74 65 6d 5b 5c 74 74 20 |pace;.\i|tem[\tt |
|00003830| 66 6f 72 63 65 5d 20 64 | 65 6e 6f 74 65 73 20 61 |force] d|enotes a|
|00003840| 20 6c 69 6e 65 20 62 72 | 65 61 6b 3b 0a 5c 69 74 | line br|eak;.\it|
|00003850| 65 6d 5b 5c 74 74 20 62 | 69 67 5c 5f 66 6f 72 63 |em[\tt b|ig\_forc|
|00003860| 65 5d 20 64 65 6e 6f 74 | 65 73 20 61 20 6c 69 6e |e] denot|es a lin|
|00003870| 65 20 62 72 65 61 6b 20 | 77 69 74 68 20 61 64 64 |e break |with add|
|00003880| 69 74 69 6f 6e 61 6c 20 | 76 65 72 74 69 63 61 6c |itional |vertical|
|00003890| 20 73 70 61 63 65 3b 0a | 5c 69 74 65 6d 5b 5c 74 | space;.|\item[\t|
|000038a0| 74 20 6f 70 74 5d 20 64 | 65 6e 6f 74 65 73 20 61 |t opt] d|enotes a|
|000038b0| 6e 20 6f 70 74 69 6f 6e | 61 6c 20 6c 69 6e 65 20 |n option|al line |
|000038c0| 62 72 65 61 6b 20 28 77 | 69 74 68 20 74 68 65 20 |break (w|ith the |
|000038d0| 63 6f 6e 74 69 6e 75 61 | 74 69 6f 6e 0a 6c 69 6e |continua|tion.lin|
|000038e0| 65 20 69 6e 64 65 6e 74 | 65 64 20 74 77 6f 20 65 |e indent|ed two e|
|000038f0| 6d 73 20 77 69 74 68 20 | 72 65 73 70 65 63 74 20 |ms with |respect |
|00003900| 74 6f 20 74 68 65 20 6e | 6f 72 6d 61 6c 20 73 74 |to the n|ormal st|
|00003910| 61 72 74 69 6e 67 20 70 | 6f 73 69 74 69 6f 6e 29 |arting p|osition)|
|00003920| 2d 2d 2d 74 68 69 73 0a | 63 6f 64 65 20 69 73 20 |---this.|code is |
|00003930| 66 6f 6c 6c 6f 77 65 64 | 20 62 79 20 61 6e 20 69 |followed| by an i|
|00003940| 6e 74 65 67 65 72 20 24 | 6e 24 2c 20 61 6e 64 20 |nteger $|n$, and |
|00003950| 74 68 65 20 62 72 65 61 | 6b 20 77 69 6c 6c 20 6f |the brea|k will o|
|00003960| 63 63 75 72 20 77 69 74 | 68 20 70 65 6e 61 6c 74 |ccur wit|h penalt|
|00003970| 79 0a 24 31 30 6e 24 3b | 0a 5c 69 74 65 6d 5b 5c |y.$10n$;|.\item[\|
|00003980| 74 74 20 62 61 63 6b 75 | 70 5d 20 64 65 6e 6f 74 |tt backu|p] denot|
|00003990| 65 73 20 61 20 62 61 63 | 6b 73 70 61 63 65 20 6f |es a bac|kspace o|
|000039a0| 66 20 6f 6e 65 20 65 6d | 3b 0a 5c 69 74 65 6d 5b |f one em|;.\item[|
|000039b0| 5c 74 74 20 63 61 6e 63 | 65 6c 5d 20 6f 62 6c 69 |\tt canc|el] obli|
|000039c0| 74 65 72 61 74 65 73 20 | 61 6e 79 20 7b 5c 74 74 |terates |any {\tt|
|000039d0| 20 62 72 65 61 6b 5c 5f | 73 70 61 63 65 7d 20 6f | break\_|space} o|
|000039e0| 72 20 7b 5c 74 74 20 66 | 6f 72 63 65 7d 20 6f 72 |r {\tt f|orce} or|
|000039f0| 0a 7b 5c 74 74 20 62 69 | 67 5c 5f 66 6f 72 63 65 |.{\tt bi|g\_force|
|00003a00| 7d 20 0a 74 6f 6b 65 6e | 73 20 74 68 61 74 20 69 |} .token|s that i|
|00003a10| 6d 6d 65 64 69 61 74 65 | 6c 79 20 70 72 65 63 65 |mmediate|ly prece|
|00003a20| 64 65 20 6f 72 20 66 6f | 6c 6c 6f 77 20 69 74 20 |de or fo|llow it |
|00003a30| 61 6e 64 20 61 6c 73 6f | 20 63 61 6e 63 65 6c 73 |and also| cancels|
|00003a40| 20 61 6e 79 0a 7b 5c 74 | 74 20 62 61 63 6b 75 70 | any.{\t|t backup|
|00003a50| 7d 20 74 6f 6b 65 6e 73 | 20 74 68 61 74 20 66 6f |} tokens| that fo|
|00003a60| 6c 6c 6f 77 20 69 74 3b | 0a 5c 69 74 65 6d 5b 5c |llow it;|.\item[\|
|00003a70| 74 74 20 69 6e 64 65 6e | 74 5d 20 63 61 75 73 65 |tt inden|t] cause|
|00003a80| 73 20 66 75 74 75 72 65 | 20 6c 69 6e 65 73 20 74 |s future| lines t|
|00003a90| 6f 20 62 65 20 69 6e 64 | 65 6e 74 65 64 20 6f 6e |o be ind|ented on|
|00003aa0| 65 20 6d 6f 72 65 20 65 | 6d 3b 0a 5c 69 74 65 6d |e more e|m;.\item|
|00003ab0| 5b 5c 74 74 20 6f 75 74 | 64 65 6e 74 5d 20 63 61 |[\tt out|dent] ca|
|00003ac0| 75 73 65 73 20 66 75 74 | 75 72 65 20 6c 69 6e 65 |uses fut|ure line|
|00003ad0| 73 20 74 6f 20 62 65 20 | 69 6e 64 65 6e 74 65 64 |s to be |indented|
|00003ae0| 20 6f 6e 65 20 6c 65 73 | 73 20 65 6d 2e 0a 5c 69 | one les|s em..\i|
|00003af0| 74 65 6d 5b 5c 74 74 20 | 6d 61 74 68 5c 5f 72 65 |tem[\tt |math\_re|
|00003b00| 6c 5d 20 74 72 61 6e 73 | 6c 61 74 65 73 20 74 6f |l] trans|lates to|
|00003b10| 20 5c 76 65 72 62 2b 5c | 6d 61 74 68 72 65 6c 7b | \verb+\|mathrel{|
|00003b20| 2b 0a 5c 69 74 65 6d 5b | 5c 74 74 20 6d 61 74 68 |+.\item[|\tt math|
|00003b30| 5c 5f 62 69 6e 5d 74 72 | 61 6e 73 6c 61 74 65 73 |\_bin]tr|anslates|
|00003b40| 20 74 6f 20 5c 76 65 72 | 62 2b 5c 6d 61 74 68 62 | to \ver|b+\mathb|
|00003b50| 69 6e 7b 2b 0a 5c 69 74 | 65 6d 5b 5c 74 74 20 6d |in{+.\it|em[\tt m|
|00003b60| 61 74 68 5c 5f 6f 70 5d | 20 74 72 61 6e 73 6c 61 |ath\_op]| transla|
|00003b70| 74 65 73 20 74 6f 20 5c | 76 65 72 62 2b 5c 6d 61 |tes to \|verb+\ma|
|00003b80| 74 68 6f 70 7b 2b 0a 5c | 65 6e 64 7b 64 65 73 63 |thop{+.\|end{desc|
|00003b90| 72 69 70 74 69 6f 6e 7d | 0a 54 68 65 20 7b 5c 65 |ription}|.The {\e|
|00003ba0| 6d 20 6f 6e 6c 79 7d 20 | 6b 65 79 20 77 6f 72 64 |m only} |key word|
|00003bb0| 73 20 74 68 61 74 20 77 | 69 6c 6c 20 77 6f 72 6b |s that w|ill work|
|00003bc0| 20 70 72 6f 70 65 72 6c | 79 20 69 6e 20 6d 61 74 | properl|y in mat|
|00003bd0| 68 20 6d 6f 64 65 20 61 | 72 65 20 7b 5c 74 74 0a |h mode a|re {\tt.|
|00003be0| 69 6e 64 65 6e 74 7d 20 | 61 6e 64 20 7b 5c 74 74 |indent} |and {\tt|
|00003bf0| 20 6f 75 74 64 65 6e 74 | 7d 2c 20 73 6f 20 77 68 | outdent|}, so wh|
|00003c00| 65 6e 20 79 6f 75 27 72 | 65 20 64 65 66 69 6e 69 |en you'r|e defini|
|00003c10| 6e 67 20 74 68 65 20 74 | 72 61 6e 73 6c 61 74 69 |ng the t|ranslati|
|00003c20| 6f 6e 73 20 6f 66 0a 74 | 6f 6b 65 6e 73 20 79 6f |ons of.t|okens yo|
|00003c30| 75 20 6d 75 73 74 20 75 | 73 65 20 7b 5c 74 74 20 |u must u|se {\tt |
|00003c40| 6d 61 74 68 6e 65 73 73 | 7e 6e 6f 7d 20 69 66 20 |mathness|~no} if |
|00003c50| 79 6f 75 72 20 74 72 61 | 6e 73 6c 61 74 69 6f 6e |your tra|nslation|
|00003c60| 73 20 63 6f 6e 74 61 69 | 6e 0a 6f 74 68 65 72 20 |s contai|n.other |
|00003c70| 6b 65 79 20 77 6f 72 64 | 73 2e 0a 59 6f 75 20 6d |key word|s..You m|
|00003c80| 61 79 20 75 73 65 20 61 | 6e 79 20 72 65 63 6f 67 |ay use a|ny recog|
|00003c90| 6e 69 7a 65 64 20 6b 65 | 79 20 77 6f 72 64 73 20 |nized ke|y words |
|00003ca0| 69 6e 20 74 68 65 20 74 | 72 61 6e 73 6c 61 74 69 |in the t|ranslati|
|00003cb0| 6f 6e 73 20 6f 66 20 61 | 0a 70 72 6f 64 75 63 74 |ons of a|.product|
|00003cc0| 69 6f 6e 3b 20 74 68 65 | 72 65 20 74 68 65 20 6d |ion; the|re the m|
|00003cd0| 61 74 68 6e 65 73 73 20 | 69 73 20 61 75 74 6f 6d |athness |is autom|
|00003ce0| 61 74 69 63 61 6c 6c 79 | 20 74 61 6b 65 6e 20 63 |atically| taken c|
|00003cf0| 61 72 65 20 6f 66 20 66 | 6f 72 20 79 6f 75 2e 0a |are of f|or you..|
|00003d00| 5c 65 6e 64 7b 69 74 65 | 6d 69 7a 65 7d 0a 0a 48 |\end{ite|mize}..H|
|00003d10| 65 72 65 20 61 72 65 20 | 73 6f 6d 65 20 65 78 61 |ere are |some exa|
|00003d20| 6d 70 6c 65 20 74 72 61 | 6e 73 6c 61 74 69 6f 6e |mple tra|nslation|
|00003d30| 73 3a 0a 5c 62 65 67 69 | 6e 7b 76 65 72 62 61 74 |s:.\begi|n{verbat|
|00003d40| 69 6d 7d 0a 3c 22 5c 5c | 22 2d 73 70 61 63 65 3e |im}.<"\\|"-space>|
|00003d50| 0a 3c 69 6e 64 65 6e 74 | 2d 66 6f 72 63 65 3e 0a |.<indent|-force>.|
|00003d60| 3c 22 7b 5c 5c 6c 65 74 | 5c 5c 5c 5c 3d 5c 5c 62 |<"{\\let|\\\\=\\b|
|00003d70| 66 22 2d 73 70 61 63 65 | 3e 0a 3c 22 7d 22 2d 69 |f"-space|>.<"}"-i|
|00003d80| 6e 64 65 6e 74 2d 22 7b | 7d 22 2d 73 70 61 63 65 |ndent-"{|}"-space|
|00003d90| 3e 0a 5c 65 6e 64 7b 76 | 65 72 62 61 74 69 6d 7d |>.\end{v|erbatim}|
|00003da0| 0a 0a 5c 70 61 72 61 67 | 72 61 70 68 7b 52 65 73 |..\parag|raph{Res|
|00003db0| 74 72 69 63 74 65 64 20 | 74 72 61 6e 73 6c 61 74 |tricted |translat|
|00003dc0| 69 6f 6e 73 7d 0a 49 6e | 20 73 6f 6d 65 20 63 61 |ions}.In| some ca|
|00003dd0| 73 65 73 2c 20 6e 6f 74 | 61 62 6c 79 20 66 6f 72 |ses, not|ably for|
|00003de0| 20 61 20 7b 5c 74 74 20 | 74 61 6e 67 6c 65 74 6f | a {\tt |tangleto|
|00003df0| 7d 20 64 65 73 63 72 69 | 70 74 69 6f 6e 2c 20 74 |} descri|ption, t|
|00003e00| 72 61 6e 73 6c 61 74 69 | 6f 6e 73 0a 61 72 65 20 |ranslati|ons.are |
|00003e10| 7b 5c 65 6d 20 72 65 73 | 74 72 69 63 74 65 64 7d |{\em res|tricted}|
|00003e20| 2e 0a 41 20 72 65 73 74 | 72 69 63 74 65 64 20 74 |..A rest|ricted t|
|00003e30| 72 61 6e 73 6c 61 74 69 | 6f 6e 20 69 73 20 6e 65 |ranslati|on is ne|
|00003e40| 76 65 72 20 63 6f 6e 76 | 65 72 74 65 64 20 74 6f |ver conv|erted to|
|00003e50| 20 74 79 70 65 73 65 74 | 74 69 6e 67 20 63 6f 64 | typeset|ting cod|
|00003e60| 65 2c 0a 62 75 74 20 69 | 73 20 61 6c 77 61 79 73 |e,.but i|s always|
|00003e70| 20 63 6f 6e 76 65 72 74 | 65 64 20 74 6f 20 61 6e | convert|ed to an|
|00003e80| 20 41 53 43 49 49 20 73 | 74 72 69 6e 67 2c 20 75 | ASCII s|tring, u|
|00003e90| 73 75 61 6c 6c 79 20 66 | 6f 72 20 6f 75 74 70 75 |sually f|or outpu|
|00003ea0| 74 20 62 79 20 7b 5c 74 | 74 0a 54 41 4e 47 4c 45 |t by {\t|t.TANGLE|
|00003eb0| 7d 2c 20 62 75 74 20 73 | 6f 6d 65 74 69 6d 65 73 |}, but s|ometimes|
|00003ec0| 20 66 6f 72 20 6f 74 68 | 65 72 20 74 68 69 6e 67 | for oth|er thing|
|00003ed0| 73 2e 0a 41 20 72 65 73 | 74 72 69 63 74 65 64 20 |s..A res|tricted |
|00003ee0| 74 72 61 6e 73 6c 61 74 | 69 6f 6e 20 6d 61 79 20 |translat|ion may |
|00003ef0| 63 6f 6e 74 61 69 6e 20 | 6f 6e 6c 79 20 7b 5c 65 |contain |only {\e|
|00003f00| 6d 20 71 75 6f 74 65 64 | 20 73 74 72 69 6e 67 73 |m quoted| strings|
|00003f10| 7d 20 61 6e 64 20 74 68 | 65 0a 6b 65 79 77 6f 72 |} and th|e.keywor|
|00003f20| 64 73 20 7b 5c 74 74 20 | 73 70 61 63 65 7d 20 61 |ds {\tt |space} a|
|00003f30| 6e 64 20 7b 5c 74 74 20 | 64 61 73 68 7d 2e 0a 0a |nd {\tt |dash}...|
|00003f40| 0a 5c 73 75 62 73 65 63 | 74 69 6f 6e 7b 7b 5c 74 |.\subsec|tion{{\t|
|00003f50| 74 20 74 6f 6b 65 6e 7d | 20 63 6f 6d 6d 61 6e 64 |t token}| command|
|00003f60| 73 7d 0a 54 68 65 20 73 | 79 6e 74 61 78 20 6f 66 |s}.The s|yntax of|
|00003f70| 20 74 68 65 20 7b 5c 74 | 74 20 74 6f 6b 65 6e 7d | the {\t|t token}|
|00003f80| 20 63 6f 6d 6d 61 6e 64 | 20 69 73 3a 0a 5c 62 65 | command| is:.\be|
|00003f90| 67 69 6e 7b 71 75 6f 74 | 65 7d 0a 5c 74 74 20 20 |gin{quot|e}.\tt |
|00003fa0| 0a 5c 73 79 6e 74 61 78 | 7b 63 6f 6d 6d 61 6e 64 |.\syntax|{command|
|00003fb0| 7d 20 5c 70 72 6f 64 75 | 63 65 73 7e 74 6f 6b 65 |} \produ|ces~toke|
|00003fc0| 6e 20 5c 73 79 6e 74 61 | 78 7b 74 6f 6b 65 6e 2d |n \synta|x{token-|
|00003fd0| 64 65 73 69 67 6e 61 74 | 6f 72 7d 0a 5c 73 79 6e |designat|or}.\syn|
|00003fe0| 74 61 78 7b 74 6f 6b 65 | 6e 2d 64 65 73 63 72 69 |tax{toke|n-descri|
|00003ff0| 70 74 69 6f 6e 73 7d 0a | 5c 65 6e 64 7b 71 75 6f |ptions}.|\end{quo|
|00004000| 74 65 7d 0a 57 68 65 72 | 65 20 5c 73 79 6e 74 61 |te}.Wher|e \synta|
|00004010| 78 7b 74 6f 6b 65 6e 2d | 64 65 73 63 72 69 70 74 |x{token-|descript|
|00004020| 69 6f 6e 73 7d 20 69 73 | 20 61 20 28 70 6f 73 73 |ions} is| a (poss|
|00004030| 69 62 6c 79 20 65 6d 70 | 74 79 29 20 6c 69 73 74 |ibly emp|ty) list|
|00004040| 20 6f 66 20 74 6f 6b 65 | 6e 0a 64 65 73 63 72 69 | of toke|n.descri|
|00004050| 70 74 69 6f 6e 73 2e 0a | 0a 5c 70 61 72 61 67 72 |ptions..|.\paragr|
|00004060| 61 70 68 7b 54 6f 6b 65 | 6e 20 64 65 73 63 72 69 |aph{Toke|n descri|
|00004070| 70 74 69 6f 6e 73 7d 0a | 54 68 65 20 74 6f 6b 65 |ptions}.|The toke|
|00004080| 6e 20 64 65 73 63 72 69 | 70 74 69 6f 6e 73 20 61 |n descri|ptions a|
|00004090| 72 65 0a 5c 62 65 67 69 | 6e 7b 69 74 65 6d 69 7a |re.\begi|n{itemiz|
|000040a0| 65 7d 5c 70 61 72 69 6e | 64 65 6e 74 3d 30 70 74 |e}\parin|dent=0pt|
|000040b0| 0a 5c 69 74 65 6d 0a 7b | 5c 74 74 20 74 61 6e 67 |.\item.{|\tt tang|
|000040c0| 6c 65 74 6f 20 5c 73 79 | 6e 74 61 78 7b 72 65 73 |leto \sy|ntax{res|
|000040d0| 74 72 69 63 74 65 64 20 | 74 72 61 6e 73 6c 61 74 |tricted |translat|
|000040e0| 69 6f 6e 7d 7d 0a 0a 54 | 68 65 20 5c 73 79 6e 74 |ion}}..T|he \synt|
|000040f0| 61 78 7b 72 65 73 74 72 | 69 63 74 65 64 20 74 72 |ax{restr|icted tr|
|00004100| 61 6e 73 6c 61 74 69 6f | 6e 7d 20 74 65 6c 6c 73 |anslatio|n} tells|
|00004110| 20 7b 5c 74 74 20 54 41 | 4e 47 4c 45 7d 20 77 68 | {\tt TA|NGLE} wh|
|00004120| 61 74 20 70 72 6f 67 72 | 61 6d 0a 74 65 78 74 20 |at progr|am.text |
|00004130| 74 6f 20 77 72 69 74 65 | 20 6f 75 74 20 66 6f 72 |to write| out for|
|00004140| 20 74 68 69 73 20 74 6f | 6b 65 6e 2e 0a 54 68 65 | this to|ken..The|
|00004150| 20 6f 6e 6c 79 20 6b 69 | 6e 64 73 20 6f 66 20 74 | only ki|nds of t|
|00004160| 72 61 6e 73 6c 61 74 69 | 6f 6e 20 70 69 65 63 65 |ranslati|on piece|
|00004170| 73 20 76 61 6c 69 64 20 | 69 6e 20 61 20 72 65 73 |s valid |in a res|
|00004180| 74 72 69 63 74 65 64 20 | 74 72 61 6e 73 6c 61 74 |tricted |translat|
|00004190| 69 6f 6e 0a 61 72 65 20 | 71 75 6f 74 65 64 20 73 |ion.are |quoted s|
|000041a0| 74 72 69 6e 67 73 20 61 | 6e 64 20 74 68 65 20 73 |trings a|nd the s|
|000041b0| 70 65 63 69 61 6c 20 77 | 6f 72 64 73 20 7b 5c 74 |pecial w|ords {\t|
|000041c0| 74 20 73 70 61 63 65 7d | 20 61 6e 64 20 7b 5c 74 |t space}| and {\t|
|000041d0| 74 20 64 61 73 68 7d 2e | 0a 49 66 20 6e 6f 20 7b |t dash}.|.If no {|
|000041e0| 5c 74 74 20 74 61 6e 67 | 6c 65 74 6f 7d 20 64 65 |\tt tang|leto} de|
|000041f0| 73 63 72 69 70 74 69 6f | 6e 20 69 73 20 70 72 65 |scriptio|n is pre|
|00004200| 73 65 6e 74 2c 20 7b 5c | 74 74 20 54 41 4e 47 4c |sent, {\|tt TANGL|
|00004210| 45 7d 20 6a 75 73 74 20 | 77 72 69 74 65 73 0a 6f |E} just |writes.o|
|00004220| 75 74 20 74 68 65 20 73 | 65 71 75 65 6e 63 65 20 |ut the s|equence |
|00004230| 6f 66 20 63 68 61 72 61 | 63 74 65 72 73 20 74 68 |of chara|cters th|
|00004240| 61 74 20 63 6f 6e 73 74 | 69 74 75 74 65 20 74 68 |at const|itute th|
|00004250| 65 20 74 6f 6b 65 6e 2e | 0a 0a 5c 69 74 65 6d 0a |e token.|..\item.|
|00004260| 7b 5c 74 74 20 74 72 61 | 6e 73 6c 61 74 69 6f 6e |{\tt tra|nslation|
|00004270| 20 5c 73 79 6e 74 61 78 | 7b 74 72 61 6e 73 6c 61 | \syntax|{transla|
|00004280| 74 69 6f 6e 7d 7d 0a 0a | 54 65 6c 6c 73 20 7b 5c |tion}}..|Tells {\|
|00004290| 74 74 20 57 45 41 56 45 | 7d 20 77 68 61 74 20 74 |tt WEAVE|} what t|
|000042a0| 72 61 6e 73 6c 61 74 69 | 6f 6e 20 74 6f 20 61 73 |ranslati|on to as|
|000042b0| 73 69 67 6e 20 77 68 65 | 6e 20 6d 61 6b 69 6e 67 |sign whe|n making|
|000042c0| 20 74 68 69 73 20 74 6f | 6b 65 6e 20 69 6e 74 6f | this to|ken into|
|000042d0| 0a 61 20 73 63 72 61 70 | 2e 0a 54 68 65 20 73 65 |.a scrap|..The se|
|000042e0| 6c 66 0a 6d 61 72 6b 65 | 72 7e 28 7b 5c 74 74 2a |lf.marke|r~({\tt*|
|000042f0| 7d 29 20 73 74 61 6e 64 | 73 20 66 6f 72 20 74 68 |}) stand|s for th|
|00004300| 65 20 73 65 71 75 65 6e | 63 65 20 6f 66 20 63 68 |e sequen|ce of ch|
|00004310| 61 72 61 63 74 65 72 73 | 20 74 68 61 74 20 77 65 |aracters| that we|
|00004320| 72 65 20 72 65 61 64 20 | 69 6e 20 74 6f 0a 6d 61 |re read |in to.ma|
|00004330| 6b 65 20 75 70 20 74 68 | 65 20 74 6f 6b 65 6e 2e |ke up th|e token.|
|00004340| 0a 54 68 65 20 74 72 61 | 6e 73 6c 61 74 69 6f 6e |.The tra|nslation|
|00004350| 20 6f 66 74 65 6e 20 64 | 65 66 61 75 6c 74 73 20 | often d|efaults |
|00004360| 74 6f 20 5c 76 65 72 62 | 2b 74 72 61 6e 73 6c 61 |to \verb|+transla|
|00004370| 74 69 6f 6e 20 3c 2a 3e | 2b 3b 20 7b 53 70 69 64 |tion <*>|+; {Spid|
|00004380| 65 72 7d 0a 69 73 20 73 | 65 74 20 75 70 20 74 6f |er}.is s|et up to|
|00004390| 20 68 61 76 65 20 74 68 | 69 73 20 64 65 66 61 75 | have th|is defau|
|000043a0| 6c 74 20 69 6e 69 74 69 | 61 6c 6c 79 2e 0a 0a 5c |lt initi|ally...\|
|000043b0| 69 74 65 6d 0a 7b 5c 74 | 74 20 63 61 74 65 67 6f |item.{\t|t catego|
|000043c0| 72 79 20 5c 73 79 6e 74 | 61 78 7b 63 61 74 65 67 |ry \synt|ax{categ|
|000043d0| 6f 72 79 2d 6e 61 6d 65 | 7d 7d 0a 0a 54 65 6c 6c |ory-name|}}..Tell|
|000043e0| 73 20 7b 5c 74 74 20 57 | 45 41 56 45 7d 20 20 77 |s {\tt W|EAVE} w|
|000043f0| 68 61 74 20 63 61 74 65 | 67 6f 72 79 20 74 6f 20 |hat cate|gory to |
|00004400| 61 73 73 69 67 6e 20 77 | 68 65 6e 20 6d 61 6b 69 |assign w|hen maki|
|00004410| 6e 67 20 74 68 69 73 20 | 74 6f 6b 65 6e 20 69 6e |ng this |token in|
|00004420| 74 6f 0a 61 20 73 63 72 | 61 70 2e 0a 49 66 20 79 |to.a scr|ap..If y|
|00004430| 6f 75 27 72 65 20 77 72 | 69 74 69 6e 67 20 61 20 |ou're wr|iting a |
|00004440| 7b 53 70 69 64 65 72 7d | 20 66 69 6c 65 2c 20 79 |{Spider}| file, y|
|00004450| 6f 75 20 6d 61 79 20 63 | 68 6f 6f 73 65 20 61 6e |ou may c|hoose an|
|00004460| 79 20 63 61 74 65 67 6f | 72 79 0a 6e 61 6d 65 73 |y catego|ry.names|
|00004470| 20 79 6f 75 20 6c 69 6b | 65 2c 20 73 75 62 6a 65 | you lik|e, subje|
|00004480| 63 74 20 6f 6e 6c 79 20 | 74 6f 20 74 68 65 20 72 |ct only |to the r|
|00004490| 65 73 74 72 69 63 74 69 | 6f 6e 20 74 68 61 74 20 |estricti|on that |
|000044a0| 74 68 65 79 20 6e 6f 74 | 20 63 6f 6e 66 6c 69 63 |they not| conflic|
|000044b0| 74 0a 77 69 74 68 20 6f | 74 68 65 72 20 6e 61 6d |t.with o|ther nam|
|000044c0| 65 73 20 20 6b 6e 6f 77 | 6e 20 74 6f 20 7b 53 70 |es know|n to {Sp|
|000044d0| 69 64 65 72 7d 20 28 65 | 2e 67 2e 7e 70 72 65 64 |ider} (e|.g.~pred|
|000044e0| 65 66 69 6e 65 64 20 6b | 65 79 20 77 6f 72 64 73 |efined k|ey words|
|000044f0| 2c 0a 6e 61 6d 65 73 20 | 6f 66 20 69 6c 6b 73 2c |,.names |of ilks,|
|00004500| 20 61 6e 64 20 73 6f 20 | 6f 6e 29 2e 0a 55 73 69 | and so |on)..Usi|
|00004510| 6e 67 20 63 61 74 65 67 | 6f 72 79 20 6e 61 6d 65 |ng categ|ory name|
|00004520| 73 20 74 68 61 74 20 61 | 72 65 20 69 64 65 6e 74 |s that a|re ident|
|00004530| 69 63 61 6c 20 74 6f 20 | 72 65 73 65 72 76 65 64 |ical to |reserved|
|00004540| 20 77 6f 72 64 73 20 6f | 66 20 74 68 65 0a 74 61 | words o|f the.ta|
|00004550| 72 67 65 74 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 |rget pro|gramming|
|00004560| 20 6c 61 6e 67 75 61 67 | 65 20 28 6f 72 20 72 65 | languag|e (or re|
|00004570| 73 65 72 76 65 64 20 77 | 6f 72 64 73 20 6f 66 7e |served w|ords of~|
|00004580| 43 29 20 69 73 20 6e 6f | 74 20 6f 6e 6c 79 0a 73 |C) is no|t only.s|
|00004590| 75 70 70 6f 72 74 65 64 | 2c 20 69 74 20 69 73 20 |upported|, it is |
|000045a0| 73 74 72 6f 6e 67 6c 79 | 20 65 6e 63 6f 75 72 61 |strongly| encoura|
|000045b0| 67 65 64 2c 20 66 6f 72 | 20 63 6c 61 72 69 74 79 |ged, for| clarity|
|000045c0| 2e 0a 41 6c 73 6f 2c 20 | 77 68 65 6e 20 77 65 20 |..Also, |when we |
|000045d0| 67 65 74 20 74 6f 20 74 | 68 65 20 73 61 6d 70 6c |get to t|he sampl|
|000045e0| 65 20 67 72 61 6d 6d 61 | 72 73 20 6c 61 74 65 72 |e gramma|rs later|
|000045f0| 20 6f 6e 2c 20 79 6f 75 | 20 77 69 6c 6c 20 73 65 | on, you| will se|
|00004600| 65 20 73 6f 6d 65 0a 6f | 74 68 65 72 20 63 6f 6e |e some.o|ther con|
|00004610| 76 65 6e 74 69 6f 6e 73 | 20 77 65 20 75 73 65 20 |ventions| we use |
|00004620| 66 6f 72 20 63 61 74 65 | 67 6f 72 79 20 6e 61 6d |for cate|gory nam|
|00004630| 65 73 2e 0a 0a 5c 69 74 | 65 6d 0a 7b 5c 74 74 20 |es...\it|em.{\tt |
|00004640| 6d 61 74 68 6e 65 73 73 | 20 5c 73 79 6e 74 61 78 |mathness| \syntax|
|00004650| 7b 6d 61 74 68 6e 65 73 | 73 2d 69 6e 64 69 63 61 |{mathnes|s-indica|
|00004660| 74 6f 72 7d 7d 0a 0a 77 | 68 65 72 65 20 20 5c 73 |tor}}..w|here \s|
|00004670| 79 6e 74 61 78 7b 6d 61 | 74 68 6e 65 73 73 2d 69 |yntax{ma|thness-i|
|00004680| 6e 64 69 63 61 74 6f 72 | 7d 20 69 73 20 7b 5c 74 |ndicator|} is {\t|
|00004690| 74 20 79 65 73 7d 2c 20 | 7b 5c 74 74 20 6e 6f 7d |t yes}, |{\tt no}|
|000046a0| 2c 20 6f 72 20 7b 5c 74 | 74 0a 6d 61 79 62 65 7d |, or {\t|t.maybe}|
|000046b0| 2e 0a 54 68 69 73 20 69 | 6e 64 69 63 61 74 65 73 |..This i|ndicates|
|000046c0| 20 74 6f 20 7b 5c 74 74 | 20 57 45 41 56 45 7d 20 | to {\tt| WEAVE} |
|000046d0| 77 68 65 74 68 65 72 20 | 74 68 65 20 74 72 61 6e |whether |the tran|
|000046e0| 73 6c 61 74 69 6f 6e 20 | 66 6f 72 20 74 68 69 73 |slation |for this|
|000046f0| 20 74 6f 6b 65 6e 0a 6e | 65 65 64 73 20 74 6f 20 | token.n|eeds to |
|00004700| 62 65 20 74 79 70 65 73 | 65 74 20 69 6e 20 7b 5c |be types|et in {\|
|00004710| 54 65 58 7d 27 73 20 6d | 61 74 68 20 6d 6f 64 65 |TeX}'s m|ath mode|
|00004720| 20 6f 72 20 6e 6f 74 2c | 20 6f 72 20 77 68 65 74 | or not,| or whet|
|00004730| 68 65 72 20 69 74 0a 64 | 6f 65 73 6e 27 74 20 6d |her it.d|oesn't m|
|00004740| 61 74 74 65 72 2e 0a 57 | 68 65 6e 20 66 69 72 69 |atter..W|hen firi|
|00004750| 6e 67 20 70 72 6f 64 75 | 63 74 69 6f 6e 73 2c 0a |ng produ|ctions,.|
|00004760| 7b 5c 74 74 20 57 45 41 | 56 45 7d 20 77 69 6c 6c |{\tt WEA|VE} will|
|00004770| 20 70 6c 61 63 65 20 6d | 61 74 68 20 73 68 69 66 | place m|ath shif|
|00004780| 74 20 63 68 61 72 61 63 | 74 65 72 73 7e 28 5c 76 |t charac|ters~(\v|
|00004790| 65 72 62 2b 24 2b 29 20 | 69 6e 20 74 68 65 20 7b |erb+$+) |in the {|
|000047a0| 5c 54 65 58 7d 0a 74 65 | 78 74 20 74 68 61 74 20 |\TeX}.te|xt that |
|000047b0| 67 75 61 72 61 6e 74 65 | 65 20 74 68 65 20 70 6c |guarante|e the pl|
|000047c0| 61 63 65 6d 65 6e 74 20 | 6f 66 20 74 6f 6b 65 6e |acement |of token|
|000047d0| 73 20 69 6e 20 74 68 65 | 20 63 6f 72 72 65 63 74 |s in the| correct|
|000047e0| 20 6d 6f 64 65 73 2e 0a | 54 6f 6b 65 6e 73 20 77 | modes..|Tokens w|
|000047f0| 69 74 68 20 74 68 65 20 | 7b 5c 65 6d 20 65 6d 70 |ith the |{\em emp|
|00004800| 74 79 20 74 72 61 6e 73 | 6c 61 74 69 6f 6e 7d 20 |ty trans|lation} |
|00004810| 28 5c 76 65 72 62 2b 3c | 3e 2b 29 20 73 68 6f 75 |(\verb+<|>+) shou|
|00004820| 6c 64 20 61 6c 77 61 79 | 73 20 68 61 76 65 0a 7b |ld alway|s have.{|
|00004830| 5c 74 74 20 6d 61 74 68 | 6e 65 73 73 20 6d 61 79 |\tt math|ness may|
|00004840| 62 65 7d 2c 20 6c 65 73 | 74 20 74 68 65 79 20 63 |be}, les|t they c|
|00004850| 61 75 73 65 20 7b 5c 74 | 74 20 57 45 41 56 45 7d |ause {\t|t WEAVE}|
|00004860| 20 74 6f 20 70 6c 61 63 | 65 20 74 77 6f 0a 63 6f | to plac|e two.co|
|00004870| 6e 73 65 63 75 74 69 76 | 65 20 6d 61 74 68 20 73 |nsecutiv|e math s|
|00004880| 68 69 66 74 20 63 68 61 | 72 61 63 74 65 72 73 2e |hift cha|racters.|
|00004890| 0a 0a 5c 69 74 65 6d 20 | 0a 7b 5c 74 74 20 6e 61 |..\item |.{\tt na|
|000048a0| 6d 65 20 5c 73 79 6e 74 | 61 78 7b 74 6f 6b 65 6e |me \synt|ax{token|
|000048b0| 2d 6e 61 6d 65 7d 7d 0a | 0a 54 68 69 73 20 73 68 |-name}}.|.This sh|
|000048c0| 6f 75 6c 64 20 6f 6e 6c | 79 20 62 65 20 6e 65 63 |ould onl|y be nec|
|000048d0| 65 73 73 61 72 79 20 69 | 6e 20 64 65 62 75 67 67 |essary i|n debugg|
|000048e0| 69 6e 67 20 7b 53 70 69 | 64 65 72 7d 20 6f 72 20 |ing {Spi|der} or |
|000048f0| 7b 5c 57 45 42 7d 2e 0a | 49 74 20 63 61 75 73 65 |{\WEB}..|It cause|
|00004900| 73 20 74 68 65 20 73 70 | 65 63 69 66 69 65 64 20 |s the sp|ecified |
|00004910| 6e 61 6d 65 20 74 6f 20 | 62 65 20 61 74 74 61 63 |name to |be attac|
|00004920| 68 65 64 20 74 6f 20 74 | 68 65 20 74 6f 6b 65 6e |hed to t|he token|
|00004930| 2c 20 73 6f 20 74 68 61 | 74 20 61 0a 70 72 6f 67 |, so tha|t a.prog|
|00004940| 72 61 6d 6d 65 72 20 63 | 61 6e 20 73 65 61 72 63 |rammer c|an searc|
|00004950| 68 20 66 6f 72 20 74 68 | 61 74 20 6e 61 6d 65 20 |h for th|at name |
|00004960| 69 6e 20 74 68 65 20 43 | 7e 63 6f 64 65 20 67 65 |in the C|~code ge|
|00004970| 6e 65 72 61 74 65 64 20 | 62 79 20 0a 7b 53 70 69 |nerated |by .{Spi|
|00004980| 64 65 72 7d 2e 0a 0a 5c | 65 6e 64 7b 69 74 65 6d |der}...\|end{item|
|00004990| 69 7a 65 7d 0a 0a 5c 70 | 61 72 61 67 72 61 70 68 |ize}..\p|aragraph|
|000049a0| 7b 54 6f 6b 65 6e 20 64 | 65 73 69 67 6e 61 74 6f |{Token d|esignato|
|000049b0| 72 73 7d 0a 7b 53 70 69 | 64 65 72 7d 20 72 65 63 |rs}.{Spi|der} rec|
|000049c0| 6f 67 6e 69 7a 65 73 20 | 74 68 65 20 66 6f 6c 6c |ognizes |the foll|
|000049d0| 6f 77 69 6e 67 20 74 6f | 6b 65 6e 20 64 65 73 69 |owing to|ken desi|
|000049e0| 67 6e 61 74 6f 72 73 3a | 0a 5c 62 65 67 69 6e 7b |gnators:|.\begin{|
|000049f0| 64 65 73 63 72 69 70 74 | 69 6f 6e 7d 0a 5c 69 74 |descript|ion}.\it|
|00004a00| 65 6d 5b 7b 5c 74 74 20 | 69 64 65 6e 74 69 66 69 |em[{\tt |identifi|
|00004a10| 65 72 7d 5d 0a 41 20 7b | 5c 74 74 20 74 6f 6b 65 |er}].A {|\tt toke|
|00004a20| 6e 7d 20 63 6f 6d 6d 61 | 6e 64 20 75 73 69 6e 67 |n} comma|nd using|
|00004a30| 20 74 68 69 73 20 64 65 | 73 69 67 6e 61 74 6f 72 | this de|signator|
|00004a40| 20 74 65 6c 6c 73 20 7b | 5c 74 74 20 57 45 41 56 | tells {|\tt WEAV|
|00004a50| 45 7d 20 61 6e 64 20 7b | 5c 74 74 0a 54 41 4e 47 |E} and {|\tt.TANG|
|00004a60| 4c 45 7d 20 77 68 61 74 | 20 74 6f 20 64 6f 20 77 |LE} what| to do w|
|00004a70| 69 74 68 20 69 64 65 6e | 74 69 66 69 65 72 20 74 |ith iden|tifier t|
|00004a80| 6f 6b 65 6e 73 2e 0a 55 | 6e 66 6f 72 74 75 6e 61 |okens..U|nfortuna|
|00004a90| 74 65 6c 79 20 69 74 20 | 69 73 20 6e 6f 74 20 70 |tely it |is not p|
|00004aa0| 6f 73 73 69 62 6c 65 20 | 74 6f 20 73 70 65 63 69 |ossible |to speci|
|00004ab0| 66 79 20 77 69 74 68 20 | 7b 53 70 69 64 65 72 7d |fy with |{Spider}|
|00004ac0| 20 6a 75 73 74 0a 77 68 | 61 74 20 61 6e 20 69 64 | just.wh|at an id|
|00004ad0| 65 6e 74 69 66 69 65 72 | 20 69 73 3b 20 74 68 61 |entifier| is; tha|
|00004ae0| 74 20 64 65 66 69 6e 69 | 74 69 6f 6e 20 69 73 20 |t defini|tion is |
|00004af0| 68 61 72 64 2d 77 69 72 | 65 64 20 69 6e 74 6f 20 |hard-wir|ed into |
|00004b00| 7b 5c 74 74 20 57 45 41 | 56 45 7d 0a 61 6e 64 20 |{\tt WEA|VE}.and |
|00004b10| 7b 5c 74 74 20 54 41 4e | 47 4c 45 7d 2e 0a 41 6e |{\tt TAN|GLE}..An|
|00004b20| 20 69 64 65 6e 74 69 66 | 69 65 72 20 69 73 20 74 | identif|ier is t|
|00004b30| 68 65 20 6c 6f 6e 67 65 | 73 74 20 73 74 72 69 6e |he longe|st strin|
|00004b40| 67 20 6d 61 74 63 68 69 | 6e 67 20 74 68 69 73 20 |g matchi|ng this |
|00004b50| 72 65 67 75 6c 61 72 20 | 65 78 70 72 65 73 73 69 |regular |expressi|
|00004b60| 6f 6e 25 0a 5c 66 6f 6f | 74 6e 6f 74 65 7b 54 68 |on%.\foo|tnote{Th|
|00004b70| 65 20 72 65 61 64 65 72 | 20 75 6e 66 61 6d 69 6c |e reader| unfamil|
|00004b80| 69 61 72 20 77 69 74 68 | 20 74 68 65 20 55 6e 69 |iar with| the Uni|
|00004b90| 78 20 6e 6f 74 61 74 69 | 6f 6e 20 66 6f 72 20 72 |x notati|on for r|
|00004ba0| 65 67 75 6c 61 72 0a 65 | 78 70 72 65 73 73 69 6f |egular.e|xpressio|
|00004bb0| 6e 73 20 73 68 6f 75 6c | 64 20 63 6f 6e 73 75 6c |ns shoul|d consul|
|00004bc0| 74 20 74 68 65 20 7b 5c | 69 74 20 65 64 28 31 29 |t the {\|it ed(1)|
|00004bd0| 7d 20 6d 61 6e 20 70 61 | 67 65 2e 7d 3a 0a 5c 62 |} man pa|ge.}:.\b|
|00004be0| 65 67 69 6e 7b 76 65 72 | 62 61 74 69 6d 7d 0a 5b |egin{ver|batim}.[|
|00004bf0| 61 2d 7a 41 2d 5a 5f 5d | 5b 61 2d 7a 41 2d 5a 30 |a-zA-Z_]|[a-zA-Z0|
|00004c00| 2d 39 5f 5d 2a 0a 5c 65 | 6e 64 7b 76 65 72 62 61 |-9_]*.\e|nd{verba|
|00004c10| 74 69 6d 7d 0a 0a 5c 69 | 74 65 6d 5b 7b 5c 74 74 |tim}..\i|tem[{\tt|
|00004c20| 20 6e 75 6d 62 65 72 7d | 5d 0a 49 6e 20 74 68 65 | number}|].In the|
|00004c30| 20 63 75 72 72 65 6e 74 | 20 69 6d 70 6c 65 6d 65 | current| impleme|
|00004c40| 6e 74 61 74 69 6f 6e 20 | 6f 66 20 7b 53 70 69 64 |ntation |of {Spid|
|00004c50| 65 72 7d 20 61 6e 64 20 | 7b 5c 74 74 20 57 45 41 |er} and |{\tt WEA|
|00004c60| 56 45 7d 2c 20 61 20 7b | 5c 74 74 20 74 6f 6b 65 |VE}, a {|\tt toke|
|00004c70| 6e 7d 0a 63 6f 6d 6d 61 | 6e 64 20 75 73 69 6e 67 |n}.comma|nd using|
|00004c80| 20 74 68 69 73 20 64 65 | 73 69 67 6e 61 74 6f 72 | this de|signator|
|00004c90| 20 63 6f 76 65 72 73 20 | 74 68 65 20 74 72 65 61 | covers |the trea|
|00004ca0| 74 6d 65 6e 74 20 6f 66 | 20 62 6f 74 68 20 6e 75 |tment of| both nu|
|00004cb0| 6d 65 72 69 63 0a 63 6f | 6e 73 74 61 6e 74 73 20 |meric.co|nstants |
|00004cc0| 61 6e 64 20 73 74 72 69 | 6e 67 20 63 6f 6e 73 74 |and stri|ng const|
|00004cd0| 61 6e 74 73 2e 0a 4c 69 | 6b 65 20 74 68 65 20 69 |ants..Li|ke the i|
|00004ce0| 64 65 6e 74 69 66 69 65 | 72 73 2c 20 74 68 65 20 |dentifie|rs, the |
|00004cf0| 64 65 66 69 6e 69 74 69 | 6f 6e 73 20 6f 66 20 77 |definiti|ons of w|
|00004d00| 68 61 74 20 63 6f 6e 73 | 74 69 74 75 74 65 73 20 |hat cons|titutes |
|00004d10| 61 20 6e 75 6d 65 72 69 | 63 20 6f 72 0a 73 74 72 |a numeri|c or.str|
|00004d20| 69 6e 67 20 63 6f 6e 73 | 74 61 6e 74 20 63 61 6e |ing cons|tant can|
|00004d30| 6e 6f 74 20 62 65 20 63 | 68 61 6e 67 65 64 2e 0a |not be c|hanged..|
|00004d40| 7b 5c 73 61 6d 65 70 61 | 67 65 0a 41 20 6e 75 6d |{\samepa|ge.A num|
|00004d50| 65 72 69 63 20 63 6f 6e | 73 74 61 6e 74 20 69 73 |eric con|stant is|
|00004d60| 20 74 68 65 20 6c 6f 6e | 67 65 73 74 20 73 74 72 | the lon|gest str|
|00004d70| 69 6e 67 20 6d 61 74 63 | 68 69 6e 67 25 0a 5c 66 |ing matc|hing%.\f|
|00004d80| 6f 6f 74 6e 6f 74 65 7b | 54 68 65 72 65 20 20 6f |ootnote{|There o|
|00004d90| 75 67 68 74 20 74 6f 20 | 62 65 20 73 6f 6d 65 20 |ught to |be some |
|00004da0| 6b 69 6e 64 20 6f 66 20 | 7b 5c 57 45 42 7d 20 63 |kind of |{\WEB} c|
|00004db0| 6f 6e 74 72 6f 6c 20 73 | 65 71 75 65 6e 63 65 20 |ontrol s|equence |
|00004dc0| 74 6f 0a 73 75 70 70 6f | 72 74 20 66 6c 6f 61 74 |to.suppo|rt float|
|00004dd0| 69 6e 67 20 70 6f 69 6e | 74 20 6e 6f 74 61 74 69 |ing poin|t notati|
|00004de0| 6f 6e 20 66 6f 72 20 74 | 68 6f 73 65 20 6c 61 6e |on for t|hose lan|
|00004df0| 67 75 61 67 65 73 20 74 | 68 61 74 20 68 61 76 65 |guages t|hat have|
|00004e00| 20 69 74 2e 7d 3a 0a 5c | 62 65 67 69 6e 7b 76 65 | it.}:.\|begin{ve|
|00004e10| 72 62 61 74 69 6d 7d 0a | 5b 30 2d 39 5d 2b 28 5c |rbatim}.|[0-9]+(\|
|00004e20| 2e 5b 30 2d 39 5d 2a 29 | 3f 0a 5c 65 6e 64 7b 76 |.[0-9]*)|?.\end{v|
|00004e30| 65 72 62 61 74 69 6d 7d | 0a 7d 0a 41 20 73 74 72 |erbatim}|.}.A str|
|00004e40| 69 6e 67 20 63 6f 6e 73 | 74 61 6e 74 20 69 73 20 |ing cons|tant is |
|00004e50| 74 68 65 20 6c 6f 6e 67 | 65 73 74 20 73 74 72 69 |the long|est stri|
|00004e60| 6e 67 20 6d 61 74 63 68 | 69 6e 67 0a 5c 62 65 67 |ng match|ing.\beg|
|00004e70| 69 6e 7b 76 65 72 62 61 | 74 69 6d 7d 0a 5c 22 28 |in{verba|tim}.\"(|
|00004e80| 5b 5e 22 5d 2a 5c 5c 5c | 22 29 2a 5b 5e 22 5d 2a |[^"]*\\\|")*[^"]*|
|00004e90| 5c 22 7c 27 5b 5e 40 5c | 5d 27 7c 27 5c 5c 2e 27 |\"|'[^@\|]'|'\\.'|
|00004ea0| 7c 27 40 40 27 0a 5c 65 | 6e 64 7b 76 65 72 62 61 ||'@@'.\e|nd{verba|
|00004eb0| 74 69 6d 7d 0a 43 61 72 | 72 69 61 67 65 20 72 65 |tim}.Car|riage re|
|00004ec0| 74 75 72 6e 73 20 6d 61 | 79 20 61 70 70 65 61 72 |turns ma|y appear|
|00004ed0| 20 69 6e 20 73 74 72 69 | 6e 67 20 63 6f 6e 73 74 | in stri|ng const|
|00004ee0| 61 6e 74 73 20 69 66 20 | 65 73 63 61 70 65 64 20 |ants if |escaped |
|00004ef0| 62 79 20 61 0a 62 61 63 | 6b 73 6c 61 73 68 7e 28 |by a.bac|kslash~(|
|00004f00| 5c 76 65 72 62 2b 5c 2b | 29 2e 0a 0a 5c 69 74 65 |\verb+\+|)...\ite|
|00004f10| 6d 5b 7b 5c 74 74 20 6e | 65 77 6c 69 6e 65 7d 5d |m[{\tt n|ewline}]|
|00004f20| 0a 41 20 7b 5c 74 74 20 | 74 6f 6b 65 6e 7d 20 63 |.A {\tt |token} c|
|00004f30| 6f 6d 6d 61 6e 64 20 75 | 73 69 6e 67 20 74 68 69 |ommand u|sing thi|
|00004f40| 73 20 64 65 73 63 72 69 | 70 74 6f 72 20 74 65 6c |s descri|ptor tel|
|00004f50| 6c 73 20 7b 5c 74 74 20 | 57 45 41 56 45 7d 20 61 |ls {\tt |WEAVE} a|
|00004f60| 6e 64 20 7b 5c 74 74 0a | 54 41 4e 47 4c 45 7d 20 |nd {\tt.|TANGLE} |
|00004f70| 68 6f 77 20 74 6f 20 74 | 72 65 61 74 20 61 20 6e |how to t|reat a n|
|00004f80| 65 77 6c 69 6e 65 2e 0a | 57 65 27 6c 6c 20 73 65 |ewline..|We'll se|
|00004f90| 65 20 6c 61 74 65 72 20 | 68 6f 77 20 74 6f 20 6d |e later |how to m|
|00004fa0| 61 6b 65 20 7b 5c 74 74 | 20 57 45 41 56 45 7d 20 |ake {\tt| WEAVE} |
|00004fb0| 69 67 6e 6f 72 65 20 6e | 65 77 6c 69 6e 65 73 2e |ignore n|ewlines.|
|00004fc0| 0a 0a 5c 69 74 65 6d 5b | 7b 5c 74 74 20 70 73 65 |..\item[|{\tt pse|
|00004fd0| 75 64 6f 5c 5f 73 65 6d | 69 7d 5d 0a 41 20 7b 5c |udo\_sem|i}].A {\|
|00004fe0| 74 74 20 74 6f 6b 65 6e | 7d 20 63 6f 6d 6d 61 6e |tt token|} comman|
|00004ff0| 64 20 75 73 69 6e 67 20 | 74 68 69 73 20 64 65 73 |d using |this des|
|00005000| 63 72 69 70 74 6f 72 20 | 74 65 6c 6c 73 20 7b 5c |criptor |tells {\|
|00005010| 74 74 20 57 45 41 56 45 | 7d 20 77 68 61 74 20 74 |tt WEAVE|} what t|
|00005020| 6f 0a 64 6f 20 77 69 74 | 68 20 74 68 65 20 7b 5c |o.do wit|h the {\|
|00005030| 57 45 42 7d 20 63 6f 6e | 74 72 6f 6c 20 73 65 71 |WEB} con|trol seq|
|00005040| 75 65 6e 63 65 20 7b 5c | 74 74 20 40 3b 7d 2e 0a |uence {\|tt @;}..|
|00005050| 54 68 69 73 20 63 6f 6e | 74 72 6f 6c 20 73 65 71 |This con|trol seq|
|00005060| 75 65 6e 63 65 20 69 73 | 20 61 6c 77 61 79 73 20 |uence is| always |
|00005070| 69 67 6e 6f 72 65 64 20 | 62 79 20 7b 5c 74 74 20 |ignored |by {\tt |
|00005080| 54 41 4e 47 4c 45 7d 2e | 0a 0a 5c 69 74 65 6d 5b |TANGLE}.|..\item[|
|00005090| 5c 73 79 6e 74 61 78 7b | 63 68 61 72 61 63 74 65 |\syntax{|characte|
|000050a0| 72 73 7d 5d 0a 77 68 65 | 72 65 20 6e 6f 6e 65 20 |rs}].whe|re none |
|000050b0| 6f 66 20 74 68 65 20 63 | 68 61 72 61 63 74 65 72 |of the c|haracter|
|000050c0| 73 20 69 73 20 61 6c 70 | 68 61 6e 75 6d 65 72 69 |s is alp|hanumeri|
|000050d0| 63 2e 0a 41 20 7b 5c 74 | 74 20 74 6f 6b 65 6e 7d |c..A {\t|t token}|
|000050e0| 20 63 6f 6d 6d 61 6e 64 | 20 75 73 69 6e 67 20 74 | command| using t|
|000050f0| 68 69 73 20 64 65 73 63 | 72 69 70 74 6f 72 20 64 |his desc|riptor d|
|00005100| 65 66 69 6e 65 73 20 74 | 68 65 20 73 65 71 75 65 |efines t|he seque|
|00005110| 6e 63 65 20 6f 66 0a 63 | 68 61 72 61 63 74 65 72 |nce of.c|haracter|
|00005120| 73 20 61 73 20 61 20 74 | 6f 6b 65 6e 2c 20 61 6e |s as a t|oken, an|
|00005130| 64 20 74 65 6c 6c 73 20 | 7b 5c 74 74 20 57 45 41 |d tells |{\tt WEA|
|00005140| 56 45 7d 20 61 6e 64 20 | 7b 5c 74 74 20 54 41 4e |VE} and |{\tt TAN|
|00005150| 47 4c 45 7d 20 77 68 61 | 74 20 74 6f 0a 64 6f 20 |GLE} wha|t to.do |
|00005160| 77 69 74 68 20 74 68 61 | 74 20 74 6f 6b 65 6e 2e |with tha|t token.|
|00005170| 0a 41 20 74 6f 6b 65 6e | 20 6d 61 79 20 62 65 20 |.A token| may be |
|00005180| 61 20 70 72 65 66 69 78 | 20 6f 66 20 61 6e 6f 74 |a prefix| of anot|
|00005190| 68 65 72 20 74 6f 6b 65 | 6e 3b 20 7b 5c 74 74 20 |her toke|n; {\tt |
|000051a0| 57 45 41 56 45 7d 20 61 | 6e 64 20 7b 5c 74 74 20 |WEAVE} a|nd {\tt |
|000051b0| 54 41 4e 47 4c 45 7d 0a | 77 69 6c 6c 20 70 72 65 |TANGLE}.|will pre|
|000051c0| 66 65 72 20 74 68 65 20 | 6c 6f 6e 67 65 72 20 74 |fer the |longer t|
|000051d0| 6f 6b 65 6e 20 74 6f 20 | 74 68 65 20 73 68 6f 72 |oken to |the shor|
|000051e0| 74 65 72 2e 0a 54 68 75 | 73 2c 20 69 6e 20 61 20 |ter..Thu|s, in a |
|000051f0| 43 7e 7b 5c 57 45 42 7d | 2c 20 5c 76 65 72 62 2b |C~{\WEB}|, \verb+|
|00005200| 3d 3d 2b 20 77 69 6c 6c | 20 62 65 20 72 65 61 64 |==+ will| be read|
|00005210| 20 61 73 20 61 20 73 69 | 6e 67 6c 65 20 5c 76 65 | as a si|ngle \ve|
|00005220| 72 62 2b 3d 3d 2b 0a 74 | 6f 6b 65 6e 2c 20 6e 6f |rb+==+.t|oken, no|
|00005230| 74 20 61 73 20 74 77 6f | 20 5c 76 65 72 62 2b 3d |t as two| \verb+=|
|00005240| 2b 20 74 6f 6b 65 6e 73 | 2e 0a 5c 65 6e 64 7b 64 |+ tokens|..\end{d|
|00005250| 65 73 63 72 69 70 74 69 | 6f 6e 7d 0a 0a 0a 0a 0a |escripti|on}.....|
|00005260| 5c 73 75 62 73 65 63 74 | 69 6f 6e 7b 52 65 73 65 |\subsect|ion{Rese|
|00005270| 72 76 65 64 20 77 6f 72 | 64 20 74 6f 6b 65 6e 73 |rved wor|d tokens|
|00005280| 7d 0a 52 65 73 65 72 76 | 65 64 20 77 6f 72 64 73 |}.Reserv|ed words|
|00005290| 20 61 72 65 20 61 74 74 | 61 63 68 65 64 20 74 6f | are att|ached to|
|000052a0| 20 61 20 70 61 72 74 69 | 63 75 6c 61 72 20 7b 5c | a parti|cular {\|
|000052b0| 65 6d 20 69 6c 6b 7d 20 | 75 73 69 6e 67 20 74 68 |em ilk} |using th|
|000052c0| 65 20 7b 5c 74 74 0a 72 | 65 73 65 72 76 65 64 7d |e {\tt.r|eserved}|
|000052d0| 20 63 6f 6d 6d 61 6e 64 | 2e 0a 5c 62 65 67 69 6e | command|..\begin|
|000052e0| 7b 71 75 6f 74 65 7d 0a | 5c 74 74 20 20 72 65 73 |{quote}.|\tt res|
|000052f0| 65 72 76 65 64 20 5c 73 | 79 6e 74 61 78 7b 72 65 |erved \s|yntax{re|
|00005300| 73 65 72 76 65 64 2d 77 | 6f 72 64 7d 20 24 5b 24 |served-w|ord} $[$|
|00005310| 69 6c 6b 20 5c 73 79 6e | 74 61 78 7b 69 6c 6b 2d |ilk \syn|tax{ilk-|
|00005320| 6e 61 6d 65 7d 24 5d 24 | 0a 5c 65 6e 64 7b 71 75 |name}$]$|.\end{qu|
|00005330| 6f 74 65 7d 0a 49 66 20 | 79 6f 75 27 72 65 20 77 |ote}.If |you're w|
|00005340| 72 69 74 69 6e 67 20 61 | 20 7b 53 70 69 64 65 72 |riting a| {Spider|
|00005350| 7d 20 66 69 6c 65 2c 20 | 79 6f 75 20 6d 61 79 20 |} file, |you may |
|00005360| 63 68 6f 6f 73 65 20 61 | 6e 79 20 69 6c 6b 0a 6e |choose a|ny ilk.n|
|00005370| 61 6d 65 73 20 79 6f 75 | 20 6c 69 6b 65 2c 20 73 |ames you| like, s|
|00005380| 75 62 6a 65 63 74 20 6f | 6e 6c 79 20 74 6f 20 74 |ubject o|nly to t|
|00005390| 68 65 20 72 65 73 74 72 | 69 63 74 69 6f 6e 20 74 |he restr|iction t|
|000053a0| 68 61 74 20 74 68 65 79 | 20 6e 6f 74 20 63 6f 6e |hat they| not con|
|000053b0| 66 6c 69 63 74 0a 77 69 | 74 68 20 6f 74 68 65 72 |flict.wi|th other|
|000053c0| 20 6e 61 6d 65 73 20 6b | 6e 6f 77 6e 20 74 6f 20 | names k|nown to |
|000053d0| 7b 53 70 69 64 65 72 7d | 20 28 65 2e 67 2e 7e 70 |{Spider}| (e.g.~p|
|000053e0| 72 65 64 65 66 69 6e 65 | 64 20 6b 65 79 20 77 6f |redefine|d key wo|
|000053f0| 72 64 73 2c 0a 6e 61 6d | 65 73 20 6f 66 20 63 61 |rds,.nam|es of ca|
|00005400| 74 65 67 6f 72 69 65 73 | 2c 20 61 6e 64 20 73 6f |tegories|, and so|
|00005410| 20 6f 6e 29 2e 0a 54 68 | 65 20 63 6f 6e 76 65 6e | on)..Th|e conven|
|00005420| 74 69 6f 6e 2c 20 68 6f | 77 65 76 65 72 2c 20 69 |tion, ho|wever, i|
|00005430| 73 20 74 6f 20 75 73 65 | 20 69 6c 6b 20 7b 5c 74 |s to use| ilk {\t|
|00005440| 74 20 77 69 74 68 5c 5f | 6c 69 6b 65 7d 20 66 6f |t with\_|like} fo|
|00005450| 72 20 61 20 72 65 73 65 | 72 76 65 64 0a 77 6f 72 |r a rese|rved.wor|
|00005460| 64 20 7b 5c 74 74 20 77 | 69 74 68 7d 2c 20 61 6e |d {\tt w|ith}, an|
|00005470| 64 20 73 6f 20 6f 6e 2e | 25 0a 5c 66 6f 6f 74 6e |d so on.|%.\footn|
|00005480| 6f 74 65 7b 25 0a 54 68 | 65 20 65 78 69 73 74 65 |ote{%.Th|e existe|
|00005490| 6e 63 65 20 6f 66 20 74 | 68 69 73 20 63 6f 6e 76 |nce of t|his conv|
|000054a0| 65 6e 74 69 6f 6e 20 73 | 65 64 75 63 65 64 20 6d |ention s|educed m|
|000054b0| 65 20 69 6e 74 6f 20 61 | 64 64 69 6e 67 20 61 20 |e into a|dding a |
|000054c0| 70 65 72 6e 69 63 69 6f | 75 73 0a 66 65 61 74 75 |pernicio|us.featu|
|000054d0| 72 65 20 74 6f 20 7b 53 | 70 69 64 65 72 7d 2d 2d |re to {S|pider}--|
|000054e0| 2d 69 66 20 79 6f 75 20 | 6f 6d 69 74 20 74 68 65 |-if you |omit the|
|000054f0| 20 69 6c 6b 20 66 72 6f | 6d 20 61 20 7b 5c 74 74 | ilk fro|m a {\tt|
|00005500| 20 72 65 73 65 72 76 65 | 64 7d 0a 63 6f 6d 6d 61 | reserve|d}.comma|
|00005510| 6e 64 2c 20 7b 53 70 69 | 64 65 72 7d 20 77 69 6c |nd, {Spi|der} wil|
|00005520| 6c 20 6d 61 6b 65 20 61 | 6e 20 69 6c 6b 20 6e 61 |l make a|n ilk na|
|00005530| 6d 65 20 62 79 20 61 70 | 70 65 6e 64 69 6e 67 20 |me by ap|pending |
|00005540| 7b 5c 74 74 20 5c 5f 6c | 69 6b 65 7d 0a 74 6f 20 |{\tt \_l|ike}.to |
|00005550| 74 68 65 20 6e 61 6d 65 | 20 6f 66 20 74 68 65 20 |the name| of the |
|00005560| 72 65 73 65 72 76 65 64 | 20 77 6f 72 64 2e 0a 46 |reserved| word..F|
|00005570| 75 72 74 68 65 72 6d 6f | 72 65 2c 20 69 66 20 74 |urthermo|re, if t|
|00005580| 68 61 74 20 69 6c 6b 20 | 64 6f 65 73 6e 27 74 20 |hat ilk |doesn't |
|00005590| 61 6c 72 65 61 64 79 20 | 65 78 69 73 74 2c 20 7b |already |exist, {|
|000055a0| 53 70 69 64 65 72 7d 20 | 77 69 6c 6c 0a 63 6f 6e |Spider} |will.con|
|000055b0| 73 74 72 75 63 74 20 6f | 6e 65 2e 0a 44 6f 6e 27 |struct o|ne..Don'|
|000055c0| 74 20 75 73 65 20 74 68 | 69 73 20 66 65 61 74 75 |t use th|is featu|
|000055d0| 72 65 2e 0a 7d 0a 0a 54 | 68 65 20 7b 5c 74 74 20 |re..}..T|he {\tt |
|000055e0| 20 69 6c 6b 7d 20 61 6e | 64 20 7b 5c 74 74 20 20 | ilk} an|d {\tt |
|000055f0| 74 6f 6b 65 6e 7d 20 63 | 6f 6d 6d 61 6e 64 73 20 |token} c|ommands |
|00005600| 68 61 76 65 20 6e 65 61 | 72 6c 79 20 69 64 65 6e |have nea|rly iden|
|00005610| 74 69 63 61 6c 20 73 79 | 6e 74 61 78 2e 0a 54 68 |tical sy|ntax..Th|
|00005620| 65 20 73 79 6e 74 61 78 | 20 6f 66 20 74 68 65 20 |e syntax| of the |
|00005630| 7b 5c 74 74 20 69 6c 6b | 7d 20 63 6f 6d 6d 61 6e |{\tt ilk|} comman|
|00005640| 64 20 69 73 3a 0a 5c 62 | 65 67 69 6e 7b 71 75 6f |d is:.\b|egin{quo|
|00005650| 74 65 7d 5c 74 74 0a 5c | 73 79 6e 74 61 78 7b 63 |te}\tt.\|syntax{c|
|00005660| 6f 6d 6d 61 6e 64 7d 20 | 5c 70 72 6f 64 75 63 65 |ommand} |\produce|
|00005670| 73 7e 69 6c 6b 20 5c 73 | 79 6e 74 61 78 7b 69 6c |s~ilk \s|yntax{il|
|00005680| 6b 2d 6e 61 6d 65 7d 0a | 5c 73 79 6e 74 61 78 7b |k-name}.|\syntax{|
|00005690| 74 6f 6b 65 6e 2d 64 65 | 73 63 72 69 70 74 69 6f |token-de|scriptio|
|000056a0| 6e 73 7d 0a 5c 65 6e 64 | 7b 71 75 6f 74 65 7d 0a |ns}.\end|{quote}.|
|000056b0| 49 6e 20 74 72 61 6e 73 | 6c 61 74 69 6f 6e 73 20 |In trans|lations |
|000056c0| 74 68 61 74 20 61 70 70 | 65 61 72 20 69 6e 20 7b |that app|ear in {|
|000056d0| 5c 74 74 20 69 6c 6b 7d | 20 63 6f 6d 6d 61 6e 64 |\tt ilk}| command|
|000056e0| 73 2c 20 74 68 65 20 73 | 65 6c 66 0a 6d 61 72 6b |s, the s|elf.mark|
|000056f0| 65 72 7e 28 7b 5c 74 74 | 20 2a 7d 29 20 64 65 73 |er~({\tt| *}) des|
|00005700| 69 67 6e 61 74 65 73 20 | 74 68 65 20 73 74 72 69 |ignates |the stri|
|00005710| 6e 67 20 6f 66 20 63 68 | 61 72 61 63 74 65 72 73 |ng of ch|aracters|
|00005720| 20 6d 61 6b 69 6e 67 20 | 75 70 20 74 68 65 0a 72 | making |up the.r|
|00005730| 65 73 65 72 76 65 64 20 | 77 6f 72 64 2c 20 73 75 |eserved |word, su|
|00005740| 72 72 6f 75 6e 64 65 64 | 20 62 79 20 5c 76 65 72 |rrounded| by \ver|
|00005750| 62 2b 5c 26 7b 2e 2e 2e | 7d 2b 2c 20 77 68 69 63 |b+\&{...|}+, whic|
|00005760| 68 20 6d 61 6b 65 73 20 | 74 68 65 20 72 65 73 65 |h makes |the rese|
|00005770| 72 76 65 64 0a 77 6f 72 | 64 73 20 61 70 70 65 61 |rved.wor|ds appea|
|00005780| 72 20 69 6e 20 62 6f 6c | 64 20 66 61 63 65 2e 0a |r in bol|d face..|
|00005790| 0a 5c 73 65 63 74 69 6f | 6e 7b 53 79 6e 74 61 78 |.\sectio|n{Syntax|
|000057a0| 20 6f 66 20 74 68 65 20 | 70 72 65 74 74 79 70 72 | of the |prettypr|
|000057b0| 69 6e 74 69 6e 67 20 67 | 72 61 6d 6d 61 72 7d 0a |inting g|rammar}.|
|000057c0| 44 65 66 69 6e 69 6e 67 | 20 74 68 65 20 74 6f 6b |Defining| the tok|
|000057d0| 65 6e 73 20 6f 66 20 61 | 20 6c 61 6e 67 75 61 67 |ens of a| languag|
|000057e0| 65 20 69 73 20 73 6f 6d | 65 77 68 61 74 20 74 65 |e is som|ewhat te|
|000057f0| 64 69 6f 75 73 2c 20 62 | 75 74 20 69 74 20 69 73 |dious, b|ut it is|
|00005800| 0a 65 73 73 65 6e 74 69 | 61 6c 6c 79 20 73 74 72 |.essenti|ally str|
|00005810| 61 69 67 68 74 66 6f 72 | 77 61 72 64 2c 20 61 6e |aightfor|ward, an|
|00005820| 64 20 74 68 65 20 64 65 | 66 69 6e 69 74 69 6f 6e |d the de|finition|
|00005830| 20 75 73 75 61 6c 6c 79 | 20 64 6f 65 73 20 6e 6f | usually| does no|
|00005840| 74 20 6e 65 65 64 0a 66 | 69 6e 65 20 74 75 6e 69 |t need.f|ine tuni|
|00005850| 6e 67 2e 0a 57 68 65 6e | 20 64 65 76 65 6c 6f 70 |ng..When| develop|
|00005860| 69 6e 67 20 61 20 6e 65 | 77 20 7b 5c 57 45 42 7d |ing a ne|w {\WEB}|
|00005870| 20 77 69 74 68 20 7b 53 | 70 69 64 65 72 7d 2c 20 | with {S|pider}, |
|00005880| 79 6f 75 20 77 69 6c 6c | 20 73 70 65 6e 64 20 6d |you will| spend m|
|00005890| 6f 73 74 20 6f 66 0a 79 | 6f 75 72 20 74 69 6d 65 |ost of.y|our time|
|000058a0| 20 77 72 69 74 69 6e 67 | 20 74 68 65 20 67 72 61 | writing| the gra|
|000058b0| 6d 6d 61 72 20 74 68 61 | 74 20 74 65 6c 6c 73 20 |mmar tha|t tells |
|000058c0| 7b 5c 74 74 20 57 45 41 | 56 45 7d 20 68 6f 77 20 |{\tt WEA|VE} how |
|000058d0| 74 6f 20 72 65 64 75 63 | 65 0a 73 63 72 61 70 73 |to reduc|e.scraps|
|000058e0| 2e 0a 54 68 65 20 67 72 | 61 6d 6d 61 72 20 69 73 |..The gr|ammar is|
|000058f0| 20 64 65 66 69 6e 65 64 | 20 61 73 20 61 20 73 65 | defined| as a se|
|00005900| 71 75 65 6e 63 65 20 6f | 66 20 63 6f 6e 74 65 78 |quence o|f contex|
|00005910| 74 2d 73 65 6e 73 69 74 | 69 76 65 20 70 72 6f 64 |t-sensit|ive prod|
|00005920| 75 63 74 69 6f 6e 73 2e | 20 0a 45 61 63 68 20 70 |uctions.| .Each p|
|00005930| 72 6f 64 75 63 74 69 6f | 6e 20 68 61 73 20 74 68 |roductio|n has th|
|00005940| 65 20 66 6f 72 6d 3a 0a | 5c 62 65 67 69 6e 7b 71 |e form:.|\begin{q|
|00005950| 75 6f 74 65 7d 0a 5c 74 | 74 20 0a 5c 73 79 6e 74 |uote}.\t|t .\synt|
|00005960| 61 78 7b 6c 65 66 74 20 | 63 6f 6e 74 65 78 74 7d |ax{left |context}|
|00005970| 20 5b 20 5c 73 79 6e 74 | 61 78 7b 66 69 72 69 6e | [ \synt|ax{firin|
|00005980| 67 20 69 6e 73 74 72 75 | 63 74 69 6f 6e 73 7d 20 |g instru|ctions} |
|00005990| 5d 20 5c 73 79 6e 74 61 | 78 7b 72 69 67 68 74 20 |] \synta|x{right |
|000059a0| 63 6f 6e 74 65 78 74 7d | 0a 5c 5c 5c 6e 75 6c 6c |context}|.\\\null|
|000059b0| 5c 71 71 75 61 64 0a 2d | 2d 3e 20 5c 73 79 6e 74 |\qquad.-|-> \synt|
|000059c0| 61 78 7b 6c 65 66 74 20 | 63 6f 6e 74 65 78 74 7d |ax{left |context}|
|000059d0| 20 5c 73 79 6e 74 61 78 | 7b 74 61 72 67 65 74 20 | \syntax|{target |
|000059e0| 63 61 74 65 67 6f 72 79 | 7d 20 5c 73 79 6e 74 61 |category|} \synta|
|000059f0| 78 7b 72 69 67 68 74 20 | 63 6f 6e 74 65 78 74 7d |x{right |context}|
|00005a00| 0a 5c 65 6e 64 7b 71 75 | 6f 74 65 7d 0a 77 68 65 |.\end{qu|ote}.whe|
|00005a10| 72 65 20 74 68 65 20 6c | 65 66 74 20 61 6e 64 20 |re the l|eft and |
|00005a20| 72 69 67 68 74 20 63 6f | 6e 74 65 78 74 73 20 61 |right co|ntexts a|
|00005a30| 72 65 20 28 70 6f 73 73 | 69 62 6c 79 20 65 6d 70 |re (poss|ibly emp|
|00005a40| 74 79 29 20 73 65 71 75 | 65 6e 63 65 73 20 6f 66 |ty) sequ|ences of|
|00005a50| 0a 73 63 72 61 70 20 64 | 65 73 69 67 6e 61 74 6f |.scrap d|esignato|
|00005a60| 72 73 2c 20 74 68 65 20 | 66 69 72 69 6e 67 20 69 |rs, the |firing i|
|00005a70| 6e 73 74 72 75 63 74 69 | 6f 6e 73 20 61 72 65 20 |nstructi|ons are |
|00005a80| 61 20 73 65 71 75 65 6e | 63 65 20 6f 66 20 73 63 |a sequen|ce of sc|
|00005a90| 72 61 70 0a 64 65 73 69 | 67 6e 61 74 6f 72 73 20 |rap.desi|gnators |
|00005aa0| 61 6e 64 20 74 72 61 6e | 73 6c 61 74 69 6f 6e 73 |and tran|slations|
|00005ab0| 20 28 63 6f 6e 74 61 69 | 6e 69 6e 67 20 61 74 20 | (contai|ning at |
|00005ac0| 6c 65 61 73 74 20 6f 6e | 65 20 73 63 72 61 70 0a |least on|e scrap.|
|00005ad0| 64 65 73 69 67 6e 61 74 | 6f 72 29 2c 20 61 6e 64 |designat|or), and|
|00005ae0| 20 74 68 65 20 74 61 72 | 67 65 74 20 63 61 74 65 | the tar|get cate|
|00005af0| 67 6f 72 79 20 69 73 20 | 61 20 63 61 74 65 67 6f |gory is |a catego|
|00005b00| 72 79 20 64 65 73 69 67 | 6e 61 74 6f 72 2e 0a 49 |ry desig|nator..I|
|00005b10| 66 20 74 68 65 20 6c 65 | 66 74 20 61 6e 64 20 72 |f the le|ft and r|
|00005b20| 69 67 68 74 20 63 6f 6e | 74 65 78 74 73 20 61 72 |ight con|texts ar|
|00005b30| 65 20 62 6f 74 68 20 65 | 6d 70 74 79 2c 20 74 68 |e both e|mpty, th|
|00005b40| 65 20 73 71 75 61 72 65 | 20 62 72 61 63 6b 65 74 |e square| bracket|
|00005b50| 73 0a 28 7b 5c 74 74 20 | 5b 5d 7d 29 20 63 61 6e |s.({\tt |[]}) can|
|00005b60| 20 62 65 20 6f 6d 69 74 | 74 65 64 2c 20 61 6e 64 | be omit|ted, and|
|00005b70| 20 74 68 65 20 70 72 6f | 64 75 63 74 69 6f 6e 20 | the pro|duction |
|00005b80| 69 73 20 63 6f 6e 74 65 | 78 74 20 66 72 65 65 2e |is conte|xt free.|
|00005b90| 0a 54 68 65 20 6c 65 66 | 74 20 61 6e 64 20 72 69 |.The lef|t and ri|
|00005ba0| 67 68 74 20 63 6f 6e 74 | 65 78 74 73 20 6d 75 73 |ght cont|exts mus|
|00005bb0| 74 20 62 65 20 74 68 65 | 20 73 61 6d 65 20 6f 6e |t be the| same on|
|00005bc0| 20 62 6f 74 68 20 73 69 | 64 65 73 20 6f 66 20 74 | both si|des of t|
|00005bd0| 68 65 20 7b 5c 74 74 0a | 2d 2d 3e 7d 2e 0a 0a 57 |he {\tt.|-->}...W|
|00005be0| 68 61 74 20 64 6f 65 73 | 20 74 68 65 20 70 72 6f |hat does| the pro|
|00005bf0| 64 75 63 74 69 6f 6e 20 | 6d 65 61 6e 3f 0a 57 65 |duction |mean?.We|
|00005c00| 6c 6c 2c 20 7b 5c 74 74 | 20 57 45 41 56 45 7d 20 |ll, {\tt| WEAVE} |
|00005c10| 69 73 20 74 72 79 69 6e | 67 20 74 6f 20 72 65 64 |is tryin|g to red|
|00005c20| 75 63 65 20 61 20 73 65 | 71 75 65 6e 63 65 20 6f |uce a se|quence o|
|00005c30| 66 20 73 63 72 61 70 73 | 2e 0a 53 6f 20 77 68 61 |f scraps|..So wha|
|00005c40| 74 20 7b 5c 74 74 20 57 | 45 41 56 45 7d 20 64 6f |t {\tt W|EAVE} do|
|00005c50| 65 73 20 69 73 20 6c 6f | 6f 6b 20 61 74 20 74 68 |es is lo|ok at th|
|00005c60| 65 20 73 65 71 75 65 6e | 63 65 2c 20 74 6f 20 66 |e sequen|ce, to f|
|00005c70| 69 6e 64 20 6f 75 74 20 | 77 68 65 74 68 65 72 0a |ind out |whether.|
|00005c80| 74 68 65 20 6c 65 66 74 | 20 68 61 6e 64 20 73 69 |the left| hand si|
|00005c90| 64 65 20 6f 66 20 73 6f | 6d 65 20 70 72 6f 64 75 |de of so|me produ|
|00005ca0| 63 74 69 6f 6e 20 6d 61 | 74 63 68 65 73 20 61 6e |ction ma|tches an|
|00005cb0| 20 69 6e 69 74 69 61 6c | 20 73 75 62 73 65 71 75 | initial| subsequ|
|00005cc0| 65 6e 63 65 0a 6f 66 20 | 74 68 65 20 73 63 72 61 |ence.of |the scra|
|00005cd0| 70 73 2e 0a 7b 5c 74 74 | 20 57 45 41 56 45 7d 20 |ps..{\tt| WEAVE} |
|00005ce0| 70 69 63 6b 73 20 74 68 | 65 20 66 69 72 73 74 20 |picks th|e first |
|00005cf0| 6d 61 74 63 68 69 6e 67 | 20 70 72 6f 64 75 63 74 |matching| product|
|00005d00| 69 6f 6e 2c 20 61 6e 64 | 20 7b 5c 65 6d 20 66 69 |ion, and| {\em fi|
|00005d10| 72 65 73 7d 20 69 74 2c | 0a 72 65 64 75 63 69 6e |res} it,|.reducin|
|00005d20| 67 20 74 68 65 20 73 63 | 72 61 70 73 20 64 65 73 |g the sc|raps des|
|00005d30| 63 72 69 62 65 64 20 69 | 6e 20 74 68 65 20 66 69 |cribed i|n the fi|
|00005d40| 72 69 6e 67 20 69 6e 73 | 74 72 75 63 74 69 6f 6e |ring ins|truction|
|00005d50| 73 20 74 6f 20 61 20 73 | 69 6e 67 6c 65 0a 73 63 |s to a s|ingle.sc|
|00005d60| 72 61 70 2c 20 61 6e 64 | 20 69 74 20 67 69 76 65 |rap, and| it give|
|00005d70| 73 20 74 68 65 20 6e 65 | 77 20 73 63 72 61 70 20 |s the ne|w scrap |
|00005d80| 74 68 65 20 7b 5c 65 6d | 20 74 61 72 67 65 74 20 |the {\em| target |
|00005d90| 63 61 74 65 67 6f 72 79 | 7d 2e 0a 54 68 65 20 74 |category|}..The t|
|00005da0| 72 61 6e 73 6c 61 74 69 | 6f 6e 20 6f 66 20 74 68 |ranslati|on of th|
|00005db0| 65 20 6e 65 77 20 73 63 | 72 61 70 20 69 73 20 66 |e new sc|rap is f|
|00005dc0| 6f 72 6d 65 64 20 62 79 | 20 63 6f 6e 63 61 74 65 |ormed by| concate|
|00005dd0| 6e 61 74 69 6e 67 20 74 | 68 65 0a 74 72 61 6e 73 |nating t|he.trans|
|00005de0| 6c 61 74 69 6f 6e 73 20 | 69 6e 20 74 68 65 20 7b |lations |in the {|
|00005df0| 5c 65 6d 20 66 69 72 69 | 6e 67 20 69 6e 73 74 72 |\em firi|ng instr|
|00005e00| 75 63 74 69 6f 6e 73 7d | 2c 20 77 68 65 72 65 20 |uctions}|, where |
|00005e10| 61 20 73 63 72 61 70 0a | 64 65 73 69 67 6e 61 74 |a scrap.|designat|
|00005e20| 6f 72 20 73 74 61 6e 64 | 73 20 66 6f 72 20 74 68 |or stand|s for th|
|00005e30| 65 20 74 72 61 6e 73 6c | 61 74 69 6f 6e 20 6f 66 |e transl|ation of|
|00005e40| 20 74 68 65 20 64 65 73 | 69 67 6e 61 74 65 64 20 | the des|ignated |
|00005e50| 73 63 72 61 70 2e 0a 0a | 48 65 72 65 20 69 73 20 |scrap...|Here is |
|00005e60| 74 68 65 20 73 79 6e 74 | 61 78 20 74 68 61 74 20 |the synt|ax that |
|00005e70| 64 65 73 63 72 69 62 65 | 73 20 63 6f 6e 74 65 78 |describe|s contex|
|00005e80| 74 73 2c 20 66 69 72 69 | 6e 67 20 69 6e 73 74 72 |ts, firi|ng instr|
|00005e90| 75 63 74 69 6f 6e 73 2c | 20 73 63 72 61 70 0a 64 |uctions,| scrap.d|
|00005ea0| 65 73 69 67 6e 61 74 6f | 72 73 2c 20 61 6e 64 20 |esignato|rs, and |
|00005eb0| 73 6f 20 6f 6e 2e 0a 5c | 62 65 67 69 6e 7b 71 75 |so on..\|begin{qu|
|00005ec0| 6f 74 65 7d 0a 5c 74 74 | 0a 5c 73 79 6e 74 61 78 |ote}.\tt|.\syntax|
|00005ed0| 7b 6c 65 66 74 20 63 6f | 6e 74 65 78 74 7d 20 5c |{left co|ntext} \|
|00005ee0| 70 72 6f 64 75 63 65 73 | 7e 5c 73 79 6e 74 61 78 |produces|~\syntax|
|00005ef0| 7b 73 63 72 61 70 20 64 | 65 73 69 67 6e 61 74 6f |{scrap d|esignato|
|00005f00| 72 73 7d 5c 5c 0a 5c 73 | 79 6e 74 61 78 7b 72 69 |rs}\\.\s|yntax{ri|
|00005f10| 67 68 74 20 63 6f 6e 74 | 65 78 74 7d 20 5c 70 72 |ght cont|ext} \pr|
|00005f20| 6f 64 75 63 65 73 7e 5c | 73 79 6e 74 61 78 7b 73 |oduces~\|syntax{s|
|00005f30| 63 72 61 70 20 64 65 73 | 69 67 6e 61 74 6f 72 73 |crap des|ignators|
|00005f40| 7d 5c 5c 0a 5c 73 79 6e | 74 61 78 7b 66 69 72 69 |}\\.\syn|tax{firi|
|00005f50| 6e 67 20 69 6e 73 74 72 | 75 63 74 69 6f 6e 7d 20 |ng instr|uction} |
|00005f60| 5c 70 72 6f 64 75 63 65 | 73 20 5c 73 79 6e 74 61 |\produce|s \synta|
|00005f70| 78 7b 73 63 72 61 70 20 | 64 65 73 69 67 6e 61 74 |x{scrap |designat|
|00005f80| 6f 72 7d 5c 5c 0a 5c 73 | 79 6e 74 61 78 7b 66 69 |or}\\.\s|yntax{fi|
|00005f90| 72 69 6e 67 20 69 6e 73 | 74 72 75 63 74 69 6f 6e |ring ins|truction|
|00005fa0| 7d 20 5c 70 72 6f 64 75 | 63 65 73 20 5c 73 79 6e |} \produ|ces \syn|
|00005fb0| 74 61 78 7b 74 72 61 6e | 73 6c 61 74 69 6f 6e 7d |tax{tran|slation}|
|00005fc0| 5c 5c 0a 5c 73 79 6e 74 | 61 78 7b 73 63 72 61 70 |\\.\synt|ax{scrap|
|00005fd0| 20 64 65 73 69 67 6e 61 | 74 6f 72 7d 20 5c 70 72 | designa|tor} \pr|
|00005fe0| 6f 64 75 63 65 73 7e 3f | 5c 5c 0a 5c 73 79 6e 74 |oduces~?|\\.\synt|
|00005ff0| 61 78 7b 73 63 72 61 70 | 20 64 65 73 69 67 6e 61 |ax{scrap| designa|
|00006000| 74 6f 72 7d 20 5c 70 72 | 6f 64 75 63 65 73 7e 5c |tor} \pr|oduces~\|
|00006010| 6f 70 74 7b 21 7d 5c 73 | 79 6e 74 61 78 7b 63 61 |opt{!}\s|yntax{ca|
|00006020| 74 65 67 6f 72 79 20 6e | 61 6d 65 7d 5c 6f 70 74 |tegory n|ame}\opt|
|00006030| 7b 2a 7d 5c 5c 0a 5c 73 | 79 6e 74 61 78 7b 73 63 |{*}\\.\s|yntax{sc|
|00006040| 72 61 70 20 64 65 73 69 | 67 6e 61 74 6f 72 7d 20 |rap desi|gnator} |
|00006050| 0a 20 20 20 5c 70 72 6f | 64 75 63 65 73 7e 5c 6f |. \pro|duces~\o|
|00006060| 70 74 7b 21 7d 5c 73 79 | 6e 74 61 78 7b 63 61 74 |pt{!}\sy|ntax{cat|
|00006070| 65 67 6f 72 79 20 61 6c | 74 65 72 6e 61 74 69 76 |egory al|ternativ|
|00006080| 65 73 7d 5c 6f 70 74 7b | 2a 7d 5c 5c 0a 5c 73 79 |es}\opt{|*}\\.\sy|
|00006090| 6e 74 61 78 7b 63 61 74 | 65 67 6f 72 79 20 61 6c |ntax{cat|egory al|
|000060a0| 74 65 72 6e 61 74 69 76 | 65 73 7d 20 0a 20 20 20 |ternativ|es} . |
|000060b0| 5c 70 72 6f 64 75 63 65 | 73 7e 5c 72 6c 61 70 7b |\produce|s~\rlap{|
|000060c0| 28 5c 73 79 6e 74 61 78 | 7b 6f 70 74 69 6f 6e 61 |(\syntax|{optiona|
|000060d0| 6c 20 61 6c 74 65 72 6e | 61 74 69 76 65 73 7d 5c |l altern|atives}\|
|000060e0| 73 79 6e 74 61 78 7b 63 | 61 74 65 67 6f 72 79 20 |syntax{c|ategory |
|000060f0| 6e 61 6d 65 7d 29 7d 5c | 5c 0a 5c 73 79 6e 74 61 |name})}\|\.\synta|
|00006100| 78 7b 6f 70 74 69 6f 6e | 61 6c 20 61 6c 74 65 72 |x{option|al alter|
|00006110| 6e 61 74 69 76 65 7d 20 | 5c 70 72 6f 64 75 63 65 |native} |\produce|
|00006120| 73 7e 5c 73 79 6e 74 61 | 78 7b 63 61 74 65 67 6f |s~\synta|x{catego|
|00006130| 72 79 20 6e 61 6d 65 7d | 7c 5c 5c 0a 5c 73 79 6e |ry name}||\\.\syn|
|00006140| 74 61 78 7b 74 61 72 67 | 65 74 20 63 61 74 65 67 |tax{targ|et categ|
|00006150| 6f 72 79 7d 20 5c 70 72 | 6f 64 75 63 65 73 7e 5c |ory} \pr|oduces~\|
|00006160| 23 5c 73 79 6e 74 61 78 | 7b 69 6e 74 65 67 65 72 |#\syntax|{integer|
|00006170| 7d 5c 5c 0a 5c 73 79 6e | 74 61 78 7b 74 61 72 67 |}\\.\syn|tax{targ|
|00006180| 65 74 20 63 61 74 65 67 | 6f 72 79 7d 20 5c 70 72 |et categ|ory} \pr|
|00006190| 6f 64 75 63 65 73 7e 5c | 73 79 6e 74 61 78 7b 63 |oduces~\|syntax{c|
|000061a0| 61 74 65 67 6f 72 79 20 | 6e 61 6d 65 7d 5c 5c 0a |ategory |name}\\.|
|000061b0| 5c 65 6e 64 7b 71 75 6f | 74 65 7d 0a 0a 5c 70 61 |\end{quo|te}..\pa|
|000061c0| 72 61 67 72 61 70 68 7b | 4d 61 74 63 68 69 6e 67 |ragraph{|Matching|
|000061d0| 20 74 68 65 20 6c 65 66 | 74 20 68 61 6e 64 20 73 | the lef|t hand s|
|000061e0| 69 64 65 20 6f 66 20 61 | 20 70 72 6f 64 75 63 74 |ide of a| product|
|000061f0| 69 6f 6e 7d 0a 57 68 65 | 6e 20 64 6f 65 73 20 61 |ion}.Whe|n does a|
|00006200| 20 73 65 71 75 65 6e 63 | 65 20 6f 66 20 73 63 72 | sequenc|e of scr|
|00006210| 61 70 73 20 6d 61 74 63 | 68 20 74 68 65 20 6c 65 |aps matc|h the le|
|00006220| 66 74 20 68 61 6e 64 20 | 73 69 64 65 20 6f 66 20 |ft hand |side of |
|00006230| 61 0a 70 72 6f 64 75 63 | 74 69 6f 6e 3f 0a 46 6f |a.produc|tion?.Fo|
|00006240| 72 20 6d 61 74 63 68 69 | 6e 67 20 70 75 72 70 6f |r matchi|ng purpo|
|00006250| 73 65 73 2c 20 77 65 20 | 63 61 6e 20 69 67 6e 6f |ses, we |can igno|
|00006260| 72 65 20 74 68 65 20 74 | 72 61 6e 73 6c 61 74 69 |re the t|ranslati|
|00006270| 6f 6e 73 20 61 6e 64 20 | 74 68 65 20 73 71 75 61 |ons and |the squa|
|00006280| 72 65 0a 62 72 61 63 6b | 65 74 73 7e 28 7b 5c 74 |re.brack|ets~({\t|
|00006290| 74 20 5b 5d 7d 29 2c 20 | 61 6e 64 20 6c 6f 6f 6b |t []}), |and look|
|000062a0| 20 61 74 20 74 68 65 20 | 6c 65 66 74 20 68 61 6e | at the |left han|
|000062b0| 64 20 73 69 64 65 20 6a | 75 73 74 20 61 73 20 61 |d side j|ust as a|
|000062c0| 20 73 65 71 75 65 6e 63 | 65 0a 6f 66 20 73 63 72 | sequenc|e.of scr|
|000062d0| 61 70 20 64 65 73 69 67 | 6e 61 74 6f 72 73 2e 0a |ap desig|nators..|
|000062e0| 41 20 73 65 71 75 65 6e | 63 65 20 6f 66 20 73 63 |A sequen|ce of sc|
|000062f0| 72 61 70 73 20 6d 61 74 | 63 68 65 73 20 61 20 73 |raps mat|ches a s|
|00006300| 65 71 75 65 6e 63 65 20 | 6f 66 20 73 63 72 61 70 |equence |of scrap|
|00006310| 20 64 65 73 69 67 6e 61 | 74 6f 72 73 20 69 66 20 | designa|tors if |
|00006320| 61 6e 64 0a 6f 6e 6c 79 | 20 69 66 20 65 61 63 68 |and.only| if each|
|00006330| 20 73 63 72 61 70 20 6f | 6e 20 74 68 65 20 73 65 | scrap o|n the se|
|00006340| 71 75 65 6e 63 65 20 6d | 61 74 63 68 65 73 20 74 |quence m|atches t|
|00006350| 68 65 20 63 6f 72 72 65 | 73 70 6f 6e 64 69 6e 67 |he corre|sponding|
|00006360| 20 73 63 72 61 70 0a 64 | 65 73 69 67 6e 61 74 6f | scrap.d|esignato|
|00006370| 72 2e 0a 48 65 72 65 20 | 61 72 65 20 74 68 65 20 |r..Here |are the |
|00006380| 72 75 6c 65 73 20 66 6f | 72 20 6d 61 74 63 68 69 |rules fo|r matchi|
|00006390| 6e 67 20 73 63 72 61 70 | 20 64 65 73 69 67 6e 61 |ng scrap| designa|
|000063a0| 74 6f 72 73 20 28 77 65 | 20 63 61 6e 0a 69 67 6e |tors (we| can.ign|
|000063b0| 6f 72 65 20 73 74 61 72 | 72 69 6e 67 25 0a 5c 66 |ore star|ring%.\f|
|000063c0| 6f 6f 74 6e 6f 74 65 7b | 41 20 63 61 74 65 67 6f |ootnote{|A catego|
|000063d0| 72 79 20 6e 61 6d 65 20 | 69 73 20 73 61 69 64 20 |ry name |is said |
|000063e0| 74 6f 20 62 65 20 7b 5c | 65 6d 20 73 74 61 72 72 |to be {\|em starr|
|000063f0| 65 64 7d 20 69 66 20 69 | 74 20 68 61 73 20 74 68 |ed} if i|t has th|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.