diff options
author | Jeffrey H. Kingston <jeff@it.usyd.edu.au> | 2010-09-14 20:37:12 +0000 |
---|---|---|
committer | Jeffrey H. Kingston <jeff@it.usyd.edu.au> | 2010-09-14 20:37:12 +0000 |
commit | a9f9ae0efa326dc2edc7f2d92ce270f5fdc15b60 (patch) | |
tree | 3f21ea75ffbd40fcd53bf1609782763af3953002 /doc/user/user.ps | |
parent | 162643f981292504f375a7f834d408a4a0fa7f46 (diff) | |
download | lout-a9f9ae0efa326dc2edc7f2d92ce270f5fdc15b60.tar.gz |
Lout 3.23.
git-svn-id: http://svn.savannah.nongnu.org/svn/lout/trunk@15 9365b830-b601-4143-9ba8-b4a8e2c3339c
Diffstat (limited to 'doc/user/user.ps')
-rw-r--r-- | doc/user/user.ps | 7070 |
1 files changed, 0 insertions, 7070 deletions
diff --git a/doc/user/user.ps b/doc/user/user.ps deleted file mode 100644 index 9cbcb3d..0000000 --- a/doc/user/user.ps +++ /dev/null @@ -1,7070 +0,0 @@ -%!PS-Adobe-3.0 -%%Creator: Basser Lout Version 3.20 (April 2000) -%%CreationDate: Mon Apr 24 13:08:28 2000 -%%DocumentData: Binary -%%DocumentNeededResources: (atend) -%%DocumentSuppliedResources: (atend) -%%DocumentMedia: A4 595 842 0 white () -%%PageOrder: Ascend -%%Pages: (atend) -%%BoundingBox: 0 0 595 842 -%%EndComments - -%%BeginProlog -%%BeginResource: procset LoutStartUp -/m { 3 1 roll moveto show } bind def -/mo { 3 1 roll moveto true charpath stroke } bind def -/s { exch currentpoint exch pop moveto show } bind def -/so { exch currentpoint exch pop moveto true charpath stroke } bind def -/k { exch neg 0 rmoveto show } bind def -/ko { exch neg 0 rmoveto true charpath stroke } bind def -/ul { gsave setlinewidth dup 3 1 roll - moveto lineto stroke grestore } bind def -/in { 1440 mul } def -/cm { 567 mul } def -/pt { 20 mul } def -/em { 120 mul } def -/sp { louts mul } def -/vs { loutv mul } def -/ft { loutf mul } def -/dg { } def - -/LoutGraphic { - /louts exch def - /loutv exch def - /loutf exch def - /ymark exch def - /xmark exch def - /ysize exch def - /xsize exch def -} def - -/LoutGr2 { gsave translate LoutGraphic gsave } def - -/LoutFont -{ findfont exch scalefont setfont -} bind def - -/LoutRecode { - { findfont dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding exch def - currentdict end definefont pop - } - stopped pop -} bind def - -/BeginEPSF { - /LoutEPSFState save def - /dict_count countdictstack def - /op_count count 1 sub def - userdict begin - /showpage { } def - 0 setgray 0 setlinecap - 1 setlinewidth 0 setlinejoin - 10 setmiterlimit [] 0 setdash newpath - /languagelevel where - { pop languagelevel - 1 ne - { false setstrokeadjust false setoverprint - } if - } if -} bind def - -/EndEPSF { - count op_count sub { pop } repeat - countdictstack dict_count sub { end } repeat - LoutEPSFState restore -} bind def -%%EndResource - -%%BeginResource: encoding vec2 -/vec2 [ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright -/parenleft /parenright /asterisk /plus /comma /hyphen /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/quoteleft /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/quotesinglbase /quotedblbase /ellipsis /OE /oe /quotedblleft /quotedblright /fi -/fl /endash /emdash /bullet /dagger /daggerdbl /florin /fraction -/dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent -/dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron -/space /exclamdown /cent /sterling /currency /yen /brokenbar /section -/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron -/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered -/cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown -/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla -/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis -/Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply -/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls -/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla -/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis -/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide -/oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis -] def -%%EndResource - -%%BeginResource: procset LoutTabPrependGraphic -% @PrependGraphic file /export/home/6monthspace/jeff/lout.lib/include/tabf.lpg -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% PostScript @SysPrependGraphic file for @Tab % -% % -% To assist in avoiding name clashes, the names % -% of all these symbols begin with "ltab". % -% % -% Jeffrey H. Kingston % -% 24 September 1991 % -% 22 December 1992 % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% linewidth ltabhs - -% horizontal single line -/ltabhs -{ 0 0 moveto xsize 0 lineto - setlinewidth 0 setlinecap stroke -} def - -% linewidth ltabhsp - -% horizontal single line with projecting ends -/ltabhsp -{ 0 0 moveto xsize 0 lineto - setlinewidth 2 setlinecap stroke -} def - -% linewidth ltabhd - -% horizontal double line -/ltabhd -{ dup dup - 0 0 moveto xsize 0 lineto - 0 exch 3 mul moveto xsize exch 3 mul lineto - setlinewidth 0 setlinecap stroke -} def - -% linewidth ltabhdb - -% horizontal double line below mark -/ltabhdb -{ dup dup - 0 0 moveto xsize 0 lineto - 0 exch -3 mul moveto xsize exch -3 mul lineto - setlinewidth 0 setlinecap stroke -} def - -% linewidth ltabhdnw - -% horizontal double line with northwest corner -/ltabhdnw -{ dup dup dup dup - 0 0 moveto xsize 0 lineto - xsize exch 3 mul moveto - -3 mul exch 3 mul lineto - -3 mul 0 lineto - setlinewidth 0 setlinejoin 2 setlinecap stroke -} def - -% linewidth ltabhdne - -% horizontal double line with northeast corner -/ltabhdne -{ dup dup dup dup - 0 0 moveto xsize 0 lineto - 0 exch 3 mul moveto - 3 mul xsize add exch 3 mul lineto - 3 mul xsize add 0 lineto - setlinewidth 0 setlinejoin 2 setlinecap stroke -} def - -% linewidth ltabhdsw - -% horizontal double line with southwest corner -/ltabhdsw -{ dup dup dup dup - 0 0 moveto xsize 0 lineto - xsize exch -3 mul moveto - -3 mul exch -3 mul lineto - -3 mul 0 lineto - setlinewidth 0 setlinejoin 2 setlinecap stroke -} def - -% linewidth ltabhdse - -% horizontal double line with southeast corner -/ltabhdse -{ dup dup dup dup - 0 0 moveto xsize 0 lineto - 0 exch -3 mul moveto - 3 mul xsize add exch -3 mul lineto - 3 mul xsize add 0 lineto - setlinewidth 0 setlinejoin 2 setlinecap stroke -} def - -% linewidth ltabvs - -% vertical single line -/ltabvs -{ 0 0 moveto 0 ysize lineto - setlinewidth 0 setlinecap stroke -} def - -% linewidth ltabvd - -% vertical double line -/ltabvd -{ dup dup - 0 0 moveto 0 ysize lineto - -3 mul 0 moveto -3 mul ysize lineto - setlinewidth 0 setlinecap stroke -} def - -% linewidth ltabvdr - -% vertical double line to right of mark -/ltabvdr -{ dup dup - 0 0 moveto 0 ysize lineto - 3 mul 0 moveto 3 mul ysize lineto - setlinewidth 0 setlinecap stroke -} def -%%EndResource - -%%BeginResource: procset LoutTblPrependGraphic -% @PrependGraphic file /export/home/6monthspace/jeff/lout.lib/include/tblf.lpg -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% PostScript @SysPrependGraphic file for @Tbl Jeffrey H. Kingston % -% Version 1.0 June 1998 % -% % -% To assist in avoiding name clashes, the names of all symbols % -% defined here begin with "ltbl". % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% painting (i.e. filling): - ltblwhite - (etc.) -/ltblnopaint { } def -/ltblnochange { fill } def -/ltbldarkblue { 0.0 0.0 0.5 setrgbcolor fill } def -/ltblblue { 0.0 0.0 1.0 setrgbcolor fill } def -/ltbllightblue { 0.5 0.5 1.0 setrgbcolor fill } def -/ltbldarkgreen { 0.0 0.5 0.0 setrgbcolor fill } def -/ltblgreen { 0.0 1.0 0.0 setrgbcolor fill } def -/ltbllightgreen { 0.5 1.0 0.5 setrgbcolor fill } def -/ltbldarkred { 0.5 0.0 0.0 setrgbcolor fill } def -/ltblred { 1.0 0.0 0.0 setrgbcolor fill } def -/ltbllightred { 1.0 0.5 0.5 setrgbcolor fill } def -/ltbldarkcyan { 0.0 0.5 0.5 setrgbcolor fill } def -/ltblcyan { 0.0 1.0 1.0 setrgbcolor fill } def -/ltbllightcyan { 0.5 1.0 1.0 setrgbcolor fill } def -/ltbldarkmagenta { 0.5 0.0 0.5 setrgbcolor fill } def -/ltblmagenta { 1.0 0.0 1.0 setrgbcolor fill } def -/ltbllightmagenta { 1.0 0.5 1.0 setrgbcolor fill } def -/ltbldarkyellow { 0.5 0.5 0.0 setrgbcolor fill } def -/ltblyellow { 1.0 1.0 0.0 setrgbcolor fill } def -/ltbllightyellow { 1.0 1.0 0.5 setrgbcolor fill } def -/ltbldarkgray { 0.2 0.2 0.2 setrgbcolor fill } def -/ltblgray { 0.5 0.5 0.5 setrgbcolor fill } def -/ltbllightgray { 0.8 0.8 0.8 setrgbcolor fill } def -/ltbldarkgrey { 0.2 0.2 0.2 setrgbcolor fill } def -/ltblgrey { 0.5 0.5 0.5 setrgbcolor fill } def -/ltbllightgrey { 0.8 0.8 0.8 setrgbcolor fill } def -/ltblblack { 0.0 0.0 0.0 setrgbcolor fill } def -/ltblwhite { 1.0 1.0 1.0 setrgbcolor fill } def -%%EndResource - -%%BeginResource: procset LoutFigPrependGraphic -% @PrependGraphic file /export/home/6monthspace/jeff/lout.lib/include/figf.lpg -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% PostScript @SysPrependGraphic file for @Fig Jeffrey H. Kingston % -% Version 2.0 (includes CIRCUM label) January 1992 % -% % -% To assist in avoiding name clashes, the names of all symbols % -% defined here begin with "lfig". However, this is not feasible % -% with user-defined labels and some labels used by users. % -% % -% <point> is two numbers, a point. % -% <length> is one number, a length % -% <angle> is one number, an angle in degrees % -% <dashlength> is one number, the preferred length of a dash % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -errordict begin - /handleerror - { - { /Times-Roman findfont 8 pt scalefont setfont - 0 setgray 4 pt 4 pt moveto - $error /errorname get - dup lfigdict exch known - { lfigdict exch get } - { 30 string cvs } ifelse - show - ( Command: ) show - $error /command get 30 string cvs show - } stopped {} if - showpage stop - } def -end - -% concat strings: <string> <string> lfigconcat <string> -% must be defined outside lfigdict since used in lfigpromotelabels -/lfigconcat -{ 2 copy length exch length add string - dup 0 4 index putinterval - dup 3 index length 3 index putinterval - 3 1 roll pop pop -} def - -% <string> lfigdebugprint - -% must be defined outside lfigdict since used in arbitrary places -% /lfigdebugprint -% { print -% (; operand stack:\n) print -% count copy -% count 2 idiv -% { == -% (\n) print -% } repeat -% (\n) print -% } def - -/lfigdict 120 dict def -lfigdict begin - -% error messages -/dictfull (dictfull error: too many labels?) def -/dictstackoverflow (dictstackoverflow error: labels nested too deeply?) def -/execstackoverflow (execstackoverflow error: figure nested too deeply?) def -/limitcheck (limitcheck error: figure nested too deeply or too large?) def -/syntaxerror (syntaxerror error: syntax error in text of figure?) def -/typecheck (typecheck error: syntax error in text of figure?) def -/undefined (undefined error: unknown or misspelt label?) def -/VMError (VMError error: run out of memory?) def - -% push pi onto stack: - lfigpi <num> -/lfigpi 3.14159 def - -% arc directions -/clockwise false def -/anticlockwise true def - -% maximum of two numbers: <num> <num> lfigmax <num> -/lfigmax { 2 copy gt { pop } { exch pop } ifelse } def - -% minimum of two numbers: <num> <num> lfigmin <num> -/lfigmin { 2 copy lt { pop } { exch pop } ifelse } def - -% add two points: <point> <point> lfigpadd <point> -/lfigpadd { exch 3 1 roll add 3 1 roll add exch } def - -% subtract first point from second: <point> <point> lfigpsub <point> -/lfigpsub { 3 2 roll sub 3 1 roll exch sub exch } def - -% max two points: <point> <point> lfigpmax <point> -/lfigpmax { exch 3 1 roll lfigmax 3 1 roll lfigmax exch } def - -% min two points: <point> <point> lfigpmin <point> -/lfigpmin { exch 3 1 roll lfigmin 3 1 roll lfigmin exch } def - -% scalar multiplication: <point> <num> lfigpmul <point> -/lfigpmul { dup 3 1 roll mul 3 1 roll mul exch } def - -% point at angle and distance: <point> <length> <angle> lfigatangle <point> -/lfigatangle { 2 copy cos mul 3 1 roll sin mul lfigpadd } def - -% angle from one point to another: <point> <point> lfigangle <angle> -/lfigangle { lfigpsub 2 copy 0 eq exch 0 eq and {pop} {exch atan} ifelse } def - -% distance between two points: <point> <point> lfigdistance <length> -/lfigdistance { lfigpsub dup mul exch dup mul add sqrt } def - -% difference in x coords: <point> <point> lfigxdistance <length> -/lfigxdistance { pop 3 1 roll pop sub } def - -%difference in y coords: <point> <point> lfigydistance <length> -/lfigydistance { 3 1 roll pop sub exch pop } def - -% stroke a solid line: <length> <dashlength> lfigsolid - -/lfigsolid -{ pop pop [] 0 setdash stroke -} def - -% stroke a lfigdashed line: <length> <dashlength> lfigdashed - -/lfigdashed -{ 2 copy div 2 le 1 index 0 le or - { exch pop 1 pt lfigmax [ exch dup ] 0 setdash } - { dup [ exch 4 2 roll 2 copy div - 1 sub 2 div ceiling dup 4 1 roll - 1 add mul sub exch div ] 0 setdash - } ifelse stroke -} def - -% stroke a lfigcdashed line: <length> <dashlength> lfigcdashed - -/lfigcdashed -{ 2 copy le 1 index 0 le or - { exch pop 1 pt lfigmax [ exch dup ] dup 0 get 2 div setdash } - { dup [ 4 2 roll exch 2 copy exch div - 2 div ceiling div 1 index sub - ] exch 2 div setdash - } ifelse stroke -} def - -% stroke a dotted line: <length> <dashlength> lfigdotted - -/lfigdotted -{ 2 copy le 1 index 0 le or - { exch pop 1 pt lfigmax [ exch 0 exch ] 0 setdash } - { 1 index exch div ceiling div - [ 0 3 2 roll ] 0 setdash - } ifelse stroke -} def - -% stroke a noline line: <length> <dashlength> lfignoline - -/lfignoline -{ pop pop -} def - -% painting (i.e. filling): - lfigwhite - (etc.) -/lfignopaint { } def -/lfignochange { fill } def -/lfigdarkblue { 0.0 0.0 0.5 setrgbcolor fill } def -/lfigblue { 0.0 0.0 1.0 setrgbcolor fill } def -/lfiglightblue { 0.5 0.5 1.0 setrgbcolor fill } def -/lfigdarkgreen { 0.0 0.5 0.0 setrgbcolor fill } def -/lfiggreen { 0.0 1.0 0.0 setrgbcolor fill } def -/lfiglightgreen { 0.5 1.0 0.5 setrgbcolor fill } def -/lfigdarkred { 0.5 0.0 0.0 setrgbcolor fill } def -/lfigred { 1.0 0.0 0.0 setrgbcolor fill } def -/lfiglightred { 1.0 0.5 0.5 setrgbcolor fill } def -/lfigdarkcyan { 0.0 0.5 0.5 setrgbcolor fill } def -/lfigcyan { 0.0 1.0 1.0 setrgbcolor fill } def -/lfiglightcyan { 0.5 1.0 1.0 setrgbcolor fill } def -/lfigdarkmagenta { 0.5 0.0 0.5 setrgbcolor fill } def -/lfigmagenta { 1.0 0.0 1.0 setrgbcolor fill } def -/lfiglightmagenta { 1.0 0.5 1.0 setrgbcolor fill } def -/lfigdarkyellow { 0.5 0.5 0.0 setrgbcolor fill } def -/lfigyellow { 1.0 1.0 0.0 setrgbcolor fill } def -/lfiglightyellow { 1.0 1.0 0.5 setrgbcolor fill } def -/lfigdarkgray { 0.2 0.2 0.2 setrgbcolor fill } def -/lfiggray { 0.5 0.5 0.5 setrgbcolor fill } def -/lfiglightgray { 0.8 0.8 0.8 setrgbcolor fill } def -/lfigdarkgrey { 0.2 0.2 0.2 setrgbcolor fill } def -/lfiggrey { 0.5 0.5 0.5 setrgbcolor fill } def -/lfiglightgrey { 0.8 0.8 0.8 setrgbcolor fill } def -/lfigblack { 0.0 0.0 0.0 setrgbcolor fill } def -/lfigwhite { 1.0 1.0 1.0 setrgbcolor fill } def - -% line caps (and joins, not currently used) -/lfigbutt 0 def -/lfiground 1 def -/lfigprojecting 2 def -/lfigmiter 0 def -/lfigbevel 2 def - -% shape and labels of the @Box symbol -/lfigbox -{ - 0 0 /SW lfigpointdef - xsize 0 /SE lfigpointdef - xsize ysize /NE lfigpointdef - 0 ysize /NW lfigpointdef - SE 0.5 lfigpmul /S lfigpointdef - NW 0.5 lfigpmul /W lfigpointdef - W SE lfigpadd /E lfigpointdef - S NW lfigpadd /N lfigpointdef - NE 0.5 lfigpmul /CTR lfigpointdef - [ CTR NE lfigpsub /lfigboxcircum cvx ] lfigcircumdef - SW SE NE NW SW -} def - -% shape and labels of the @CurveBox symbol -/lfigcurvebox -{ - - xsize 0.5 mul ysize 0.5 mul /CTR lfigpointdef - xsize 0.5 mul 0 /S lfigpointdef - xsize ysize 0.5 mul /E lfigpointdef - xsize 0.5 mul ysize /N lfigpointdef - 0 ysize 0.5 mul /W lfigpointdef - - xmark 0.293 mul xmark 0.293 mul /SW lfigpointdef - xsize xmark 0.293 mul sub xmark 0.293 mul /SE lfigpointdef - xsize xmark 0.293 mul sub ysize xmark 0.293 mul sub /NE lfigpointdef - xmark 0.293 mul ysize xmark 0.293 mul sub /NW lfigpointdef - - [ xsize ysize 0.5 lfigpmul xmark /lfigcurveboxcircum cvx ] lfigcircumdef - - xmark 0 - xsize xmark sub 0 - [ xsize xmark sub xmark ] - xsize xmark - xsize ysize xmark sub - [ xsize xmark sub ysize xmark sub ] - xsize xmark sub ysize - xmark ysize - [ xmark ysize xmark sub ] - 0 ysize xmark sub - 0 xmark - [ xmark xmark ] - xmark 0 -} def - -% shadow of the @ShadowBox symbol -% its shape and labels are done, somewhat inaccurately, with lfigbox -/lfigshadow -{ xmark 2 mul 0 moveto xsize 0 lineto - xsize ysize xmark 2 mul sub lineto - xsize xmark sub ysize xmark 2 mul sub lineto - xsize xmark sub xmark lineto - xmark 2 mul xmark lineto closepath fill -} def - -% shape and labels of the @Square symbol -/lfigsquare -{ - xsize ysize 0.5 lfigpmul /CTR lfigpointdef - CTR xsize xsize ysize ysize lfigpmax 0.5 lfigpmul lfigpadd /NE lfigpointdef - CTR 0 0 CTR NE lfigdistance 135 lfigatangle lfigpadd /NW lfigpointdef - CTR 0 0 CTR NE lfigdistance 225 lfigatangle lfigpadd /SW lfigpointdef - CTR 0 0 CTR NE lfigdistance 315 lfigatangle lfigpadd /SE lfigpointdef - SW 0.5 lfigpmul SE 0.5 lfigpmul lfigpadd /S lfigpointdef - NW 0.5 lfigpmul NE 0.5 lfigpmul lfigpadd /N lfigpointdef - SW 0.5 lfigpmul NW 0.5 lfigpmul lfigpadd /W lfigpointdef - SE 0.5 lfigpmul NE 0.5 lfigpmul lfigpadd /E lfigpointdef - [ CTR NE lfigpsub /lfigboxcircum cvx ] lfigcircumdef - SW SE NE NW SW -} def - -% shape and labels of the @Diamond symbol -/lfigdiamond -{ - xsize 0 0.5 lfigpmul /S lfigpointdef - 0 ysize 0.5 lfigpmul /W lfigpointdef - S W lfigpadd /CTR lfigpointdef - CTR W lfigpadd /N lfigpointdef - CTR S lfigpadd /E lfigpointdef - [ xsize ysize 0.5 lfigpmul /lfigdiamondcircum cvx ] lfigcircumdef - S E N W S -} def - -% shape and labels of the @Ellipse symbol -/lfigellipse -{ - xsize 0 0.5 lfigpmul /S lfigpointdef - 0 ysize 0.5 lfigpmul /W lfigpointdef - S W lfigpadd /CTR lfigpointdef - CTR W lfigpadd /N lfigpointdef - CTR S lfigpadd /E lfigpointdef - CTR xsize 0 0.3536 lfigpmul lfigpadd 0 ysize 0.3536 lfigpmul lfigpadd /NE lfigpointdef - 0 ysize 0.3536 lfigpmul CTR xsize 0 0.3536 lfigpmul lfigpadd lfigpsub /SE lfigpointdef - xsize 0 0.3536 lfigpmul CTR lfigpsub 0 ysize 0.3536 lfigpmul lfigpadd /NW lfigpointdef - 0 ysize 0.3536 lfigpmul xsize 0 0.3536 lfigpmul CTR lfigpsub lfigpsub /SW lfigpointdef - [ xsize ysize 0.5 lfigpmul /lfigellipsecircum cvx ] lfigcircumdef - S [ CTR ] E [ CTR ] N [ CTR ] W [ CTR ] S -} def - -% shape and labels of the @Circle symbol -/lfigcircle -{ - xsize ysize 0.5 lfigpmul /CTR lfigpointdef - CTR xsize 0 ysize 0 lfigpmax 0.5 lfigpmul lfigpadd /E lfigpointdef - CTR 0 0 CTR E lfigdistance 45 lfigatangle lfigpadd /NE lfigpointdef - CTR 0 0 CTR E lfigdistance 90 lfigatangle lfigpadd /N lfigpointdef - CTR 0 0 CTR E lfigdistance 135 lfigatangle lfigpadd /NW lfigpointdef - CTR 0 0 CTR E lfigdistance 180 lfigatangle lfigpadd /W lfigpointdef - CTR 0 0 CTR E lfigdistance 225 lfigatangle lfigpadd /SW lfigpointdef - CTR 0 0 CTR E lfigdistance 270 lfigatangle lfigpadd /S lfigpointdef - CTR 0 0 CTR E lfigdistance 315 lfigatangle lfigpadd /SE lfigpointdef - [ S E lfigpsub /lfigellipsecircum cvx ] lfigcircumdef - S [ CTR ] E [ CTR ] N [ CTR ] W [ CTR ] S -} def - -% shape and labels of the @HLine and @HArrow symbols -/lfighline -{ - 0 ymark lfigprevious /FROM lfigpointdef - xsize ymark lfigprevious /TO lfigpointdef -} def - -% shape and labels of the @VLine and @VArrow symbols -/lfigvline -{ - xmark ysize lfigprevious /FROM lfigpointdef - xmark 0 lfigprevious /TO lfigpointdef -} def - -% points of a polygon around base with given no of sides, vert init angle: -% <sides> <angle> figpolygon <point> ... <point> -/lfigpolygon -{ xsize ysize 0.5 lfigpmul /CTR lfigpointdef - 90 sub CTR 2 copy lfigmax 5 3 roll - [ 4 copy pop /lfigpolycircum cvx ] lfigcircumdef - exch dup 360 exch div exch - 1 1 3 2 roll - { 4 string cvs (P) exch lfigconcat cvn - 6 copy pop pop lfigatangle 2 copy 10 2 roll - 3 2 roll lfigpointdef - dup 3 1 roll add exch - } for - pop lfigatangle -} def - -% next array element: <array> <index> lfiggetnext <array> <index> <any> true -% or <array> <index> false -/lfiggetnext -{ 2 copy exch length ge - { false } - { 2 copy get exch 1 add exch true } ifelse -} def - -% check whether thing is number: <any> lfigisnumbertype <any> <bool> -/lfigisnumbertype -{ dup type dup - /integertype eq exch /realtype eq or -} def - -% check whether thing is an array: <any> lfigisarraytype <any> <bool> -/lfigisarraytype { dup type /arraytype eq } def - -% get next item: <array> <index> lfiggetnextitem <array> <index> 0 -% or <array> <index> <array> 1 -% or <array> <index> <point> 2 -/lfiggetnextitem -{ lfiggetnext - { lfigisarraytype - { 1 - } - { lfigisnumbertype - { 3 1 roll - lfiggetnext - { lfigisnumbertype - { 4 3 roll exch 2 - } - { pop 3 2 roll pop 0 - } ifelse - } - { 3 2 roll pop 0 - } ifelse - } - { pop 0 - } ifelse - } ifelse - } - { 0 - } ifelse -} def - -% set arc path: bool x1 y1 x2 y2 x0 y0 lfigsetarc <angle> <angle> <dist> -% the path goes from x1 y1 to x2 y2 about centre x0 y0, -% anticlockwise if bool is true else clockwise. -% The orientations of backwards pointing and forwards pointing -% arrowheads are returned in the two angles, and -% the length of the arc is returned in <dist>. -/lfigsetarc -{ - 20 dict begin - matrix currentmatrix 8 1 roll - 2 copy translate 2 copy 8 2 roll - 4 2 roll lfigpsub 6 2 roll lfigpsub - dup /y1 exch def dup mul /y1s exch def - dup /x1 exch def dup mul /x1s exch def - dup /y2 exch def dup mul /y2s exch def - dup /x2 exch def dup mul /x2s exch def - - y1s y2s eq - { -1 - } - { y1s x2s mul y2s x1s mul sub y1s y2s sub div - } ifelse - /da exch def - - x1s x2s eq - { -1 - } - { x1s y2s mul x2s y1s mul sub x1s x2s sub div - } ifelse - /db exch def - - da 0 gt db 0 gt and - { /LMax da sqrt db sqrt lfigmax def - /scalex da sqrt LMax div def - /scaley db sqrt LMax div def - scalex scaley scale - 0 0 LMax - 0 0 x1 scalex mul y1 scaley mul lfigangle - 0 0 x2 scalex mul y2 scaley mul lfigangle - 2 copy eq { 360 add } if - 2 copy 8 2 roll - 5 index { arc } { arcn } ifelse - 2 index 1 index - { 90 sub } { 90 add } ifelse - dup sin scaley mul exch cos scalex mul atan - 2 index 2 index - { 90 add } { 90 sub } ifelse - dup sin scaley mul exch cos scalex mul atan - 5 2 roll % res1 res2 ang1 ang2 anticlockwise - { exch sub } { sub } ifelse - dup 0 le { 360 add } if lfigpi mul LMax mul 180 div - } - { 0 0 x1 y1 lfigdistance 0 0 x2 y2 lfigdistance eq - 0 0 x1 y1 lfigdistance 0 gt and - { 0 0 - 0 0 x1 y1 lfigdistance - 0 0 x1 y1 lfigangle - 0 0 x2 y2 lfigangle - 2 copy eq { 360 add } if - 2 copy 8 2 roll - 5 index { arc } { arcn } ifelse - 2 index 1 index - { 90 sub } { 90 add } ifelse - 2 index 2 index - { 90 add } { 90 sub } ifelse - 5 2 roll % res1 res2 ang1 ang2 clockwise - { exch sub } { sub } ifelse - dup 0 le { 360 add } if lfigpi mul 0 0 x1 y1 lfigdistance mul 180 div - } - { x2 y2 lineto pop - x2 y2 x1 y1 lfigangle - x1 y1 x2 y2 lfigangle - x1 y1 x2 y2 lfigdistance - } ifelse - } ifelse - 4 -1 roll setmatrix - end -} def - -% lfigsetcurve: set up a Bezier curve from x0 y0 to x3 y3 -% and return arrowhead angles and length of curve (actually 0) -% x0 y0 x1 y1 x2 y2 x3 y3 lfigsetcurve <angle> <angle> <length> -/lfigsetcurve -{ 8 copy curveto pop pop - lfigangle - 5 1 roll - 4 2 roll lfigangle - exch - 0 -} def - -% lfigpaintpath: paint a path of the given shape -% /paint [ shape ] lfigpaintpath - -/lfigpaintpath -{ - 10 dict begin - 0 newpath - /prevseen false def - /curveseen false def - { lfiggetnextitem - dup 0 eq { pop exit } - { 1 eq - { /curveseen true def - /curve exch def - curve length 0 eq { /curveseen false def } if - } - { /ycurr exch def - /xcurr exch def - prevseen - { curveseen - { curve length 4 eq - { xprev yprev - curve 0 get curve 1 get - curve 2 get curve 3 get - xcurr ycurr - lfigsetcurve pop pop pop - } - { xprev yprev xcurr ycurr - curve length 1 ge { curve 0 get } { 0 } ifelse - curve length 2 ge { curve 1 get } { 0 } ifelse - curve length 3 ge { curve 2 get } { true } ifelse - 7 1 roll - lfigsetarc pop pop pop - } ifelse - } - { xcurr ycurr lineto - } ifelse - } - { xcurr ycurr moveto - } ifelse - /xprev xcurr def - /yprev ycurr def - /prevseen true def - /curveseen false def - } ifelse - } ifelse - } loop pop pop cvx exec - end -} def - -% stroke a path of the given shape in the given linestyle and dash length. -% Return the origin and angle of the backward and forward arrow heads. -% dashlength /linestyle [shape] lfigdopath [<point> <angle>] [<point> <angle>] -/lfigdopath -{ - 10 dict begin - 0 - /prevseen false def - /curveseen false def - /backarrow [] def - /fwdarrow [] def - { - lfiggetnextitem - dup 0 eq { pop exit } - { - 1 eq - { /curveseen true def - /curve exch def - curve length 0 eq { /prevseen false def } if - } - { /ycurr exch def - /xcurr exch def - prevseen - { newpath xprev yprev moveto - curveseen - { curve length 4 eq - { xprev yprev - curve 0 get curve 1 get - curve 2 get curve 3 get - xcurr ycurr lfigsetcurve - } - { xprev yprev xcurr ycurr - curve length 1 ge { curve 0 get } { 0 } ifelse - curve length 2 ge { curve 1 get } { 0 } ifelse - curve length 3 ge { curve 2 get } { true } ifelse - 7 1 roll - lfigsetarc - } ifelse - } - { xcurr ycurr lineto - xcurr ycurr xprev yprev lfigangle dup 180 sub - xprev yprev xcurr ycurr lfigdistance - } ifelse - 6 index 6 index cvx exec - [ xprev yprev 5 -1 roll ] - backarrow length 0 eq - { /backarrow exch def } - { pop } ifelse - [ xcurr ycurr 4 -1 roll ] /fwdarrow exch def - } if - /xprev xcurr def - /yprev ycurr def - /prevseen true def - /curveseen false def - } ifelse - } ifelse - } loop - pop pop pop pop - backarrow length 0 eq { [ 0 0 0 ] } { backarrow } ifelse - fwdarrow length 0 eq { [ 0 0 0 ] } { fwdarrow } ifelse - end -} def - -% lfigdoarrow: draw an arrow head of given form -% dashlength /lstyle /pstyle hfrac height width [ <point> <angle> ] lfigdoarrow - -/lfigdoarrow -{ matrix currentmatrix 8 1 roll - dup 0 get 1 index 1 get translate - 2 get rotate - [ 2 index neg 2 index 0 0 - 3 index 3 index neg - 1 index 10 index mul 0 - 7 index 7 index ] - 4 1 roll pop pop pop - dup 3 1 roll - gsave lfigpaintpath grestore lfigdopath pop pop - setmatrix -} def - -% arrow head styles -/lfigopen 0.0 def -/lfighalfopen 0.5 def -/lfigclosed 1.0 def - -% stroke no arrows, forward, back, and both -/lfignoarrow { pop pop pop pop pop pop pop pop } def -/lfigforward { 7 -1 roll lfigdoarrow pop } def -/lfigback { 8 -2 roll pop lfigdoarrow } def -/lfigboth { 8 -1 roll 7 copy lfigdoarrow pop 7 -1 roll lfigdoarrow } def - -% lfigprevious: return previous point on path -/lfigprevious -{ lfigisnumbertype - { 2 copy } - { lfigisarraytype - { 2 index 2 index } - { 0 0 } - ifelse - } ifelse -} def - -% label a point in 2nd top dictionary: <point> /name lfigpointdef - -/lfigpointdef -{ - % (Entering lfigpointdef) lfigdebugprint - [ 4 2 roll transform - /itransform cvx ] cvx - currentdict end - 3 1 roll - % currentdict length currentdict maxlength lt - % { def } - % { exec moveto (too many labels) show stop } - % ifelse - def - begin - % (Leaving lfigpointdef) lfigdebugprint -} def - -% promote labels from second top to third top dictionary -% <string> lfigpromotelabels - -/lfigpromotelabels -{ - % (Entering lfigpromotelabels) lfigdebugprint - currentdict end exch currentdict end - { exch 20 string cvs 2 index - (@) lfigconcat exch lfigconcat cvn exch def - } forall pop begin - % (Leaving lfigpromotelabels) lfigdebugprint -} def - -% show labels (except CIRCUM): - lfigshowlabels - -/lfigshowlabels -{ - % (Entering lfigshowlabels) lfigdebugprint - currentdict end - currentdict - { 1 index 20 string cvs (CIRCUM) search % if CIRCUM in key - { pop pop pop pop pop } - { pop cvx exec 2 copy - newpath 1.5 pt 0 360 arc - 0 setgray fill - /Times-Roman findfont 8 pt scalefont setfont - moveto 0.2 cm 0.1 cm rmoveto 20 string cvs show - } - ifelse - } forall - begin - % (Leaving lfigshowlabels) lfigdebugprint -} def - -% fix an angle to 0 <= res < 360: <angle> lfigfixangle <angle> -/lfigfixangle -{ - % (Entering lfigfixangle) lfigdebugprint - { dup 0 ge { exit } if - 360 add - } loop - { dup 360 lt { exit } if - 360 sub - } loop - % (Leaving lfigfixangle) lfigdebugprint -} def - -% find point on circumference of box: alpha a b lfigboxcircum x y -/lfigboxcircum -{ - % (Entering lfigboxcircum) lfigdebugprint - 4 dict begin - /b exch def - /a exch def - lfigfixangle /alpha exch def - 0 0 a b lfigangle /theta exch def - - % if alpha <= theta, return (a, a*tan(alpha)) - alpha theta le - { a a alpha sin mul alpha cos div } - { - % else if alpha <= 180 - theta, return (b*cot(alpha), b) - alpha 180 theta sub le - { b alpha cos mul alpha sin div b } - { - % else if alpha <= 180 + theta, return (-a, -a*tan(alpha)) - alpha 180 theta add le - { a neg a neg alpha sin mul alpha cos div } - { - % else if alpha <= 360 - theta, return (-b*cot(alpha), -b) - alpha 360 theta sub le - { b neg alpha cos mul alpha sin div b neg } - { - % else 360 - theta <= alpha, return (a, a*tan(alpha)) - a a alpha sin mul alpha cos div - } ifelse - } ifelse - } ifelse - } ifelse - end - % (Leaving lfigboxcircum) lfigdebugprint -} def - -% find quadratic roots (assume a != 0): a b c lfigqroots x1 x2 2 -% or x2 1 -% or 0 -/lfigqroots -{ - 4 dict begin - /c exch def - /b exch def - /a exch def - /disc b b mul 4 a c mul mul sub def - disc 0 lt - { 0 - } - { disc 0 eq - { b neg 2 a mul div - 1 - } - { b neg disc sqrt add 2 a mul div - b neg disc sqrt sub 2 a mul div - 2 - } - ifelse - } - ifelse - end -} def - -% work our which quadrant: <angle> lfigquadrant <0-3> -/lfigquadrant -{ dup 90 lt - { pop 0 - } - { dup 180 lt - { pop 1 - } - { 270 lt - { 2 - } - { 3 - } ifelse - } ifelse - } ifelse -} def - -% find curvebox circum, assuming upper right quadrant: alpha a b xmk lfigcb x y -/lfigcb -{ - 6 dict begin - /xmk exch def - /b exch def - /a exch def - /alpha exch def - /theta1 0 0 a b xmk sub lfigangle def - /theta2 0 0 a xmk sub b lfigangle def - alpha theta1 le - { % if alpha <= theta1, return (a, a*tan(alpha)) - a a alpha sin mul alpha cos div - } - { alpha theta2 ge - { % else if alpha > theta2, return (b*cot(alpha), b) - b alpha cos mul alpha sin div b - } - { - % else, return the intersection of line and circle - a xmk sub b xmk sub xmk 0 0 alpha lfigcircleintersect - dup 0 eq - { % should never happen, just return any reasonable point - pop - a b 0.5 lfigpmul - } - { 1 eq - { % should never happen, just return the point on top of stack - } - { % the usual case, two points on stack, return the larger - lfigpmax - } ifelse - } ifelse - } ifelse - } ifelse - end -} def - -% find point on circumference of curvebox: alpha a b xmk lfigcurveboxcircum x y -/lfigcurveboxcircum -{ - % (Entering lfigcurveboxcircum) lfigdebugprint - 5 dict begin - /xmk exch def - /b exch def - /a exch def - lfigfixangle /alpha exch def - - % work out which quadrant we are in, and reflect accordingly - /quad alpha lfigquadrant def - quad 0 eq - { alpha a b xmk lfigcb - } - { quad 1 eq - { 180 alpha sub a b xmk lfigcb exch neg exch - } - { quad 2 eq - { alpha 180 sub a b xmk lfigcb neg exch neg exch - } - { 360 alpha sub a b xmk lfigcb neg - } ifelse - } ifelse - } ifelse - end - % (Leaving lfigcurveboxcircum) lfigdebugprint -} def - -% find point on circumference of diamond: alpha a b lfigdiamondcircum x y -/lfigdiamondcircum -{ - % (Entering lfigdiamondcircum) lfigdebugprint - 4 dict begin - /b exch def - /a exch def - lfigfixangle /alpha exch def - b alpha cos abs mul a alpha sin abs mul add /denom exch def - a b mul alpha cos mul denom div - a b mul alpha sin mul denom div - end - % (Leaving lfigdiamondcircum) lfigdebugprint -} def - -% find point on circumference of ellipse: alpha a b lfigellipsecircum x y -/lfigellipsecircum -{ - % (Entering lfigellipsecircum) lfigdebugprint - 4 dict begin - /b exch def - /a exch def - lfigfixangle /alpha exch def - b alpha cos mul dup mul a alpha sin mul dup mul add sqrt /denom exch def - a b mul alpha cos mul denom div - a b mul alpha sin mul denom div - end - % (Leaving lfigellipsecircum) lfigdebugprint -} def - -% find point of intersection of two lines each defined by two points -% x1 y1 x2 y2 x3 y3 x4 y4 lfiglineintersect x y -/lfiglineintersect -{ - % (Entering lfiglineintersect) lfigdebugprint - 13 dict begin - /y4 exch def - /x4 exch def - /y3 exch def - /x3 exch def - /y2 exch def - /x2 exch def - /y1 exch def - /x1 exch def - x2 x1 sub /x21 exch def - x4 x3 sub /x43 exch def - y2 y1 sub /y21 exch def - y4 y3 sub /y43 exch def - y21 x43 mul y43 x21 mul sub /det exch def - - % calculate x - y21 x43 mul x1 mul - y43 x21 mul x3 mul sub - y3 y1 sub x21 mul x43 mul add - det div - - % calculate y - x21 y43 mul y1 mul - x43 y21 mul y3 mul sub - x3 x1 sub y21 mul y43 mul add - det neg div - - end - % (Leaving lfiglineintersect) lfigdebugprint -} def - -% find point on circumference of polygon -% alpha radius num theta lfigpolycircum x y -/lfigpolycircum -{ - % (Entering lfigpolycircum) lfigdebugprint - 13 dict begin - /theta exch def - /num exch def - /radius exch def - /alpha exch def - - % calculate delta, the angle from theta to alpha - alpha theta sub lfigfixangle - - % calculate the angle which is the multiple of 360/num closest to delta - 360 num div div truncate 360 num div mul theta add /anglea exch def - - % calculate the next multiple of 360/num after anglea - anglea 360 num div add /angleb exch def - - % intersect the line through these two points with the alpha line - anglea cos anglea sin angleb cos angleb sin - 0 0 alpha cos 2 mul alpha sin 2 mul - lfiglineintersect radius lfigpmul - - end - % (Leaving lfigpolycircum) lfigdebugprint -} def - -% find point of intersection of a point and a circle -% x0 y0 r x1 y1 theta lfigcircleintersect xa ya xb yb 2 -% or xb yb 1 -% or 0 -/lfigcircleintersect -{ - % (Entering lfigcircleintersect) lfigdebugprint - 15 dict begin - /theta exch def - /y1 exch def - /x1 exch def - /r exch def - /y0 exch def - /x0 exch def - - % if sin(theta) = 0 then line is horizontal and y must be y1 - theta sin abs 0.00001 lt - { - /a 1 def - /b -2 x0 mul def - /c x0 dup mul y1 y0 sub dup mul add r dup mul sub def - a b c lfigqroots dup - 0 eq - { pop - 0 - } - { 1 eq - { y1 1 - } - { y1 exch y1 2 - } ifelse - } ifelse - } - { - /ct theta cos theta sin div def - /a ct ct mul 1 add def - /b ct x1 x0 sub mul y1 add y0 sub 2 mul def - /c x1 x0 sub dup mul y1 y0 sub dup mul add r dup mul sub def - a b c lfigqroots dup - 0 eq - { pop - 0 - } - { 1 eq - { y1 add /yb exch def - yb y1 sub ct mul x1 add /xb exch def - xb yb 1 - } - { y1 add /ya exch def - ya y1 sub ct mul x1 add /xa exch def - y1 add /yb exch def - yb y1 sub ct mul x1 add /xb exch def - xa ya xb yb 2 - } ifelse - } ifelse - } ifelse - end - % (Leaving lfigcircleintersect) lfigdebugprint -} def - -% add CIRCUM operator with this body: <array> lfigcircumdef - -/lfigcircumdef -{ % (Entering lfigcircumdef) lfigdebugprint - /CIRCUM exch cvx - currentdict end - 3 1 roll - % currentdict length currentdict maxlength lt - % { def } - % { exec moveto (too many labels) show stop } - % ifelse - def - begin - % (Leaving lfigcircumdef) lfigdebugprint -} def - -end -%%EndResource - -%%BeginResource: procset LoutGraphPrependGraphic -% @PrependGraphic file /export/home/6monthspace/jeff/lout.lib/include/graphf.lpg -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% PostScript @SysPrependGraphic file for @Graph (Version 1.0) % -% % -% Version 1.0 by Jeffrey H. Kingston, December 1993. % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -errordict begin - /handleerror - { - { /Times-Roman findfont 8 pt scalefont setfont - 0 setgray 4 pt 4 pt moveto - $error /errorname get - dup lgraphdict exch known - { lgraphdict exch get } - { 30 string cvs } ifelse - show - ( Command: ) show - $error /command get 30 string cvs show - } stopped {} if - showpage stop - } def -end - -/lgraphdict 200 dict def -lgraphdict begin - -% error messages -/dictfull (dictfull error) def -/dictstackoverflow (dictstackoverflow error) def -/execstackoverflow (execstackoverflow error: expression too complex?) def -/limitcheck (limitcheck error: graph too complex or too large?) def -/syntaxerror (syntaxerror error: syntax error in text of graph?) def -/typecheck (typecheck error: syntax error in text of graph?) def -/undefined (undefined error: unknown or misspelt symbol?) def -/rangecheck (rangecheck error: undefined expression (e.g. divide by zero)?) def -/VMError (VMError error: run out of memory?) def - -% random number between x and y inclusive: x y dorand num -/dorand { 1 index sub 1 add rand exch mod add } def - -% log to given base: base num dolog num -/dolog { ln exch ln div } def - -% maximum of two numbers: <num> <num> max <num> -/max { 2 copy gt { pop } { exch pop } ifelse } def - -% add two points: <point> <point> padd <point> -/padd { exch 3 1 roll add 3 1 roll add exch } def - -% subtract first point from second: <point> <point> psub <point> -/psub { 3 2 roll sub 3 1 roll exch sub exch } def - -% distance between two points: <point> <point> distance <length> -/distance { psub dup mul exch dup mul add sqrt } def - -% point at angle and distance: <point> <length> <angle> atangle <point> -/atangle { 2 copy cos mul 3 1 roll sin mul padd } def - -% angle from one point to another: <point> <point> angle <angle> -/angle { psub 2 copy 0 eq exch 0 eq and {pop} {exch atan} ifelse } def - - -% set up for line -% - linesetup <length> <dashlength> -/linesetup -{ newpath - xcurr ycurr trpoint xprev yprev trpoint - 4 copy moveto lineto distance dashlength -} def - -% set up for icon-avoiding line -% - ilinesetup <length> <dashlength> -/ilinesetup -{ newpath - xprev yprev trpoint xcurr ycurr trpoint 4 copy - 4 copy angle symbolsize 1.5 mul exch 4 2 roll pop pop atangle - 6 2 roll 4 2 roll - 4 copy angle symbolsize 1.5 mul exch 4 2 roll pop pop atangle - 4 copy moveto lineto distance dashlength -} def - - -% stroke a solid line: <length> <dashlength> solid - -/solid -{ pop pop [] 0 setdash linewidth setlinewidth stroke -} def - -% stroke a dashed line: <length> <dashlength> dashed - -/dashed -{ 2 copy 2 mul le 1 index 0 le or - { exch pop 1 pt max [ exch dup ] 0 setdash } - { dup [ exch 4 2 roll 2 copy div - 1 sub 2 div ceiling dup 4 1 roll - 1 add mul sub exch div ] 0 setdash - } ifelse linewidth setlinewidth stroke -} def - -% stroke a cdashed line: <length> <dashlength> cdashed - -/cdashed -{ 2 copy le 1 index 0 le or - { exch pop 1 pt max [ exch dup ] dup 0 get 2 div setdash } - { dup [ 4 2 roll exch 2 copy exch div - 2 div ceiling div 1 index sub - ] exch 2 div setdash - } ifelse linewidth setlinewidth stroke -} def - -% stroke a dotted line: <length> <dashlength> dotted - -/dotted -{ 2 copy le 1 index 0 le or - { exch pop 1 pt max [ exch 0 exch ] 0 setdash } - { 1 index exch div ceiling div 0.99999 mul - [ 0 3 2 roll ] 0 setdash - } ifelse gsave 1 setlinecap linewidth setlinewidth stroke grestore newpath -} def - -% stroke a noline line: <length> <dashlength> noline - -/noline -{ pop pop -} def - -% stroke a y histogram: - yhisto - -/yhisto -{ xprev yleft trpoint yextra sub moveto - xprev yprev trpoint lineto - xcurr yprev trpoint lineto - xcurr yleft trpoint yextra sub lineto - linewidth setlinewidth stroke -} def - -% stroke an x histogram: - xhisto - -/xhisto -{ xleft yprev trpoint exch xextra sub exch moveto - xcurr yprev trpoint lineto - xcurr ycurr trpoint lineto - xleft ycurr trpoint exch xextra sub exch lineto - linewidth setlinewidth stroke -} def - -% stroke a surface y histogram: - surfaceyhisto - -/surfaceyhisto -{ firstpair - { xprev yleft trpoint yextra sub moveto - xprev yprev trpoint lineto - } - { xprev yprev trpoint moveto - } ifelse - xcurr yprev trpoint lineto - lastpair - { xcurr yleft trpoint yextra sub lineto - } - { xcurr ycurr trpoint lineto - } ifelse - linewidth setlinewidth stroke -} def - -% stroke a surface x histogram: - surfacexhisto - -/surfacexhisto -{ firstpair - { xleft yprev trpoint exch xextra sub exch moveto - } - { xprev yprev trpoint moveto - } ifelse - xcurr yprev trpoint lineto - xcurr ycurr trpoint lineto - lastpair - { xleft ycurr trpoint exch xextra sub exch lineto - } if - linewidth setlinewidth stroke -} def - -% stroke a filled y histogram: - filledyhisto - -/filledyhisto -{ - linewidth setlinewidth - xprev yleft trpoint exch currentlinewidth 2 div add exch yextra sub moveto - xprev yprev trpoint exch currentlinewidth 2 div add exch lineto - xcurr yprev trpoint exch currentlinewidth 2 div sub exch lineto - xcurr yleft trpoint exch currentlinewidth 2 div sub exch yextra sub lineto - closepath fill -} def - -% stroke a filled x histogram: - filledxhisto - -/filledxhisto -{ - linewidth setlinewidth - xleft yprev trpoint currentlinewidth 2 div add exch xextra sub exch moveto - xcurr yprev trpoint currentlinewidth 2 div add lineto - xcurr ycurr trpoint currentlinewidth 2 div sub lineto - xleft ycurr trpoint currentlinewidth 2 div sub exch xextra sub exch lineto - closepath fill -} def - - -% cross: show a small cross -/cross -{ newpath - xcurr ycurr trpoint moveto - symbolsize neg symbolsize neg rmoveto - symbolsize 2 mul symbolsize 2 mul rlineto - 0 symbolsize -2 mul rmoveto - symbolsize -2 mul symbolsize 2 mul rlineto - [] 0 setdash stroke -} def - -% plus: show a small plus -/plus -{ newpath - xcurr ycurr trpoint moveto - symbolsize neg 0 rmoveto - symbolsize 2 mul 0 rlineto - symbolsize neg symbolsize neg rmoveto - 0 symbolsize 2 mul rlineto - [] 0 setdash stroke -} def - -% square: show a small square -/square -{ newpath - xcurr ycurr trpoint moveto - symbolsize neg symbolsize neg rmoveto - symbolsize 2 mul 0 rlineto - 0 symbolsize 2 mul rlineto - symbolsize -2 mul 0 rlineto - closepath [] 0 setdash stroke -} def - -% filledsquare: show a small filled square -/filledsquare -{ newpath - xcurr ycurr trpoint moveto - symbolsize neg symbolsize neg rmoveto - symbolsize 2 mul 0 rlineto - 0 symbolsize 2 mul rlineto - symbolsize -2 mul 0 rlineto - closepath gsave [] 0 setdash stroke grestore fill -} def - -% diamond: show a small diamond -/diamond -{ newpath - xcurr ycurr trpoint moveto - symbolsize neg 0 rmoveto - symbolsize symbolsize neg rlineto - symbolsize symbolsize rlineto - symbolsize neg symbolsize rlineto - closepath [] 0 setdash stroke -} def - -% filleddiamond: show a small filled diamond -/filleddiamond -{ newpath - xcurr ycurr trpoint moveto - symbolsize neg 0 rmoveto - symbolsize symbolsize neg rlineto - symbolsize symbolsize rlineto - symbolsize neg symbolsize rlineto - closepath gsave [] 0 setdash stroke grestore fill -} def - -% circle: show a small circle -/circle -{ newpath - xcurr ycurr trpoint symbolsize 0 360 arc [] 0 setdash stroke -} def - -% filledcircle: show a small filled circle -/filledcircle -{ newpath - xcurr ycurr trpoint symbolsize 0 360 arc gsave [] 0 setdash stroke grestore fill -} def - -% triangle: show a small triangle -/triangle -{ newpath - xcurr ycurr trpoint moveto - 0 symbolsize 1.5 mul rmoveto - symbolsize neg symbolsize -2.5 mul rlineto - symbolsize 2 mul 0 rlineto - closepath [] 0 setdash stroke -} def - -% filledtriangle: show a small filled triangle -/filledtriangle -{ newpath - xcurr ycurr trpoint moveto - 0 symbolsize 1.5 mul rmoveto - symbolsize neg symbolsize -2.5 mul rlineto - symbolsize 2 mul 0 rlineto - closepath gsave [] 0 setdash stroke grestore fill -} def - - -%plog: like log only with a base, and protected from failing if <= 0 -% base x plog res -/plog { dup 0 le { pop pop 0 } { ln exch ln div } ifelse } def - -% xtr: transform one x value logarithmically if xlog > 1 -% <num> xtr <num> -/xtr -{ xlog 1 gt - { xlog exch plog - } if -} def - -% ytr: transform one y value logarithmically if ylog > 1 -% <num> ytr <num> -/ytr -{ ylog 1 gt - { ylog exch plog - } if -} def - -% % trpoint: transform (x, y) in graph space into (x', y') in print space -% % x y trpoint x' y' -% /trpoint -% { exch xtr trxmin sub trxmax trxmin sub div xwidth mul xextra add -% exch ytr trymin sub trymax trymin sub div ywidth mul yextra add -% } def - - -% trpoint: transform (x, y) in graph space into (x', y') in print space -% x y trpoint x' y' -/trpoint -{ exch xtr xdecr { trxmax exch sub } { trxmin sub } ifelse - trxmax trxmin sub div xwidth mul xextra add - - exch ytr ydecr { trymax exch sub } { trymin sub } ifelse - trymax trymin sub div ywidth mul yextra add -} def - - -% yonly: interpolate x values 1, 2, ... into data -% [ data ] yonly [ newdata ] -/yonly -{ dup /tmp exch def - length [ exch 1 exch 1 exch - { dup tmp exch 1 sub get - } for - ] -} def - -% xonly: interpolate y values 1, 2, ... into data -% [ data ] yonly [ newdata ] -/xonly -{ dup /tmp exch def - length [ exch 1 exch 1 exch - { dup tmp exch 1 sub get exch - } for - ] -} def - -% xandy: no interpolation of x or y values -% [ data ] xandy [ data ] -/xandy {} def - - -% expstringwidth: calculate width of string containing optional exponent -% <string> expstringwidth <width> -/expstringwidth -{ (^) search - { exch pop stringwidth pop exch stringwidth pop 0.7 mul add } - { stringwidth pop } - ifelse -} def - -% expstringshow: show string containing optional exponent -% <string> expstringshow - -/expstringshow -{ (^) search - { exch pop show 0 0.5 ft rmoveto - gsave currentfont 0.7 scalefont setfont show grestore - } - { show - } - ifelse -} def - -% concatenate two strings: <string> <string> strconcat <string> -/strconcat -{ 2 copy length exch length add string - dup 0 4 index putinterval - dup 3 index length 3 index putinterval - 3 1 roll pop pop -} def - -% lgen: generate one label automatically -% num lgen num string -/lgen { dup 20 string cvs } def - -% loglgen: generate one logarithmic label (with exponent) -% <base> <exponent> loglgen <string> -/loglgen -{ 20 string cvs exch 20 string cvs - (^) strconcat exch strconcat -} def - - -% printxtick: print one x tick -% xpos printxtick - -/printxtick -{ newpath - yleft trpoint moveto 0 yextra neg rmoveto - 0 xticklength neg rlineto [] 0 setdash stroke -} def - -% printxlabel: print one x label -% (xlabel) xpos printxlabel - -/printxlabel -{ yleft trpoint moveto 0 yextra neg rmoveto - 0 xticklength neg rmoveto 0 0.9 ft neg rmoveto - xlog 1 gt { 0 0.3 ft neg rmoveto } if - dup expstringwidth -2 div 0 rmoveto expstringshow -} def - -% printytick: print one y tick -% ypos printytick - -/printytick -{ newpath - xleft exch trpoint moveto xextra neg 0 rmoveto - yticklength neg 0 rlineto [] 0 setdash stroke -} def - -% printylabel: print one y label -% (ylabel) ypos printylabel - -/printylabel -{ xleft exch trpoint moveto xextra neg 0 rmoveto - yticklength neg 0 rmoveto -0.3 ft -0.3 ft rmoveto - dup expstringwidth neg 0 rmoveto expstringshow -} def - -% printrtick: print one r tick -% ypos printrtick - -/printrtick -{ newpath - xright exch trpoint moveto xextra 0 rmoveto - rticklength 0 rlineto [] 0 setdash stroke -} def - -% printrlabel: print one r label -% (rlabel) ypos printrlabel - -/printrlabel -{ xright exch trpoint moveto xextra 0 rmoveto - rticklength 0 rmoveto 0.3 ft -0.3 ft rmoveto - expstringshow -} def - -% printticks: print ticks and labels -% /tickproc /labelproc [ tickandlabeldata ] min printticks - -/printticks -{ /prev exch def - { dup type dup dup /integertype eq exch /realtype eq or - { pop dup /prev exch def 2 index cvx exec - } - { /stringtype eq - { prev 2 index cvx exec - } - { pop - } ifelse - } ifelse - } forall - pop pop -} def - - -% printxaxistick: print one x axis tick -% xpos printxaxistick - -/printxaxistick -{ newpath - yaxis trpoint moveto 0 xticklength -2 div rmoveto - 0 xticklength rlineto [] 0 setdash stroke -} def - -% printxaxislabel: print one x axis label -% (xlabel) xpos printxaxislabel - -/printxaxislabel -{ yaxis trpoint moveto - 0 xticklength -2 div rmoveto 0 0.9 ft neg rmoveto - xlog 1 gt { 0 0.3 ft neg rmoveto } if - dup expstringwidth -2 div 0 rmoveto expstringshow -} def - -% printyaxistick: print one y axis tick -% ypos printyaxistick - -/printyaxistick -{ newpath - xaxis exch trpoint moveto - yticklength -2 div 0 rmoveto - yticklength 0 rlineto [] 0 setdash stroke -} def - -% printyaxislabel: print one y axis label -% (ylabel) ypos printyaxislabel - -/printyaxislabel -{ xaxis exch trpoint moveto - yticklength -2 div 0 rmoveto -0.3 ft -0.3 ft rmoveto - dup expstringwidth neg 0 rmoveto expstringshow -} def - - -% <val> minmax - -% perform minv := min(minv, val); maxv := max(maxv, val) -% allowing for the possibility of minv, maxv, val being false (undefined) -/minmax -{ dup false eq - { pop } - { minv false eq - { dup /minv exch def /maxv exch def } - { dup minv lt - { /minv exch def } - { dup maxv gt - { /maxv exch def } - { pop } - ifelse - } ifelse - } ifelse - } ifelse -} def - -% <ticks> ticksundef <ticks> <bool> -% returns true iff the ticks array is undefined (one false entry) -/ticksundef -{ dup length 1 eq - { dup 0 get false eq - } - { false } - ifelse -} def - -% <number> integral <boolean> -% true if the number has an integral value -/integral { dup round eq } def - -% ticksep ticks xory alldata minval maxval axis base ticksandlimits ticks min max base -% ticksandlimits: sort out value of x or y ticks and limits and log base -/ticksandlimits -{ /base exch def - /minv false def - /maxv false def - - % min and max of user-supplied minval, maxval, and axis - minmax minmax minmax - - % min and max of data points - { 0 get dup dup length 1 sub 3 index exch 2 exch - { get minmax dup - } for pop pop - } forall - pop dup - - % min and max of tick values - { dup type /stringtype eq - { pop } { minmax } ifelse - } forall - - % fix minv and maxv if undefined (false) or equal - minv false eq - { /minv -1 def /maxv 1 def } - { minv maxv eq - { minv 0 lt - { /minv 2 minv mul def /maxv 0 def - } - { minv 0 eq - { /minv -1 def /maxv 1 def - } - { /minv 0 def /maxv 2 maxv mul def - } ifelse - } ifelse - } if - } ifelse - - % invent ticks if undefined - ticksundef - { pop /ticksep exch def - - % if base is reasonable and minv is positive, logarithmic ticks - base 1 gt minv 0 gt and - { - % get integral log of minv and maxv - /logminv base minv plog floor cvi def - /logmaxv base maxv plog ceiling cvi def - - % if minv close to base, make it 1; reset minv and maxv - logminv 1 eq logmaxv 4 ge and { /logminv 0 def } if - /minv base logminv exp def - /maxv base logmaxv exp def - - % ticks := [ base**logminv, ... , base**logmaxv ] - [ logminv 1 logmaxv - { dup base exch exp - exch base exch loglgen - } for - ] - } - { % non-logarithmic ticks - { - % fix tick separation if undefined (0) or too small - /base 0 def - /delta maxv minv sub def - ticksep delta 30 div le - { /ticksep 10 delta log 1 sub ceiling exp def - ticksep delta 2 div ge - { /ticksep ticksep 2 div def } - { ticksep delta 5 div lt - { /ticksep 2 ticksep mul def - } if - } ifelse - } if - - % adjust minv and maxv to be multiples of ticksep - /minv minv ticksep div floor ticksep mul def - /maxv maxv ticksep div ceiling ticksep mul def - /delta maxv minv sub def - - % if minv or maxv near zero, move to zero and redo - minv ticksep eq - { /minv 0 def } - { maxv ticksep neg eq { /maxv 0 def } { exit } ifelse - } ifelse - } loop - - % if minv, maxv, and ticksep are all integral, set "makeint" to true - /makeint minv integral maxv integral ticksep integral and and def - - % ticks := [ minv, minv+ticksep, ... , maxv ] - [ 0 1 delta ticksep div round - { ticksep mul minv add makeint { cvi } if lgen } - for - ] - } ifelse - } - { exch pop - } ifelse - minv maxv base -} def - -% xset: set up all data for x axis, including limits and ticks -% xticksep xticks 0 alldata xmin xmax xlog xextra xdecr xaxis xticklength xset - -/xset -{ /xticklength exch def - /xaxis exch def - /xdecr exch def - /xextra exch def - xaxis exch ticksandlimits - /xlog exch def /xmax exch def /xmin exch def /xticks exch def - /xleft xdecr { xmax } { xmin } ifelse def - /xright xdecr { xmin } { xmax } ifelse def - /xwidth xsize xextra 2 mul sub def - /trxmin xmin xtr def /trxmax xmax xtr def -} def - -% yset: set up all data for y axis, including limits and yticks -% yticksep yticks 0 alldata ymin ymax ylog yextra ydecr yaxis yticklength yset - -/yset -{ /yticklength exch def - /yaxis exch def - /ydecr exch def - /yextra exch def - yaxis exch ticksandlimits - /ylog exch def /ymax exch def /ymin exch def /yticks exch def - /yleft ydecr { ymax } { ymin } ifelse def - /yright ydecr { ymin } { ymax } ifelse def - /ywidth ysize yextra 2 mul sub def - /trymin ymin ytr def /trymax ymax ytr def -} def - -% rset: set up all data for y axis (again), but including limits and rticks -% rticksep rticks 0 alldata ymin ymax ylog yextra ydecr yaxis rticklength rset - -/rset -{ /rticklength exch def - /yaxis exch def - /ydecr exch def - /yextra exch def - yaxis exch ticksandlimits - /ylog exch def /ymax exch def /ymin exch def /rticks exch def - /yleft ydecr { ymax } { ymin } ifelse def - /yright ydecr { ymin } { ymax } ifelse def - /ywidth ysize yextra 2 mul sub def - /trymin ymin ytr def /trymax ymax ytr def -} def - -% norset: set up data for no rticks -% - norset - -/norset -{ /rticklength 0 def - /rticks [] def -} def - -% framestyle: print a frame around the graph -/framestyle -{ 0 0 moveto xsize 0 lineto xsize ysize lineto - 0 ysize lineto closepath stroke - /printxtick /printxlabel xticks xleft printticks - /printytick /printylabel yticks ymin printticks - /printrtick /printrlabel rticks ymin printticks -} def - -% nonestyle: print nothing around the graph -/nonestyle -{ -} def - -% axesstyle: print axes for the graph (unless axis values missing) -/axesstyle -{ - xaxis false eq yaxis false eq or - { framestyle } - { xaxis yaxis trpoint dup 0 exch moveto xsize exch lineto - dup 0 moveto ysize lineto stroke - /printxaxistick /printxaxislabel xticks xleft printticks - /printyaxistick /printyaxislabel yticks ymin printticks - } ifelse -} def - -% rundata: run all data sets -/rundata -{ alldata - { gsave - dup dup dup dup - 4 get /dopaint exch def - 3 get /initrun exch def - 2 get /pairs exch def - 1 get /points exch def - 0 get /data exch def - dopaint - { data length 4 ge - { initrun - newpath - data 0 get ymin trpoint yextra sub moveto - 0 2 data length 2 sub - { dup 1 add - data exch get /ycurr exch def - data exch get /xcurr exch def - xcurr ycurr trpoint lineto - } for - data dup length 2 sub get ymin trpoint yextra sub lineto - closepath fill - } if - } if - initrun - data length 2 ge - { - /xcurr data 0 get def - /ycurr data 1 get def - points - data length 4 ge - { 2 2 data length 2 sub - { /xprev xcurr def - /yprev ycurr def - dup dup 2 eq /firstpair exch def - data length 2 sub eq /lastpair exch def - dup 1 add - data exch get /ycurr exch def - data exch get /xcurr exch def - pairs - points - } for - } if - } if - grestore - } forall -} def - -end -%%EndResource - -%%BeginResource: procset LoutFigPrependGraphic -% @PrependGraphic file /export/home/6monthspace/jeff/lout.lib/include/diagf.lpg -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% PostScript @SysPrependGraphic file for @Diag Jeffrey H. Kingston % -% Version 2.0 (includes CIRCUM label) September 1996 % -% % -% To assist in avoiding name clashes, the names of all symbols % -% defined here begin with "ldiag". However, this is not feasible % -% with user-defined labels and some labels used by users. % -% % -% <point> is two numbers, a point. % -% <length> is one number, a length % -% <angle> is one number, an angle in degrees % -% <dashlength> is one number, the preferred length of a dash % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -errordict begin - /handleerror - { - { /Times-Roman findfont 8 pt scalefont setfont - 0 setgray 4 pt 4 pt moveto - $error /errorname get - dup ldiagdict exch known - { ldiagdict exch get } - { 50 string cvs } ifelse - show - ( Command: ) show - $error /command get 50 string cvs show - } stopped {} if - showpage stop - } def -end - -% begin diagram: <maxlabels> ldiagbegin - -% must be defined outside ldiagdict since it loads it -/ldiagbegin -{ xsize 0 0 ysize ldiagdict begin - 5 -1 roll /ldiagmaxlabels exch def - (@Diag) ldiagpushtagdict - /OOY ldiagpointdef /OOX ldiagpointdef 0 0 /OOO ldiagpointdef -} def - -% end diagram: - ldiagend - -/ldiagend -{ ldiagpoptagdict end -} def - -% concat strings: <string> <string> ldiagconcat <string> -% must be defined outside ldiagdict since used in ldiagpromotelabels -/ldiagconcat -{ 2 copy length exch length add string - dup 0 4 index putinterval - dup 3 index length 3 index putinterval - 3 1 roll pop pop -} def - -/ldiagdebugposy 432 def -/ldiagdebugposx 72 def - -% <string> <int> ldiagdebugprint - -% must be defined outside ldiagdict since used in arbitrary places -% print count or <int> stack entries, which ever is the smaller -/ldiagdebugprint -{ - exch - gsave - initgraphics - ldiagdebugposy 72 lt - { /ldiagdebugposx ldiagdebugposx 144 add store - /ldiagdebugposy 432 store - } - { - /ldiagdebugposy ldiagdebugposy 12 sub store - } ifelse - ldiagdebugposx ldiagdebugposy moveto - /Times-Roman findfont 10 scalefont setfont - 0 setgray show - count 1 sub 2 copy lt { pop } { exch pop } ifelse 1 sub - 0 exch 1 exch - { - /ldiagdebugposy ldiagdebugposy 12 sub store - ldiagdebugposx 12 add ldiagdebugposy moveto - index 50 string cvs show - } for - grestore -} def - -/ldiagdict 200 dict def -ldiagdict begin - -% error messages -/dictfull (dictfull error: too many labels?) def -/dictstackoverflow (dictstackoverflow error: labels nested too deeply?) def -/execstackoverflow (execstackoverflow error: figure nested too deeply?) def -/limitcheck (limitcheck error: figure nested too deeply or too large?) def -/syntaxerror (syntaxerror error: syntax error in text of figure?) def -/typecheck (typecheck error: syntax error in text of figure?) def -/undefined (undefined error: unknown or misspelt label?) def -/VMError (VMError error: run out of memory?) def - -% push pi onto stack: - ldiagpi <num> -/ldiagpi 3.14159 def - -% push e onto stack: - ldiage <num> -/ldiage 2.71828 def - -% arc directions -/clockwise false def -/anticlockwise true def - -% test equality between two angles: <angle> <angle> ldiagangleeq <bool> -/ldiagangleeq { ldiagfixangle exch ldiagfixangle eq } def - -% test inequality between two angles: <angle> <angle> ldiaganglene <bool> -/ldiaganglene { ldiagangleeq not } def - -% maximum of two numbers: <num> <num> ldiagmax <num> -/ldiagmax { 2 copy gt { pop } { exch pop } ifelse } def - -% minimum of two numbers: <num> <num> ldiagmin <num> -/ldiagmin { 2 copy lt { pop } { exch pop } ifelse } def - -% add two points: <point> <point> ldiagpadd <point> -/ldiagpadd -{ - % (Entering padd) 4 ldiagdebugprint - exch 3 1 roll add 3 1 roll add exch - % (Leaving padd) 2 ldiagdebugprint -} def - -% subtract first point from second: <point> <point> ldiagpsub <point> -/ldiagpsub { 3 2 roll sub 3 1 roll exch sub exch } def - -% max two points: <point> <point> ldiagpmax <point> -/ldiagpmax { exch 3 1 roll ldiagmax 3 1 roll ldiagmax exch } def - -% min two points: <point> <point> ldiagpmin <point> -/ldiagpmin { exch 3 1 roll ldiagmin 3 1 roll ldiagmin exch } def - -% scalar multiplication: <point> <num> ldiagpmul <point> -/ldiagpmul { dup 3 1 roll mul 3 1 roll mul exch } def - -% point at angle and distance: <point> <length> <angle> ldiagatangle <point> -/ldiagatangle { 2 copy cos mul 3 1 roll sin mul ldiagpadd } def - -% angle from one point to another: <point> <point> ldiagangleto <angle> -/ldiagangleto { ldiagpsub 2 copy 0 eq exch 0 eq and {pop} {exch atan} ifelse } def - -% distance between two points: <point> <point> ldiagdistance <length> -/ldiagdistance { ldiagpsub dup mul exch dup mul add sqrt } def - -% stroke a solid line: <length> <dashlength> ldiagsolid - -/ldiagsolid -{ pop pop [] 0 setdash 1 setlinecap stroke -} def - -% stroke a dashed line: <length> <dashlength> ldiagdashed - -/ldiagdashed -{ 2 copy div 2 le 1 index 0 le or - { exch pop 1 pt ldiagmax [ exch dup ] 0 setdash } - { dup [ exch 4 2 roll 2 copy div - 1 sub 2 div ceiling dup 4 1 roll - 1 add mul sub exch div ] 0 setdash - } ifelse 0 setlinecap stroke -} def - -% stroke a cdashed line: <length> <dashlength> ldiagcdashed - -/ldiagcdashed -{ % (Entering ldiagcdashed) 2 ldiagdebugprint - 2 copy le 1 index 0 le or - { exch pop 1 pt ldiagmax [ exch dup ] dup 0 get 2 div setdash } - { dup [ 4 2 roll exch 2 copy exch div - 2 div ceiling div 1 index sub - ] exch 2 div setdash - } ifelse 0 setlinecap stroke - % (Leaving ldiagcdashed) 0 ldiagdebugprint -} def - -% stroke a dotted line: <length> <dashlength> ldiagdotted - -/ldiagdotted -{ 2 copy le 1 index 0 le or - { exch pop 1 pt ldiagmax [ exch 0 exch ] 0 setdash } - { 1 index exch div ceiling div - [ 0 3 2 roll ] 0 setdash - } ifelse 1 setlinecap stroke -} def - -% stroke a noline line: <length> <dashlength> ldiagnoline - -/ldiagnoline -{ pop pop -} def - -% painting (i.e. filling): - ldiagwhite - (etc.) -/ldiagnopaint { } def -/ldiagnochange { fill } def -/ldiagdarkblue { 0.0 0.0 0.5 setrgbcolor fill } def -/ldiagblue { 0.0 0.0 1.0 setrgbcolor fill } def -/ldiaglightblue { 0.5 0.5 1.0 setrgbcolor fill } def -/ldiagdarkgreen { 0.0 0.5 0.0 setrgbcolor fill } def -/ldiaggreen { 0.0 1.0 0.0 setrgbcolor fill } def -/ldiaglightgreen { 0.5 1.0 0.5 setrgbcolor fill } def -/ldiagdarkred { 0.5 0.0 0.0 setrgbcolor fill } def -/ldiagred { 1.0 0.0 0.0 setrgbcolor fill } def -/ldiaglightred { 1.0 0.5 0.5 setrgbcolor fill } def -/ldiagdarkcyan { 0.0 0.5 0.5 setrgbcolor fill } def -/ldiagcyan { 0.0 1.0 1.0 setrgbcolor fill } def -/ldiaglightcyan { 0.5 1.0 1.0 setrgbcolor fill } def -/ldiagdarkmagenta { 0.5 0.0 0.5 setrgbcolor fill } def -/ldiagmagenta { 1.0 0.0 1.0 setrgbcolor fill } def -/ldiaglightmagenta { 1.0 0.5 1.0 setrgbcolor fill } def -/ldiagdarkyellow { 0.5 0.5 0.0 setrgbcolor fill } def -/ldiagyellow { 1.0 1.0 0.0 setrgbcolor fill } def -/ldiaglightyellow { 1.0 1.0 0.5 setrgbcolor fill } def -/ldiagdarkgray { 0.2 0.2 0.2 setrgbcolor fill } def -/ldiaggray { 0.5 0.5 0.5 setrgbcolor fill } def -/ldiaglightgray { 0.8 0.8 0.8 setrgbcolor fill } def -/ldiagdarkgrey { 0.2 0.2 0.2 setrgbcolor fill } def -/ldiaggrey { 0.5 0.5 0.5 setrgbcolor fill } def -/ldiaglightgrey { 0.8 0.8 0.8 setrgbcolor fill } def -/ldiagblack { 0.0 0.0 0.0 setrgbcolor fill } def -/ldiagwhite { 1.0 1.0 1.0 setrgbcolor fill } def - -% shape and labels of the @Box symbol -/ldiagbox -{ - 0 0 /SW ldiagpointdef - xsize 0 /SE ldiagpointdef - xsize ysize /NE ldiagpointdef - 0 ysize /NW ldiagpointdef - SE 0.5 ldiagpmul /S ldiagpointdef - NW 0.5 ldiagpmul /W ldiagpointdef - W SE ldiagpadd /E ldiagpointdef - S NW ldiagpadd /N ldiagpointdef - NE 0.5 ldiagpmul /CTR ldiagpointdef - - 0 dg /S@ANGLE ldiagangledef - 45 dg /SE@ANGLE ldiagangledef - 90 dg /E@ANGLE ldiagangledef - 135 dg /NE@ANGLE ldiagangledef - 180 dg /N@ANGLE ldiagangledef - 225 dg /NW@ANGLE ldiagangledef - 270 dg /W@ANGLE ldiagangledef - 315 dg /SW@ANGLE ldiagangledef - - [ CTR NE ldiagpsub /ldiagboxcircum cvx ] ldiagcircumdef - SW SE NE NW SW -} def - -% shape and labels of the @CurveBox symbol -% <margin> ldiagcurvebox <shape> -/ldiagcurvebox -{ - - % (Entering ldiagcurvebox) 1 ldiagdebugprint - ldiagdecodelength /cbmgn exch def - - xsize 0.5 mul ysize 0.5 mul /CTR ldiagpointdef - xsize 0.5 mul 0 /S ldiagpointdef - xsize ysize 0.5 mul /E ldiagpointdef - xsize 0.5 mul ysize /N ldiagpointdef - 0 ysize 0.5 mul /W ldiagpointdef - - cbmgn 0.293 mul cbmgn 0.293 mul /SW ldiagpointdef - xsize cbmgn 0.293 mul sub cbmgn 0.293 mul /SE ldiagpointdef - xsize cbmgn 0.293 mul sub ysize cbmgn 0.293 mul sub /NE ldiagpointdef - cbmgn 0.293 mul ysize cbmgn 0.293 mul sub /NW ldiagpointdef - - 0 dg /S@ANGLE ldiagangledef - 45 dg /SE@ANGLE ldiagangledef - 90 dg /E@ANGLE ldiagangledef - 135 dg /NE@ANGLE ldiagangledef - 180 dg /N@ANGLE ldiagangledef - 225 dg /NW@ANGLE ldiagangledef - 270 dg /W@ANGLE ldiagangledef - 315 dg /SW@ANGLE ldiagangledef - - [ xsize ysize 0.5 ldiagpmul cbmgn /ldiagcurveboxcircum cvx ] ldiagcircumdef - - cbmgn 0 - xsize cbmgn sub 0 - [ xsize cbmgn sub cbmgn ] - xsize cbmgn - xsize ysize cbmgn sub - [ xsize cbmgn sub ysize cbmgn sub ] - xsize cbmgn sub ysize - cbmgn ysize - [ cbmgn ysize cbmgn sub ] - 0 ysize cbmgn sub - 0 cbmgn - [ cbmgn cbmgn ] - cbmgn 0 - - % (Leaving ldiagcurvebox) 0 ldiagdebugprint -} def - -% shadow of the @ShadowBox symbol -% its shape and labels are done, somewhat inaccurately, with ldiagbox -% <shadowmargin> ldiagshadow - -/ldiagshadow -{ - /lfshm exch def - - lfshm 0 moveto - 0 lfshm neg rlineto - xsize 0 rlineto - 0 ysize rlineto - lfshm neg 0 rlineto - xsize 0 lineto - closepath fill - -} def - -% shape and labels of the @Square symbol -/ldiagsquare -{ - xsize ysize 0.5 ldiagpmul /CTR ldiagpointdef - CTR xsize xsize ysize ysize ldiagpmax 0.5 ldiagpmul ldiagpadd /NE ldiagpointdef - CTR 0 0 CTR NE ldiagdistance 135 ldiagatangle ldiagpadd /NW ldiagpointdef - CTR 0 0 CTR NE ldiagdistance 225 ldiagatangle ldiagpadd /SW ldiagpointdef - CTR 0 0 CTR NE ldiagdistance 315 ldiagatangle ldiagpadd /SE ldiagpointdef - SW 0.5 ldiagpmul SE 0.5 ldiagpmul ldiagpadd /S ldiagpointdef - NW 0.5 ldiagpmul NE 0.5 ldiagpmul ldiagpadd /N ldiagpointdef - SW 0.5 ldiagpmul NW 0.5 ldiagpmul ldiagpadd /W ldiagpointdef - SE 0.5 ldiagpmul NE 0.5 ldiagpmul ldiagpadd /E ldiagpointdef - - 0 dg /S@ANGLE ldiagangledef - 45 dg /SE@ANGLE ldiagangledef - 90 dg /E@ANGLE ldiagangledef - 135 dg /NE@ANGLE ldiagangledef - 180 dg /N@ANGLE ldiagangledef - 225 dg /NW@ANGLE ldiagangledef - 270 dg /W@ANGLE ldiagangledef - 315 dg /SW@ANGLE ldiagangledef - - [ CTR NE ldiagpsub /ldiagboxcircum cvx ] ldiagcircumdef - SW SE NE NW SW -} def - -% shape and labels of the @Diamond symbol -/ldiagdiamond -{ - xsize 0 0.5 ldiagpmul /S ldiagpointdef - 0 ysize 0.5 ldiagpmul /W ldiagpointdef - S W ldiagpadd /CTR ldiagpointdef - CTR W ldiagpadd /N ldiagpointdef - CTR S ldiagpadd /E ldiagpointdef - E N ldiagpadd 0.5 ldiagpmul /NE ldiagpointdef - N W ldiagpadd 0.5 ldiagpmul /NW ldiagpointdef - S W ldiagpadd 0.5 ldiagpmul /SW ldiagpointdef - S E ldiagpadd 0.5 ldiagpmul /SE ldiagpointdef - - 0 dg /S@ANGLE ldiagangledef - 90 dg /E@ANGLE ldiagangledef - 180 dg /N@ANGLE ldiagangledef - 270 dg /W@ANGLE ldiagangledef - S E ldiagangleto /SE@ANGLE ldiagangledef - E N ldiagangleto /NE@ANGLE ldiagangledef - N W ldiagangleto /NW@ANGLE ldiagangledef - W S ldiagangleto /SW@ANGLE ldiagangledef - - [ xsize ysize 0.5 ldiagpmul /ldiagdiamondcircum cvx ] ldiagcircumdef - S E N W S -} def - -% shape and labels of the @Ellipse symbol -/ldiagellipse -{ - xsize 0 0.5 ldiagpmul /S ldiagpointdef - 0 ysize 0.5 ldiagpmul /W ldiagpointdef - S W ldiagpadd /CTR ldiagpointdef - CTR W ldiagpadd /N ldiagpointdef - CTR S ldiagpadd /E ldiagpointdef - CTR xsize 0 0.3536 ldiagpmul ldiagpadd 0 ysize 0.3536 ldiagpmul ldiagpadd /NE ldiagpointdef - 0 ysize 0.3536 ldiagpmul CTR xsize 0 0.3536 ldiagpmul ldiagpadd ldiagpsub /SE ldiagpointdef - xsize 0 0.3536 ldiagpmul CTR ldiagpsub 0 ysize 0.3536 ldiagpmul ldiagpadd /NW ldiagpointdef - 0 ysize 0.3536 ldiagpmul xsize 0 0.3536 ldiagpmul CTR ldiagpsub ldiagpsub /SW ldiagpointdef - [ xsize ysize 0.5 ldiagpmul /ldiagellipsecircum cvx ] ldiagcircumdef - - 0 dg /S@ANGLE ldiagangledef - 90 dg /E@ANGLE ldiagangledef - 180 dg /N@ANGLE ldiagangledef - 270 dg /W@ANGLE ldiagangledef - - S E ldiagangleto /SE@ANGLE ldiagangledef - E N ldiagangleto /NE@ANGLE ldiagangledef - N W ldiagangleto /NW@ANGLE ldiagangledef - W S ldiagangleto /SW@ANGLE ldiagangledef - - S [ CTR ] E [ CTR ] N [ CTR ] W [ CTR ] S -} def - -% shape and labels of the @Circle symbol -/ldiagcircle -{ - xsize ysize 0.5 ldiagpmul /CTR ldiagpointdef - CTR xsize 0 ysize 0 ldiagpmax 0.5 ldiagpmul ldiagpadd /E ldiagpointdef - CTR 0 0 CTR E ldiagdistance 45 ldiagatangle ldiagpadd /NE ldiagpointdef - CTR 0 0 CTR E ldiagdistance 90 ldiagatangle ldiagpadd /N ldiagpointdef - CTR 0 0 CTR E ldiagdistance 135 ldiagatangle ldiagpadd /NW ldiagpointdef - CTR 0 0 CTR E ldiagdistance 180 ldiagatangle ldiagpadd /W ldiagpointdef - CTR 0 0 CTR E ldiagdistance 225 ldiagatangle ldiagpadd /SW ldiagpointdef - CTR 0 0 CTR E ldiagdistance 270 ldiagatangle ldiagpadd /S ldiagpointdef - CTR 0 0 CTR E ldiagdistance 315 ldiagatangle ldiagpadd /SE ldiagpointdef - [ S E ldiagpsub /ldiagellipsecircum cvx ] ldiagcircumdef - - 0 dg /S@ANGLE ldiagangledef - 45 dg /SE@ANGLE ldiagangledef - 90 dg /E@ANGLE ldiagangledef - 135 dg /NE@ANGLE ldiagangledef - 180 dg /N@ANGLE ldiagangledef - 225 dg /NW@ANGLE ldiagangledef - 270 dg /W@ANGLE ldiagangledef - 315 dg /SW@ANGLE ldiagangledef - - S [ CTR ] E [ CTR ] N [ CTR ] W [ CTR ] S -} def - -% shape and labels of the @VLine and @VArrow symbols -/ldiagvline -{ - xmark ysize ldiagprevious /FROM ldiagpointdef - xmark 0 ldiagprevious /TO ldiagpointdef -} def - -% points of a polygon around base with given no of sides, vert init angle: -% <sides> <angle> ldiagpolygon <point> ... <point> -/ldiagpolygon -{ exch round cvi exch - xsize ysize 0.5 ldiagpmul /CTR ldiagpointdef - 90 sub CTR 2 copy ldiagmax 5 3 roll - [ 4 copy pop /ldiagpolycircum cvx ] ldiagcircumdef - exch dup 360 exch div exch - 1 1 3 2 roll - { 4 string cvs (P) exch ldiagconcat - 3 copy exch pop (@ANGLE) ldiagconcat cvn exch 90 add exch ldiagangledef - cvn 6 copy pop pop ldiagatangle 2 copy 10 2 roll - 3 2 roll ldiagpointdef - dup 3 1 roll add exch - } for - pop ldiagatangle -} def - -% shape and labels of the @Isosceles triangle symbol -/ldiagisosceles -{ - xsize ysize 0.5 ldiagpmul /CTR ldiagpointdef - 0 0 /SW ldiagpointdef - xsize 0 /SE ldiagpointdef - xsize 0.5 mul ysize /N ldiagpointdef - xsize 0.5 mul 0 /S ldiagpointdef - SE 0.5 ldiagpmul N 0.5 ldiagpmul ldiagpadd /NE ldiagpointdef - SW 0.5 ldiagpmul N 0.5 ldiagpmul ldiagpadd /NW ldiagpointdef - - [ xsize ysize /ldiagisoscelescircum cvx ] ldiagcircumdef - - 0 dg /SW@ANGLE ldiagangledef - 0 dg /SE@ANGLE ldiagangledef - 180 dg /N@ANGLE ldiagangledef - 0 dg /S@ANGLE ldiagangledef - SE N ldiagangleto /NE@ANGLE ldiagangledef - N SW ldiagangleto /NW@ANGLE ldiagangledef - - SW SE N SW -} def - -% next array element: <array> <index> ldiaggetnext <array> <index> <any> true -% or <array> <index> false -/ldiaggetnext -{ 2 copy exch length ge - { false } - { 2 copy get exch 1 add exch true } ifelse -} def - -% check whether thing is number: <any> ldiagisnumbertype <any> <bool> -/ldiagisnumbertype -{ dup type dup - /integertype eq exch /realtype eq or -} def - -% check whether thing is an array: <any> ldiagisarraytype <any> <bool> -/ldiagisarraytype { dup type /arraytype eq } def - -% check whether thing is an array: <any> ldiagisnametype <any> <bool> -/ldiagisnametype { dup type /nametype eq } def - -% get next item: <array> <index> ldiaggetnextitem <array> <index> 0 -% or <array> <index> <array> 1 -% or <array> <index> <point> 2 -/ldiaggetnextitem -{ ldiaggetnext - { ldiagisarraytype - { 1 - } - { ldiagisnumbertype - { 3 1 roll - ldiaggetnext - { ldiagisnumbertype - { 4 3 roll exch 2 - } - { pop 3 2 roll pop 0 - } ifelse - } - { 3 2 roll pop 0 - } ifelse - } - { pop 0 - } ifelse - } ifelse - } - { 0 - } ifelse -} def - -% approximate equality: num1 num2 approxeq <boolean> -/approxeq -{ dup 0 eq - { pop 0 eq - } - { dup 3 1 roll sub exch div abs 0.001 lt - } ifelse -} def - -% set arc path: bool x1 y1 x2 y2 x0 y0 ldiagsetarc <angle> <angle> <dist> -% the path goes from x1 y1 to x2 y2 about centre x0 y0, -% anticlockwise if bool is true else clockwise. -% The orientations of backwards pointing and forwards pointing -% arrowheads are returned in the two angles, and -% the length of the arc is returned in <dist>. -/ldiagsetarc -{ - % (Entering ldiagsetarc) 7 ldiagdebugprint - 20 dict begin - matrix currentmatrix 8 1 roll - 2 copy translate 2 copy 8 2 roll - 4 2 roll ldiagpsub 6 2 roll ldiagpsub - dup /y1 exch def dup mul /y1s exch def - dup /x1 exch def dup mul /x1s exch def - dup /y2 exch def dup mul /y2s exch def - dup /x2 exch def dup mul /x2s exch def - /dist1 0 0 x1 y1 ldiagdistance def - /dist2 0 0 x2 y2 ldiagdistance def - - y1s y2s approxeq - { -1 - } - { y1s x2s mul y2s x1s mul sub y1s y2s sub div - } ifelse - /da exch def - - x1s x2s approxeq - { -1 - } - { x1s y2s mul x2s y1s mul sub x1s x2s sub div - } ifelse - /db exch def - - da 0 gt db 0 gt and - { - % ( case 1, ellipse) 0 ldiagdebugprint - /LMax da sqrt db sqrt ldiagmax def - /scalex da sqrt LMax div def - /scaley db sqrt LMax div def - scalex scaley scale - 0 0 LMax - 0 0 x1 scalex mul y1 scaley mul ldiagangleto - 0 0 x2 scalex mul y2 scaley mul ldiagangleto - 2 copy eq { 360 add } if - 2 copy 8 2 roll - 5 index { arc } { arcn } ifelse - 2 index 1 index - { 90 sub } { 90 add } ifelse - dup sin scaley mul exch cos scalex mul atan - 2 index 2 index - { 90 add } { 90 sub } ifelse - dup sin scaley mul exch cos scalex mul atan - 5 2 roll % res1 res2 ang1 ang2 anticlockwise - { exch sub } { sub } ifelse - dup 0 le { 360 add } if ldiagpi mul LMax mul 180 div - } - { - dist1 dist2 approxeq - % x1 y1 dist1 ( x1 y1, d) 3 ldiagdebugprint pop pop pop - % x2 y2 dist2 ( x2 y2, d) 3 ldiagdebugprint pop pop pop - { - % ( case 2, circle) 0 ldiagdebugprint - 0 0 - dist1 - 0 0 x1 y1 ldiagangleto - 0 0 x2 y2 ldiagangleto - 2 copy eq { 360 add } if - 2 copy 8 2 roll - 5 index { arc } { arcn } ifelse - 2 index 1 index - { 90 sub } { 90 add } ifelse - 2 index 2 index - { 90 add } { 90 sub } ifelse - 5 2 roll % res1 res2 ang1 ang2 clockwise - { exch sub } { sub } ifelse - dup 0 le { 360 add } if - ldiagpi mul dist1 mul 180 div - } - { - % ( case 3, line) 0 ldiagdebugprint - x2 y2 lineto pop - x2 y2 x1 y1 ldiagangleto - x1 y1 x2 y2 ldiagangleto - x1 y1 x2 y2 ldiagdistance - } ifelse - } ifelse - 4 -1 roll setmatrix - end - % (Leaving ldiagsetarc) 3 ldiagdebugprint -} def - -% ldiagsetcurve: set up a Bezier curve from x0 y0 to x3 y3 -% and return arrowhead angles and length of curve (actually 0) -% x0 y0 x1 y1 x2 y2 x3 y3 ldiagsetcurve <angle> <angle> <length> -/ldiagsetcurve -{ 8 copy curveto pop pop - ldiagangleto - 5 1 roll - 4 2 roll ldiagangleto - exch - 0 -} def - -% ldiagsetpath: convert a Diag path into a PostScript path -% [ shape ] ldiagsetpath -/ldiagsetpath -{ - 10 dict begin - 0 newpath - /prevseen false def - /curveseen false def - { ldiaggetnextitem - dup 0 eq { pop exit } - { 1 eq - { /curveseen true def - /curve exch def - curve length 0 eq { /curveseen false def } if - } - { /ycurr exch def - /xcurr exch def - prevseen - { curveseen - { curve length 4 eq - { xprev yprev - curve 0 get curve 1 get - curve 2 get curve 3 get - xcurr ycurr - ldiagsetcurve pop pop pop - } - { xprev yprev xcurr ycurr - curve length 1 ge { curve 0 get } { 0 } ifelse - curve length 2 ge { curve 1 get } { 0 } ifelse - curve length 3 ge { curve 2 get } { true } ifelse - 7 1 roll - ldiagsetarc pop pop pop - } ifelse - } - { xcurr ycurr lineto - } ifelse - } - { xcurr ycurr moveto - } ifelse - /xprev xcurr def - /yprev ycurr def - /prevseen true def - /curveseen false def - } ifelse - } ifelse - } loop pop pop - end -} def - -% ldiagpaintpath: paint a path of the given shape -% /paint [ shape ] ldiagpaintpath - -/ldiagpaintpath -{ - ldiagsetpath cvx exec -} def - -% stroke a path of the given shape in the given linestyle and dash length. -% Return the origin and angle of the backward and forward arrow heads. -% dashlength /linestyle [shape] ldiagdopath [<point> <angle>] [<point> <angle>] -/ldiagdopath -{ - 10 dict begin - 0 - /prevseen false def - /curveseen false def - /backarrow [] def - /fwdarrow [] def - { - ldiaggetnextitem - dup 0 eq { pop exit } - { - 1 eq - { /curveseen true def - /curve exch def - curve length 0 eq { /prevseen false def } if - } - { /ycurr exch def - /xcurr exch def - prevseen - { newpath xprev yprev moveto - curveseen - { curve length 4 eq - { xprev yprev - curve 0 get curve 1 get - curve 2 get curve 3 get - xcurr ycurr ldiagsetcurve - } - { xprev yprev xcurr ycurr - curve length 1 ge { curve 0 get } { 0 } ifelse - curve length 2 ge { curve 1 get } { 0 } ifelse - curve length 3 ge { curve 2 get } { true } ifelse - 7 1 roll - ldiagsetarc - } ifelse - } - { xcurr ycurr lineto - xcurr ycurr xprev yprev ldiagangleto dup 180 sub - xprev yprev xcurr ycurr ldiagdistance - } ifelse - 6 index 6 index cvx exec - [ xprev yprev 5 -1 roll ] - backarrow length 0 eq - { /backarrow exch def } - { pop } ifelse - [ xcurr ycurr 4 -1 roll ] /fwdarrow exch def - } if - /xprev xcurr def - /yprev ycurr def - /prevseen true def - /curveseen false def - } ifelse - } ifelse - } loop - pop pop pop pop - backarrow length 0 eq { [ 0 0 0 ] } { backarrow } ifelse - fwdarrow length 0 eq { [ 0 0 0 ] } { fwdarrow } ifelse - end -} def - - -% stroke a path of the given shape in the given linestyle and dash length. -% dashlength [ /linestyle ] [shape] ldiagdosegpath - -/ldiagdosegpath -{ - 12 dict begin - 1 index /seg exch def - 1 index length /seglength exch def - 0 /segcount exch def - 0 - /prevseen false def - /curveseen false def - /backarrow [] def - /fwdarrow [] def - { - ldiaggetnextitem - dup 0 eq { pop exit } - { - 1 eq - { /curveseen true def - /curve exch def - curve length 0 eq { /prevseen false def } if - } - { /ycurr exch def - /xcurr exch def - prevseen - { newpath xprev yprev moveto - curveseen - { curve length 4 eq - { xprev yprev - curve 0 get curve 1 get - curve 2 get curve 3 get - xcurr ycurr ldiagsetcurve - } - { xprev yprev xcurr ycurr - curve length 1 ge { curve 0 get } { 0 } ifelse - curve length 2 ge { curve 1 get } { 0 } ifelse - curve length 3 ge { curve 2 get } { true } ifelse - 7 1 roll - ldiagsetarc - } ifelse - } - { xcurr ycurr lineto - xcurr ycurr xprev yprev ldiagangleto dup 180 sub - xprev yprev xcurr ycurr ldiagdistance - } ifelse - 6 index seg segcount seglength mod get cvx exec - /segcount segcount 1 add def - [ xprev yprev 5 -1 roll ] - backarrow length 0 eq - { /backarrow exch def } - { pop } ifelse - [ xcurr ycurr 4 -1 roll ] /fwdarrow exch def - } if - /xprev xcurr def - /yprev ycurr def - /prevseen true def - /curveseen false def - } ifelse - } ifelse - } loop - pop pop pop pop - end -} def - -% ldiagnodebegin: start of node parameters -% ldiagnodebegin - -/ldiagnodebegin -{ % (Entering ldiagnodebegin) 0 ldiagdebugprint - ldiagmaxlabels dict begin -} def - -% ldiagnodeend: end of node parameters (so do the node) -% <outline> <dashlength> <style> <linewidth> <paint> ldiagnodeend - -/ldiagnodeend -{ - % (Entering ldiagnodeend) 0 ldiagdebugprint - end % matches begin in ldiagnodebegin - 4 index gsave ldiagpaintpath grestore - 3 index ldiagsetpath clip newpath - 2 mul setlinewidth - 3 -1 roll ldiagdosegpath - % (Leaving ldiagnodeend) 0 ldiagdebugprint -} def - -% ldiaglinkbegin: start of link parameters -% <direct> ldiaglinkbegin - -/ldiaglinkbegin -{ ldiagmaxlabels dict begin - 1 eq /direct exch def -} def - -% ldiaglinkend: end of link parameters (so do the link) -% <outline> <dashlength> <style> <linewidth> ldiaglinkend - -/ldiaglinkend -{ - end % matches begin in ldiaglinkbegin - setlinewidth - 3 -1 roll ldiagdosegpath -} def - -% ldiagdoarrow: draw an arrow head of given form -% dashlength /lstyle /pstyle hfrac height width [ <point> <angle> ] ldiagdoarrow - -/ldiagdoarrow -{ matrix currentmatrix 8 1 roll - dup 0 get 1 index 1 get translate - 2 get rotate - [ 2 index neg 2 index 0 0 - 3 index 3 index neg - 1 index 10 index mul 0 - 7 index 7 index ] - 4 1 roll pop pop pop - dup 3 1 roll - gsave ldiagpaintpath grestore ldiagdopath pop pop - setmatrix -} def - -% arrow head styles -/ldiagopen 0.0 def -/ldiaghalfopen 0.5 def -/ldiagclosed 1.0 def - -% stroke no arrows, forward, back, and both -/ldiagnoarrow { pop pop pop pop pop pop pop pop } def -/ldiagforward { 7 -1 roll ldiagdoarrow pop } def -/ldiagback { 8 -2 roll pop ldiagdoarrow } def -/ldiagboth { 8 -1 roll 7 copy ldiagdoarrow pop 7 -1 roll ldiagdoarrow } def - -% ldiagprevious: return previous point on path -/ldiagprevious -{ ldiagisnumbertype - { 2 copy } - { ldiagisarraytype - { 2 index 2 index } - { 0 0 } - ifelse - } ifelse -} def - -% Tag dictionary operators -% -% Diag's tag dictionaries are kept on the same stack as other dictionaries, -% since there is nowhere else to put them. However, they are managed like -% a separate stack using the following operators: -% -% <tag> ldiagpushtagdict - Push a new, empty tag dictionary -% ldiagtoptagdict dict Find the top tag dictionary -% ldiagpoptagdict - Pop and destroy the top tag dictionary -% ldiagpopuptagdict - Pop top tag dict and promote its entries -% ldiagdebugtagdict - Debug print of dictionary stack -% -% They are distinguished from other dictionaries by containing /ldiagtagdict, -% whose value is the <tag> which is used by ldiagpopuptagdict, -% and they are hopefully never the target of any non-tag definition because -% they are never the top dictionary, since push places the new dict second. - -/ldiagpushtagdict -{ ldiagmaxlabels dict dup - currentdict end exch begin begin - exch /ldiagtagdict exch put -} def - -/ldiagtoptagdict -{ /ldiagtagdict where not - { (Diag internal error: no tag dictionary) show stop - } if -} def - -/ldiagpoptagdict -{ - % (Entering poptagdict) 0 ldiagdebugprint - % ldiagdebugtagdict - mark - { currentdict end - dup /ldiagtagdict known - { exit - } if - } loop - pop - counttomark - { begin - } repeat - pop - % (Leaving poptagdict) 0 ldiagdebugprint - % ldiagdebugtagdict -} def - -% promote labels from top tag dictionary to second top tag dictionary -% each prefixed by <string>@ if <string> (value of /ldiagtagdict) is not empty -% - ldiagpopuptagdict - -/ldiagpopuptagdict -{ - ldiagtagdict - % (Entering ldiagpopuptagdict) 1 ldiagdebugprint - % ldiagdebugtagdict - ldiagtoptagdict ldiagpoptagdict ldiagtoptagdict exch - { exch 50 string cvs 3 index - dup length 0 ne - { (@) ldiagconcat - } if - exch ldiagconcat cvn exch 2 index 3 1 roll put - } forall - pop pop - % (Leaving ldiagpopuptagdict) 0 ldiagdebugprint - % ldiagdebugtagdict -} def - -% debug tag dictionary stack -/ldiagdebugtagdict -{ (Entering ldiagdebugtagdict) 0 ldiagdebugprint - 30 array dictstack - { dup /ldiagtagdict known - { dup /ldiagtagdict get 0 ldiagdebugprint - { pop 50 string cvs ( ) exch ldiagconcat - dup 0 ldiagdebugprint - pop - } - forall - } - { pop (other) 0 ldiagdebugprint - } ifelse - } forall - (Leaving ldiagdebugtagdict) 0 ldiagdebugprint -} def - -% label a point in top tag dictionary: <point> /name ldiagpointdef - -/ldiagpointdef -{ - % (Entering ldiagpointdef) 3 ldiagdebugprint - [ 4 2 roll transform /itransform cvx ] cvx - ldiagtoptagdict 3 1 roll put - % (Leaving ldiagpointdef) 0 ldiagdebugprint -} def - -% label an angle in top tag dictionary: <angle> /name ldiagangledef - -/ldiagangledef -{ - % (Entering ldiagangledef) 2 ldiagdebugprint - exch ldiagfixangle ldiagtoptagdict 3 1 roll put - % (Leaving ldiagangledef) 0 ldiagdebugprint -} def - -% add CIRCUM operator with this body: <array> ldiagcircumdef - -/ldiagcircumdef -{ % (Entering ldiagcircumdef) 1 ldiagdebugprint - /CIRCUM exch cvx - ldiagtoptagdict 3 1 roll put - % currentdict end - % 3 1 roll - % def - % begin - % (Leaving ldiagcircumdef) 0 ldiagdebugprint -} def - -% show points (except CIRCUM and ANGLE): - ldiagshowpoints - -/ldiagshowpoints -{ - % (Entering ldiagshowpoints) 0 ldiagdebugprint - ldiagtoptagdict - { 1 index 50 string cvs - (ldiagdebugpos) search - { pop pop pop pop pop } - { - (CIRCUM) search % if CIRCUM in key - { pop pop pop pop pop } - { - (ANGLE) search % if ANGLE in key - { - pop pop pop pop pop - } - { - (ldiagtagdict) search - { - pop pop pop pop pop - } - { - pop cvx exec - newpath 2.0 pt 0 360 arc 0 setgray fill pop - } ifelse - } ifelse - } ifelse - } ifelse - } forall - % (Leaving ldiagshowpoints) 0 ldiagdebugprint -} def - - -/ldiagshowtags -{ - % (Entering ldiagshowtags) 0 ldiagdebugprint - ldiagtoptagdict - { 1 index 50 string cvs - % dup 0 ldiagdebugprint - (ldiagdebugpos) search - { pop pop pop pop pop } - { - (CIRCUM) search % if CIRCUM in key - { pop pop pop pop pop } - { - (ANGLE) search % if ANGLE in key - { - pop pop pop pop pop - } - { - (ldiagtagdict) search - { - pop pop pop pop pop - } - { - pop cvx exec 2 copy - gsave - newpath 2.0 pt 0 360 arc 0 setgray fill - /Times-Roman findfont 8 pt scalefont setfont - translate 40 rotate 0.2 cm 0.1 cm moveto 20 string cvs show - grestore - } ifelse - } ifelse - } ifelse - } ifelse - } forall - % (Leaving ldiagshowtags) 0 ldiagdebugprint -} def - - -% show angles: - ldiagshowangles - -/ldiagshowangles -{ - % (Entering ldiagshowangles) 0 ldiagdebugprint - ldiagtoptagdict - { 1 index 20 string cvs - % dup 0 ldiagdebugprint - (ldiagdebugpos) search - { pop pop pop pop pop } - { - (ldiagtagdict) search - { - pop pop pop pop pop - } - { - (CIRCUM) search % if CIRCUM in key - { pop pop pop pop pop } - { - (@ANGLE) search % if ANGLE in key, draw the angle at the point - { - % (showing ANGLE) 5 ldiagdebugprint - gsave exch pop exch pop cvx - % (about to execute) 1 ldiagdebugprint - exec translate rotate 0.8 0.8 scale pop - newpath 0 0 2.0 pt 0 360 arc 0 setgray fill - newpath 4 pt 0 moveto 9 pt 0 lineto - 9 pt 1.5 pt lineto 11 pt 0 lineto 9 pt -1.5 pt lineto - 9 pt 0 lineto [] 0 setdash 4 pt setlinewidth 0 setlinejoin - stroke grestore - % (finished ANGLE) 5 ldiagdebugprint - } - { - % else must be a point, we aren't showing those - pop pop pop - } ifelse - } ifelse - } ifelse - } ifelse - } forall - % (Leaving ldiagshowangles) 0 ldiagdebugprint -} def - -% fix an angle to 0 <= res < 360: <angle> ldiagfixangle <angle> -/ldiagfixangle -{ - % (Entering ldiagfixangle) 1 ldiagdebugprint - { dup 0 ge { exit } if - 360 add - } loop - { dup 360 lt { exit } if - 360 sub - } loop - % (Leaving ldiagfixangle) 1 ldiagdebugprint -} def - -% find point on circumference of box: alpha a b ldiagboxcircum x y -/ldiagboxcircum -{ - % (Entering ldiagboxcircum) 3 ldiagdebugprint - 4 dict begin - /b exch def - /a exch def - ldiagfixangle /alpha exch def - 0 0 a b ldiagangleto /theta exch def - - % if alpha <= theta, return (a, a*tan(alpha)) - alpha theta le - { a a alpha sin mul alpha cos div } - { - % else if alpha <= 180 - theta, return (b*cot(alpha), b) - alpha 180 theta sub le - { b alpha cos mul alpha sin div b } - { - % else if alpha <= 180 + theta, return (-a, -a*tan(alpha)) - alpha 180 theta add le - { a neg a neg alpha sin mul alpha cos div } - { - % else if alpha <= 360 - theta, return (-b*cot(alpha), -b) - alpha 360 theta sub le - { b neg alpha cos mul alpha sin div b neg } - { - % else 360 - theta <= alpha, return (a, a*tan(alpha)) - a a alpha sin mul alpha cos div - } ifelse - } ifelse - } ifelse - } ifelse - end - % (Leaving ldiagboxcircum) 2 ldiagdebugprint -} def - -% find quadratic roots (assume a != 0): a b c ldiagqroots x1 x2 2 -% or x2 1 -% or 0 -/ldiagqroots -{ - 4 dict begin - /c exch def - /b exch def - /a exch def - /disc b b mul 4 a c mul mul sub def - disc 0 lt - { 0 - } - { disc 0 eq - { b neg 2 a mul div - 1 - } - { b neg disc sqrt add 2 a mul div - b neg disc sqrt sub 2 a mul div - 2 - } - ifelse - } - ifelse - end -} def - -% work our which quadrant: <angle> ldiagquadrant <0-3> -/ldiagquadrant -{ dup 90 lt - { pop 0 - } - { dup 180 lt - { pop 1 - } - { 270 lt - { 2 - } - { 3 - } ifelse - } ifelse - } ifelse -} def - -% find curvebox circum, assuming upper right quadrant: alpha a b xmk ldiagcb x y -/ldiagcb -{ - 6 dict begin - /xmk exch def - /b exch def - /a exch def - /alpha exch def - /theta1 0 0 a b xmk sub ldiagangleto def - /theta2 0 0 a xmk sub b ldiagangleto def - alpha theta1 le - { % if alpha <= theta1, return (a, a*tan(alpha)) - a a alpha sin mul alpha cos div - } - { alpha theta2 ge - { % else if alpha > theta2, return (b*cot(alpha), b) - b alpha cos mul alpha sin div b - } - { - % else, return the intersection of line and circle - a xmk sub b xmk sub xmk 0 0 alpha ldiagcircleintersect - dup 0 eq - { % should never happen, just return any reasonable point - pop - a b 0.5 ldiagpmul - } - { 1 eq - { % should never happen, just return the point on top of stack - } - { % the usual case, two points on stack, return the larger - ldiagpmax - } ifelse - } ifelse - } ifelse - } ifelse - end -} def - -% find point on circumference of curvebox: alpha a b xmk ldiagcurveboxcircum x y -/ldiagcurveboxcircum -{ - % (Entering ldiagcurveboxcircum) 4 ldiagdebugprint - 5 dict begin - /xmk exch def - /b exch def - /a exch def - ldiagfixangle /alpha exch def - - % work out which quadrant we are in, and reflect accordingly - /quad alpha ldiagquadrant def - quad 0 eq - { alpha a b xmk ldiagcb - } - { quad 1 eq - { 180 alpha sub a b xmk ldiagcb exch neg exch - } - { quad 2 eq - { alpha 180 sub a b xmk ldiagcb neg exch neg exch - } - { 360 alpha sub a b xmk ldiagcb neg - } ifelse - } ifelse - } ifelse - end - % (Leaving ldiagcurveboxcircum) 2 ldiagdebugprint -} def - -% find point on circumference of diamond: alpha a b ldiagdiamondcircum x y -/ldiagdiamondcircum -{ - % (Entering ldiagdiamondcircum) 3 ldiagdebugprint - 4 dict begin - /b exch def - /a exch def - ldiagfixangle /alpha exch def - b alpha cos abs mul a alpha sin abs mul add /denom exch def - a b mul alpha cos mul denom div - a b mul alpha sin mul denom div - end - % (Leaving ldiagdiamondcircum) 2 ldiagdebugprint -} def - -% find point on circumference of ellipse: alpha a b ldiagellipsecircum x y -/ldiagellipsecircum -{ - % (Entering ldiagellipsecircum) 3 ldiagdebugprint - 4 dict begin - /b exch def - /a exch def - ldiagfixangle /alpha exch def - b alpha cos mul dup mul a alpha sin mul dup mul add sqrt /denom exch def - a b mul alpha cos mul denom div - a b mul alpha sin mul denom div - end - % (Leaving ldiagellipsecircum) 2 ldiagdebugprint -} def - -% find point on circumference of isosceles: alpha a b ldiagisoscelescircum x y -/ldiagisoscelescircum -{ - % (Entering ldiagisoscelescircum) 3 ldiagdebugprint - 7 dict begin - /b exch def - /a exch def - /alpha exch ldiagfixangle def - /theta1 90 def - /theta2 a b 0.5 ldiagpmul 0 0 ldiagangleto def - /theta3 a b 0.5 ldiagpmul a 0 ldiagangleto def - alpha theta1 ge alpha theta2 le and - { 0 0 a 2 div b - } - { alpha theta2 ge alpha theta3 le and - { 0 0 a 0 - } - { a 0 a 2 div b - } ifelse - } ifelse - a 2 div b 2 div 2 copy 1 ft alpha ldiagatangle ldiaglineintersect - a 2 div b 2 div 4 2 roll ldiagpsub - end - % (Leaving ldiagisoscelescircum) 2 ldiagdebugprint -} def - -% find point of intersection of two lines each defined by two points -% x1 y1 x2 y2 x3 y3 x4 y4 ldiaglineintersect x y -/ldiaglineintersect -{ - % (Entering ldiaglineintersect) 8 ldiagdebugprint - 13 dict begin - /y4 exch def - /x4 exch def - /y3 exch def - /x3 exch def - /y2 exch def - /x2 exch def - /y1 exch def - /x1 exch def - x2 x1 sub /x21 exch def - x4 x3 sub /x43 exch def - y2 y1 sub /y21 exch def - y4 y3 sub /y43 exch def - y21 x43 mul y43 x21 mul sub /det exch def - - % calculate x - y21 x43 mul x1 mul - y43 x21 mul x3 mul sub - y3 y1 sub x21 mul x43 mul add - det div - - % calculate y - x21 y43 mul y1 mul - x43 y21 mul y3 mul sub - x3 x1 sub y21 mul y43 mul add - det neg div - - end - % (Leaving ldiaglineintersect) 2 ldiagdebugprint -} def - -% find point on circumference of polygon -% alpha radius num theta ldiagpolycircum x y -/ldiagpolycircum -{ - % (Entering ldiagpolycircum) 4 ldiagdebugprint - 13 dict begin - /theta exch def - /num exch def - /radius exch def - /alpha exch def - - % calculate delta, the angle from theta to alpha - alpha theta sub ldiagfixangle - - % calculate the angle which is the multiple of 360/num closest to delta - 360 num div div truncate 360 num div mul theta add /anglea exch def - - % calculate the next multiple of 360/num after anglea - anglea 360 num div add /angleb exch def - - % intersect the line through these two points with the alpha line - anglea cos anglea sin angleb cos angleb sin - 0 0 alpha cos 2 mul alpha sin 2 mul - ldiaglineintersect radius ldiagpmul - - end - % (Leaving ldiagpolycircum) 2 ldiagdebugprint -} def - -% find point of intersection of a line and a circle -% x0 y0 r x1 y1 theta ldiagcircleintersect xa ya xb yb 2 -% or xb yb 1 -% or 0 -/ldiagcircleintersect -{ - % (Entering ldiagcircleintersect) 6 ldiagdebugprint - 15 dict begin - /theta exch def - /y1 exch def - /x1 exch def - /r exch def - /y0 exch def - /x0 exch def - - % if sin(theta) = 0 then line is horizontal and y must be y1 - theta sin abs 0.00001 lt - { - /a 1 def - /b -2 x0 mul def - /c x0 dup mul y1 y0 sub dup mul add r dup mul sub def - a b c ldiagqroots dup - 0 eq - { pop - 0 - } - { 1 eq - { y1 1 - } - { y1 exch y1 2 - } ifelse - } ifelse - } - { - /ct theta cos theta sin div def - /a ct ct mul 1 add def - /b ct x1 x0 sub mul y1 add y0 sub 2 mul def - /c x1 x0 sub dup mul y1 y0 sub dup mul add r dup mul sub def - a b c ldiagqroots dup - 0 eq - { pop - 0 - } - { 1 eq - { y1 add /yb exch def - yb y1 sub ct mul x1 add /xb exch def - xb yb 1 - } - { y1 add /ya exch def - ya y1 sub ct mul x1 add /xa exch def - y1 add /yb exch def - yb y1 sub ct mul x1 add /xb exch def - xa ya xb yb 2 - } ifelse - } ifelse - } ifelse - end - % (Leaving ldiagcircleintersect) 1 ldiagdebugprint -} def - -% find line which is the perpendicular bisector of two points, defined -% by two points -% x1 y1 x2 y2 ldiaglinebetween x3 y3 x4 y4 -/ldiaglinebetween -{ % (Entering ldiaglinebetween) 4 ldiagdebugprint - /y2 exch def /x2 exch def - /y1 exch def /x1 exch def - - % let x3, y3 be the point halfway between the two points - x1 y1 x2 y2 ldiagpadd 0.5 ldiagpmul - /y3 exch def /x3 exch def - - % find a point perpendicular to x3, y3 - x3 y3 50 x1 y1 x2 y2 ldiagangleto 90 dg add ldiagatangle - - % plus x3 y3 gives the two points - x3 y3 - - % (Leaving ldiaglinebetween) 4 ldiagdebugprint -} def - -% find <proc>@<string>: <proc> <string> ldiagfindlabel <any> true -% <proc> <string> false -/ldiagfindlabel -{ - % (Entering ldiagfindlabel) 2 ldiagdebugprint - exch dup length 1 ne - { exch false - % (Leaving ldiagfindabel (length not 1)) 3 ldiagdebugprint - } - { dup 0 get type /nametype ne - { exch false - % (Leaving ldiagfindabel (not a name)) 3 ldiagdebugprint - } - { dup 0 get 50 string cvs (@) ldiagconcat 2 index ldiagconcat dup where - { exch get exch pop exch pop cvx exec true - % (Leaving ldiagfindlabel with success) 100 ldiagdebugprint - } - { - pop exch false - % (Leaving ldiagfindabel (concat not sensible)) 3 ldiagdebugprint - } ifelse - } ifelse - } ifelse -} bind def - -% execute <proc>@<string> or else default: <proc> <string> ldiagdolabel <various> -/ldiagdolabel -{ - % (Entering ldiagdolabel) 2 ldiagdebugprint - ldiagfindlabel not - { - dup (CIRCUM) eq - { pop pop pop 0 0 - } - { - dup (ANGLE) eq - { pop pop 0 - } - { pop cvx exec - } ifelse - } ifelse - } if - % (Leaving ldiagdolabel) 2 ldiagdebugprint -} bind def - -% execute a proc depending on whether number is negative, zero, or positive -% procneg proczero procpos number ldiagsigncase <anything> -/ldiagsigncase -{ - % (Entering ldiagsigncase) 4 ldiagdebugprint - dup 0 lt - { pop pop pop exec - } - { 0 gt - { exch pop exch pop exec - } - { pop exch pop exec - } ifelse - } ifelse - % (Leaving ldiagsigncase) 0 ldiagdebugprint -} bind def - -% execute proci if angle is in ith quadrant -% proc45 proc270 proc180 proc90 proc0 proc315 proc225 proc135 angle ldiagquadcase <anything> -/ldiagquadcase -{ - % (Entering ldiagquadcase) 9 ldiagdebugprint - round ldiagfixangle cvi dup 90 mod 0 eq - { 90 idiv 4 add } { 90 idiv } ifelse - 8 exch roll pop pop pop pop pop pop pop exec - % (Leaving ldiagquadcase) 0 ldiagdebugprint -} bind def - -% decode Lout length into PostScript length -% <string> ldiagdecodelength <number> -/ldiagdecodelength -{ - % (Entering ldiagdecodelength) 1 ldiagdebugprint - (f) search - { exch pop exch pop cvr ft - } - { (c) search - { exch pop exch pop cvr cm - } - { (p) search - { exch pop exch pop cvr pt - } - { (m) search - { exch pop exch pop cvr em - } - { (s) search - { exch pop exch pop cvr sp - } - { (v) search - { exch pop exch pop cvr vs - } - { (i) search - { exch pop exch pop cvr in - } - { pop 0 - } ifelse - } ifelse - } ifelse - } ifelse - } ifelse - } ifelse - } ifelse - % (Leaving ldiagdecodelength) 1 ldiagdebugprint -} def - -% implement aabout function -% logical form: <circum> <extra> <centre> aabout <point> -% actual form: { <labelorpoint> } cvlit <length> [ <point> ] cvx aabout <point> -/ldiagaabout -{ - /centre exch def - /extra exch def - /circum exch def - - /ZXCTR [ centre ] cvx def - /ZFCTR [ circum (CTR) ldiagdolabel ] cvx def - /ZAREF ZFCTR ZXCTR ldiagangleto def - /ZAMIN 0 dg def - /ZPMIN [ circum (CTR) ldiagdolabel ZAREF ZAMIN sub - circum (CIRCUM) ldiagdolabel ldiagpadd - 0 0 extra ZAREF ZAMIN sub ldiagatangle - ldiagpadd ] cvx def - - /ZAMAX 90 dg def - /ZPMAX [ circum (CTR) ldiagdolabel ZAREF ZAMAX sub - circum (CIRCUM) ldiagdolabel ldiagpadd - 0 0 extra ZAREF ZAMAX sub ldiagatangle - ldiagpadd ] cvx def - - 1 1 20 - { /xval exch def - /ZAMID ZAMIN ZAMAX add 0.5 mul def - /ZPMID [ circum (CTR) ldiagdolabel ZAREF ZAMID sub - circum (CIRCUM) ldiagdolabel ldiagpadd - 0 0 extra ZAREF ZAMID sub ldiagatangle - ldiagpadd ] cvx def - ZPMID ZXCTR ldiagdistance ZFCTR ZXCTR ldiagdistance gt - { - /ZAMAX [ ZAMID ] cvx def - /ZPMAX [ ZPMID ] cvx def - } - { - /ZAMIN [ ZAMID ] cvx def - /ZPMIN [ ZPMID ] cvx def - } ifelse - } for - ZPMID -} def - -% implement cabout function -% logical form: <circum> <extra> <centre> cabout <point> -% actual form: { <labelorpoint> } cvlit <length> [ <point> ] cvx cabout <point> -/ldiagcabout -{ - /centre exch def - /extra exch def - /circum exch def - - /ZXCTR [ centre ] cvx def - /ZFCTR [ circum (CTR) ldiagdolabel ] cvx def - /ZAREF ZFCTR ZXCTR ldiagangleto def - /ZAMIN 0 dg def - /ZPMIN [ circum (CTR) ldiagdolabel ZAREF ZAMIN add - circum (CIRCUM) ldiagdolabel ldiagpadd - 0 0 extra ZAREF ZAMIN add ldiagatangle - ldiagpadd ] cvx def - - /ZAMAX 90 dg def - /ZPMAX [ circum (CTR) ldiagdolabel ZAREF ZAMAX add - circum (CIRCUM) ldiagdolabel ldiagpadd - 0 0 extra ZAREF ZAMAX add ldiagatangle - ldiagpadd ] cvx def - - 1 1 20 - { /xval exch def - /ZAMID ZAMIN ZAMAX add 0.5 mul def - /ZPMID [ circum (CTR) ldiagdolabel ZAREF ZAMID add - circum (CIRCUM) ldiagdolabel ldiagpadd - 0 0 extra ZAREF ZAMID add ldiagatangle - ldiagpadd ] cvx def - ZPMID ZXCTR ldiagdistance ZFCTR ZXCTR ldiagdistance gt - { - /ZAMAX [ ZAMID ] cvx def - /ZPMAX [ ZPMID ] cvx def - } - { - /ZAMIN [ ZAMID ] cvx def - /ZPMIN [ ZPMID ] cvx def - } ifelse - } for - ZPMID -} def - -% fromarrowlength toarrowlength { from } { to } xindent zindent ldiaglinepath - -/ldiaglinepath -{ - % (entering ldiaglinepath) 0 ldiagdebugprint - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - from (CTR) ldiagdolabel to (CTR) ldiagdolabel ldiagangleto - /FROM@ANGLE ldiagangledef - from (CTR) ldiagdolabel FROM@ANGLE from (CIRCUM) ldiagdolabel ldiagpadd - 0 0 fromarrowlength FROM@ANGLE ldiagatangle ldiagpadd - /FROM ldiagpointdef - - FROM@ANGLE /TO@ANGLE ldiagangledef - to (CTR) ldiagdolabel TO@ANGLE 180 dg sub to (CIRCUM) ldiagdolabel ldiagpadd - 0 0 toarrowlength TO@ANGLE 180 dg sub ldiagatangle ldiagpadd /TO ldiagpointdef - - FROM 0.5 ldiagpmul TO 0.5 ldiagpmul ldiagpadd /LMID ldiagpointdef - FROM@ANGLE /LMID@ANGLE ldiagangledef - - /XINDENT xindent FROM LMID ldiagdistance ldiagmin def - FROM 0 0 XINDENT FROM@ANGLE ldiagatangle ldiagpadd /LFROM ldiagpointdef - FROM@ANGLE /LFROM@ANGLE ldiagangledef - - /ZINDENT zindent TO LMID ldiagdistance ldiagmin def - 0 0 ZINDENT FROM@ANGLE ldiagatangle TO ldiagpsub /LTO ldiagpointdef - FROM@ANGLE /LTO@ANGLE ldiagangledef - - direct { FROM TO } { FROM LFROM LMID LTO TO } ifelse - - % (leaving ldiaglinepath) 0 ldiagdebugprint -} def - -% fromarrowlength toarrowlength { from } { to } xindent zindent pathgap ldiagdoublelinepath - -/ldiagdoublelinepath -{ - % (entering ldiagdoublelinepath) 0 ldiagdebugprint - /pathgap exch def - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - from (CTR) ldiagdolabel to (CTR) ldiagdolabel ldiagangleto - /FROM@ANGLE ldiagangledef - from (CTR) ldiagdolabel FROM@ANGLE from (CIRCUM) ldiagdolabel ldiagpadd - 0 0 fromarrowlength FROM@ANGLE ldiagatangle ldiagpadd - /FROM ldiagpointdef - - FROM@ANGLE /TO@ANGLE ldiagangledef - to (CTR) ldiagdolabel TO@ANGLE 180 dg sub to (CIRCUM) ldiagdolabel ldiagpadd - 0 0 toarrowlength TO@ANGLE 180 dg sub ldiagatangle ldiagpadd /TO ldiagpointdef - - FROM 0.5 ldiagpmul TO 0.5 ldiagpmul ldiagpadd /LMID ldiagpointdef - FROM@ANGLE /LMID@ANGLE ldiagangledef - - /XINDENT xindent FROM LMID ldiagdistance ldiagmin def - FROM 0 0 XINDENT FROM@ANGLE ldiagatangle ldiagpadd /LFROM ldiagpointdef - FROM@ANGLE /LFROM@ANGLE ldiagangledef - - /ZINDENT zindent TO LMID ldiagdistance ldiagmin def - 0 0 ZINDENT FROM@ANGLE ldiagatangle TO ldiagpsub /LTO ldiagpointdef - FROM@ANGLE /LTO@ANGLE ldiagangledef - - direct { - FROM pathgap 2 div FROM@ANGLE 90 dg sub ldiagatangle - TO pathgap 2 div FROM@ANGLE 90 dg sub ldiagatangle - [] - FROM pathgap 2 div FROM@ANGLE 90 dg add ldiagatangle - TO pathgap 2 div FROM@ANGLE 90 dg add ldiagatangle - } - { - FROM pathgap 2 div FROM@ANGLE 90 dg sub ldiagatangle - LFROM pathgap 2 div FROM@ANGLE 90 dg sub ldiagatangle - LMID pathgap 2 div FROM@ANGLE 90 dg sub ldiagatangle - LTO pathgap 2 div FROM@ANGLE 90 dg sub ldiagatangle - TO pathgap 2 div FROM@ANGLE 90 dg sub ldiagatangle - [] - FROM pathgap 2 div FROM@ANGLE 90 dg add ldiagatangle - LFROM pathgap 2 div FROM@ANGLE 90 dg add ldiagatangle - LMID pathgap 2 div FROM@ANGLE 90 dg add ldiagatangle - LTO pathgap 2 div FROM@ANGLE 90 dg add ldiagatangle - TO pathgap 2 div FROM@ANGLE 90 dg add ldiagatangle - } ifelse - - % (leaving ldiagdoublelinepath) 0 ldiagdebugprint -} def - -% fromarrowlen toarrowlen { from } { to } xindent zindent bias ldiagacurvepath - -/ldiagacurvepath -{ - % (entering ldiagacurvepath) 0 ldiagdebugprint - /bias exch def - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - %/B1 bias 0.02 ft ldiagmax def - %/B2 from (CTR) ldiagdolabel to (CTR) ldiagdolabel ldiagdistance 0.5 mul def - %/BIAS B1 B2 ldiagmin def - /BIAS bias 0.02 ft ldiagmax def - /XMID [ from (CTR) ldiagdolabel 0.5 ldiagpmul - to (CTR) ldiagdolabel 0.5 ldiagpmul ldiagpadd ] cvx def - /XTOP [ XMID 0 0 BIAS from (CTR) ldiagdolabel to (CTR) ldiagdolabel - ldiagangleto 90 dg sub ldiagatangle ldiagpadd ] cvx def - /CTR [ from (CTR) ldiagdolabel XTOP ldiaglinebetween - to (CTR) ldiagdolabel XTOP ldiaglinebetween - ldiaglineintersect ] cvx def - - from fromarrowlength [ CTR ] cvx ldiagaabout /FROM ldiagpointdef - from (CTR) ldiagdolabel FROM ldiagdistance 0 gt - { from (CTR) ldiagdolabel FROM ldiagangleto - } - { CTR FROM ldiagangleto 90 dg add - } ifelse /FROM@ANGLE ldiagangledef - - to toarrowlength [ CTR ] cvx ldiagcabout /TO ldiagpointdef - TO to (CTR) ldiagdolabel ldiagdistance 0 gt - { TO to (CTR) ldiagdolabel ldiagangleto - } - { CTR TO ldiagangleto 90 dg add - } ifelse /TO@ANGLE ldiagangledef - - /RADIUS CTR FROM ldiagdistance def - CTR 0 0 RADIUS CTR FROM ldiagangleto 360 dg CTR TO ldiagangleto - add CTR FROM ldiagangleto sub cvi 360 mod 0.5 mul add - ldiagatangle ldiagpadd /LMID ldiagpointdef - CTR LMID ldiagangleto 90 dg add /LMID@ANGLE ldiagangledef - - /XINDENT xindent FROM LMID ldiagdistance ldiagmin def - CTR 0 0 RADIUS CTR FROM 0 0 XINDENT FROM@ANGLE ldiagatangle - ldiagpadd ldiagangleto ldiagatangle ldiagpadd /LFROM ldiagpointdef - CTR LFROM ldiagangleto 90 dg add /LFROM@ANGLE ldiagangledef - - /ZINDENT zindent TO LMID ldiagdistance ldiagmin def - CTR 0 0 RADIUS CTR TO 0 0 ZINDENT TO@ANGLE 180 dg add - ldiagatangle ldiagpadd ldiagangleto ldiagatangle ldiagpadd /LTO ldiagpointdef - CTR LTO ldiagangleto 90 dg add /LTO@ANGLE ldiagangledef - - direct - { FROM [CTR] TO } - { FROM [CTR] LFROM [CTR] LMID [CTR] LTO [CTR] TO } - ifelse - - % (leaving ldiagacurvepath) 0 ldiagdebugprint -} def - -% fromarrowlen toarrowlen { from } { to } xindent zindent bias ldiagccurvepath - -/ldiagccurvepath -{ - % (entering ldiagccurvepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop - /bias exch def - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - %/B1 bias 0.02 ft ldiagmax def - %/B2 from (CTR) ldiagdolabel to (CTR) ldiagdolabel ldiagdistance 0.5 mul def - %/BIAS B1 B2 ldiagmin def - /BIAS bias 0.02 ft ldiagmax def - /XMID [ from (CTR) ldiagdolabel 0.5 ldiagpmul - to (CTR) ldiagdolabel 0.5 ldiagpmul ldiagpadd ] cvx def - /XTOP [ XMID 0 0 BIAS from (CTR) ldiagdolabel to (CTR) ldiagdolabel - ldiagangleto 90 dg add ldiagatangle ldiagpadd ] cvx def - /CTR [ from (CTR) ldiagdolabel XTOP ldiaglinebetween - to (CTR) ldiagdolabel XTOP ldiaglinebetween ldiaglineintersect ] cvx def - - from fromarrowlength [ CTR ] cvx ldiagcabout /FROM ldiagpointdef - from (CTR) ldiagdolabel FROM ldiagdistance 0 gt - { from (CTR) ldiagdolabel FROM ldiagangleto } - { CTR FROM ldiagangleto 90 dg sub } - ifelse /FROM@ANGLE ldiagangledef - - to toarrowlength [ CTR ] cvx ldiagaabout /TO ldiagpointdef - TO to (CTR) ldiagdolabel ldiagdistance 0 gt - { TO to (CTR) ldiagdolabel ldiagangleto } - { CTR TO ldiagangleto 90 dg sub } - ifelse /TO@ANGLE ldiagangledef - - /RADIUS [ CTR FROM ldiagdistance ] cvx def - CTR 0 0 RADIUS CTR TO ldiagangleto 360 dg CTR FROM ldiagangleto add - CTR TO ldiagangleto sub cvi 360 cvi mod 2 div add ldiagatangle - ldiagpadd /LMID ldiagpointdef - CTR LMID ldiagangleto 90 dg sub /LMID@ANGLE ldiagangledef - - /XINDENT [ xindent FROM LMID ldiagdistance ldiagmin ] cvx def - CTR 0 0 RADIUS CTR FROM 0 0 XINDENT FROM@ANGLE ldiagatangle ldiagpadd - ldiagangleto ldiagatangle ldiagpadd /LFROM ldiagpointdef - CTR LFROM ldiagangleto 90 dg sub /LFROM@ANGLE ldiagangledef - - /ZINDENT [ zindent TO LMID ldiagdistance ldiagmin ] cvx def - CTR 0 0 RADIUS CTR TO 0 0 ZINDENT TO@ANGLE 180 dg add ldiagatangle - ldiagpadd ldiagangleto ldiagatangle ldiagpadd /LTO ldiagpointdef - CTR LTO ldiagangleto 90 dg sub /LTO@ANGLE ldiagangledef - - direct - { FROM [CTR clockwise] TO } - { FROM [CTR clockwise] LFROM [CTR clockwise] - LMID [CTR clockwise] LTO [CTR clockwise] TO } - ifelse - % (leaving ldiagccurvepath) 0 ldiagdebugprint -} def - - -% farr tarr { from } { to } xindent zindent [frompt] [topt] ldiagbezierpath - -/ldiagbezierpath -{ - % (entering ldiagbezierpath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop - cvx /topt exch def - cvx /frompt exch def - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - from (CTR) ldiagdolabel frompt ldiagangleto /FROM@ANGLE ldiagangledef - from (CTR) ldiagdolabel FROM@ANGLE from (CIRCUM) ldiagdolabel - ldiagpadd 0 0 fromarrowlength FROM@ANGLE ldiagatangle ldiagpadd - /FROM ldiagpointdef - - topt to (CTR) ldiagdolabel ldiagangleto /TO@ANGLE ldiagangledef - to (CTR) ldiagdolabel TO@ANGLE 180 dg add to (CIRCUM) ldiagdolabel - ldiagpadd 0 0 toarrowlength TO@ANGLE 180 dg add ldiagatangle ldiagpadd - /TO ldiagpointdef - - FROM 0 0 xindent FROM@ANGLE ldiagatangle ldiagpadd - /LFROM ldiagpointdef - FROM@ANGLE /LFROM@ANGLE ldiagangledef - - TO 0 0 zindent TO@ANGLE 180 dg add ldiagatangle ldiagpadd - /LTO ldiagpointdef - TO@ANGLE /LTO@ANGLE ldiagangledef - - FROM TO ldiagpadd frompt ldiagpadd topt ldiagpadd 0.25 ldiagpmul - /LMID ldiagpointdef - - FROM [frompt topt] TO - - % (leaving ldiagbezierpath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop -} def - - -% farr tarr { from } { to } xindent zindent ldiagvhlinepath - -/ldiagvhlinepath -{ - % (entering ldiagvhlinepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - /CTR [ from (CTR) ldiagdolabel pop to (CTR) ldiagdolabel exch pop ] cvx def - /FANG [ from (CTR) ldiagdolabel CTR ldiagangleto ] cvx def - /TANG [ to (CTR) ldiagdolabel CTR ldiagangleto ] cvx def - - from (CTR) ldiagdolabel FANG from (CIRCUM) ldiagdolabel ldiagpadd - 0 0 fromarrowlength FANG ldiagatangle ldiagpadd /FROM ldiagpointdef - FANG /FROM@ANGLE ldiagangledef - - to (CTR) ldiagdolabel TANG to (CIRCUM) ldiagdolabel ldiagpadd - 0 0 toarrowlength TANG ldiagatangle ldiagpadd /TO ldiagpointdef - TANG 180 dg add /TO@ANGLE ldiagangledef - - /FDIST [ FROM CTR ldiagdistance ] cvx def - /TDIST [ TO CTR ldiagdistance ] cvx def - /XINDENT [ xindent FDIST ldiagmin ] cvx def - /ZINDENT [ zindent TDIST ldiagmin ] cvx def - FROM 0 0 XINDENT FANG ldiagatangle ldiagpadd /LFROM ldiagpointdef - FROM@ANGLE /LFROM@ANGLE ldiagangledef - TO 0 0 ZINDENT TANG ldiagatangle ldiagpadd /LTO ldiagpointdef - TO@ANGLE /LTO@ANGLE ldiagangledef - - CTR /LMID ldiagpointdef - 0 0 1 ft FANG 180 dg add ldiagatangle - 0 0 1 ft TANG 180 dg add ldiagatangle - ldiagangleto /LMID@ANGLE ldiagangledef - - FROM LFROM LMID LTO TO - - % (leaving ldiagvhlinepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop -} def - -% farr tarr { from } { to } xindent zindent radius ldiagvhcurvepath - -/ldiagvhcurvepath -{ - % (entering ldiagvhcurvepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop - /radius exch def - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - /CTR [ from (CTR) ldiagdolabel pop to (CTR) ldiagdolabel exch pop ] cvx def - /FANG [ from (CTR) ldiagdolabel CTR ldiagangleto ] cvx def - /TANG [ to (CTR) ldiagdolabel CTR ldiagangleto ] cvx def - - from (CTR) ldiagdolabel FANG from (CIRCUM) ldiagdolabel ldiagpadd - 0 0 fromarrowlength FANG ldiagatangle ldiagpadd /FROM ldiagpointdef - FANG /FROM@ANGLE ldiagangledef - - to (CTR) ldiagdolabel TANG to (CIRCUM) ldiagdolabel ldiagpadd - 0 0 toarrowlength TANG ldiagatangle ldiagpadd /TO ldiagpointdef - TANG 180 dg add /TO@ANGLE ldiagangledef - - /FDIST [ FROM CTR ldiagdistance ] cvx def - /TDIST [ TO CTR ldiagdistance ] cvx def - /RADIUS [ radius FDIST TDIST ldiagmin ldiagmin ] cvx def - /XINDENT [ xindent FDIST RADIUS sub ldiagmin ] cvx def - /ZINDENT [ zindent TDIST RADIUS sub ldiagmin ] cvx def - - FROM 0 0 XINDENT FANG ldiagatangle ldiagpadd /LFROM ldiagpointdef - FROM@ANGLE /LFROM@ANGLE ldiagangledef - TO 0 0 ZINDENT TANG ldiagatangle ldiagpadd /LTO ldiagpointdef - TO@ANGLE /LTO@ANGLE ldiagangledef - - /FCTR [ CTR 0 0 RADIUS FROM@ANGLE 180 dg add ldiagatangle ldiagpadd ] cvx def - /TCTR [ CTR 0 0 RADIUS TO@ANGLE ldiagatangle ldiagpadd ] cvx def - /XCTR [ CTR 0 0 RADIUS FROM@ANGLE 180 dg add ldiagatangle ldiagpadd - 0 0 RADIUS TO@ANGLE ldiagatangle ldiagpadd ] cvx def - XCTR 0 0 RADIUS XCTR CTR ldiagangleto ldiagatangle ldiagpadd - /LMID ldiagpointdef - FCTR TCTR ldiagangleto /LMID@ANGLE ldiagangledef - - FROM LFROM FCTR - {[XCTR clockwise]} {} {} {} {} {[XCTR]} {[XCTR clockwise]} {[XCTR]} - FCTR TCTR ldiagangleto ldiagquadcase - TCTR LTO TO - - % (leaving ldiagvhcurvepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop -} def - -% farr tarr { from } { to } xindent zindent ldiaghvlinepath - -/ldiaghvlinepath -{ - % (entering ldiaghvlinepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - /CTR [ to (CTR) ldiagdolabel pop from (CTR) ldiagdolabel exch pop ] cvx def - /FANG [ from (CTR) ldiagdolabel CTR ldiagangleto ] cvx def - /TANG [ to (CTR) ldiagdolabel CTR ldiagangleto ] cvx def - - from (CTR) ldiagdolabel FANG from (CIRCUM) ldiagdolabel ldiagpadd - 0 0 fromarrowlength FANG ldiagatangle ldiagpadd /FROM ldiagpointdef - FANG /FROM@ANGLE ldiagangledef - - to (CTR) ldiagdolabel TANG to (CIRCUM) ldiagdolabel ldiagpadd - 0 0 toarrowlength TANG ldiagatangle ldiagpadd /TO ldiagpointdef - TANG 180 dg add /TO@ANGLE ldiagangledef - - /FDIST [ FROM CTR ldiagdistance ] cvx def - /TDIST [ TO CTR ldiagdistance ] cvx def - /XINDENT [ xindent FDIST ldiagmin ] cvx def - /ZINDENT [ zindent TDIST ldiagmin ] cvx def - - FROM 0 0 XINDENT FANG ldiagatangle ldiagpadd /LFROM ldiagpointdef - FROM@ANGLE /LFROM@ANGLE ldiagangledef - TO 0 0 ZINDENT TANG ldiagatangle ldiagpadd /LTO ldiagpointdef - TO@ANGLE /LTO@ANGLE ldiagangledef - - CTR /LMID ldiagpointdef - 0 0 1 ft FANG 180 dg add ldiagatangle - 0 0 1 ft TANG 180 dg add ldiagatangle ldiagangleto - /LMID@ANGLE ldiagangledef - - FROM LFROM LMID LTO TO - - % (leaving ldiaghvlinepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop -} def - -% farr tarr { from } { to } xindent zindent radius ldiaghvcurvepath - -/ldiaghvcurvepath -{ - % (entering ldiaghvcurvepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop - /radius exch def - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - /CTR [ to (CTR) ldiagdolabel pop from (CTR) ldiagdolabel exch pop ] cvx def - /FANG [ from (CTR) ldiagdolabel CTR ldiagangleto ] cvx def - /TANG [ to (CTR) ldiagdolabel CTR ldiagangleto ] cvx def - - from (CTR) ldiagdolabel FANG from (CIRCUM) ldiagdolabel ldiagpadd - 0 0 fromarrowlength FANG ldiagatangle ldiagpadd /FROM ldiagpointdef - FANG /FROM@ANGLE ldiagangledef - - to (CTR) ldiagdolabel TANG to (CIRCUM) ldiagdolabel ldiagpadd - 0 0 toarrowlength TANG ldiagatangle ldiagpadd /TO ldiagpointdef - TANG 180 dg add /TO@ANGLE ldiagangledef - - /FDIST [ FROM CTR ldiagdistance ] cvx def - /TDIST [ TO CTR ldiagdistance ] cvx def - /RADIUS [ radius FDIST TDIST ldiagmin ldiagmin ] cvx def - /XINDENT [ xindent FDIST RADIUS sub ldiagmin ] cvx def - /ZINDENT [ zindent TDIST RADIUS sub ldiagmin ] cvx def - FROM 0 0 XINDENT FANG ldiagatangle ldiagpadd /LFROM ldiagpointdef - FROM@ANGLE /LFROM@ANGLE ldiagangledef - TO 0 0 ZINDENT TANG ldiagatangle ldiagpadd /LTO ldiagpointdef - TO@ANGLE /LTO@ANGLE ldiagangledef - - /FCTR [ CTR 0 0 RADIUS FROM@ANGLE 180 dg add ldiagatangle ldiagpadd ] cvx def - /TCTR [ CTR 0 0 RADIUS TO@ANGLE ldiagatangle ldiagpadd ] cvx def - /XCTR [ CTR 0 0 RADIUS FROM@ANGLE 180 dg add ldiagatangle ldiagpadd - 0 0 RADIUS TO@ANGLE ldiagatangle ldiagpadd ] cvx def - XCTR 0 0 RADIUS XCTR CTR ldiagangleto ldiagatangle ldiagpadd - /LMID ldiagpointdef - FCTR TCTR ldiagangleto /LMID@ANGLE ldiagangledef - - FROM LFROM FCTR - {[XCTR]} {} {} {} {} {[XCTR clockwise]} {[XCTR]} {[XCTR clockwise]} - FCTR TCTR ldiagangleto ldiagquadcase - TCTR LTO TO - - % (leaving ldiaghvcurvepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop -} def - -% farr tarr { from } { to } xindent zindent bias ldiaglvrlinepath - -/ldiaglvrlinepath -{ - % (entering ldiaglvrlinepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop - /bias exch def - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - from (CTR) ldiagdolabel 180 dg from (CIRCUM) ldiagdolabel ldiagpadd - 0 0 fromarrowlength 180 dg ldiagatangle ldiagpadd /FROM ldiagpointdef - 180 dg /FROM@ANGLE ldiagangledef - - to (CTR) ldiagdolabel 180 dg to (CIRCUM) ldiagdolabel ldiagpadd - 0 0 toarrowlength 180 dg ldiagatangle ldiagpadd /TO ldiagpointdef - 0 dg /TO@ANGLE ldiagangledef - - /XLEFT [ FROM pop TO pop ldiagmin bias sub ] cvx def - XLEFT FROM exch pop /P1 ldiagpointdef - XLEFT TO exch pop /P2 ldiagpointdef - /VERT [ P1 P2 ldiagangleto ] cvx def - P1 P1 0 0 1 ft 180 dg ldiagatangle ldiagpadd 0 0 1 ft VERT ldiagatangle - ldiagpadd ldiagangleto /P1@ANGLE ldiagangledef - P2 P2 0 0 1 ft 0 dg ldiagatangle ldiagpadd 0 0 1 ft VERT ldiagatangle - ldiagpadd ldiagangleto /P2@ANGLE ldiagangledef - - P1 0.5 ldiagpmul P2 0.5 ldiagpmul ldiagpadd /LMID ldiagpointdef - VERT /LMID@ANGLE ldiagangledef - - /XINDENT [ xindent FROM P1 ldiagdistance ldiagmin ] cvx def - /ZINDENT [ zindent P2 TO ldiagdistance ldiagmin ] cvx def - XINDENT 0 FROM ldiagpsub /LFROM ldiagpointdef - 180 dg /LFROM@ANGLE ldiagangledef - ZINDENT 0 TO ldiagpsub /LTO ldiagpointdef - 0 dg /LTO@ANGLE ldiagangledef - - FROM LFROM P1 LMID P2 LTO TO - - % (leaving ldiaglvrlinepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop -} def - -% farr tarr { from } { to } xindent zindent bias radius ldiaglvrcurvepath - -/ldiaglvrcurvepath -{ - % (entering ldiaglvrcurvepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop - /radius exch def - /bias exch def - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - from (CTR) ldiagdolabel 180 dg from (CIRCUM) ldiagdolabel ldiagpadd 0 0 - fromarrowlength 180 dg ldiagatangle ldiagpadd /FROM ldiagpointdef - 180 dg /FROM@ANGLE ldiagangledef - to (CTR) ldiagdolabel 180 dg to (CIRCUM) ldiagdolabel ldiagpadd 0 0 - toarrowlength 180 dg ldiagatangle ldiagpadd /TO ldiagpointdef - 0 dg /TO@ANGLE ldiagangledef - /XLEFT [ FROM pop TO pop ldiagmin bias sub ] cvx def - /XP1 [ XLEFT FROM exch pop ] cvx def - /XP2 [ XLEFT TO exch pop ] cvx def - /VERT [ XP1 XP2 ldiagangleto ] cvx def - XP1 0.5 ldiagpmul XP2 0.5 ldiagpmul ldiagpadd /LMID ldiagpointdef - VERT /LMID@ANGLE ldiagangledef - /XINDENT [ xindent FROM XP1 ldiagdistance ldiagmin ] cvx def - /ZINDENT [ zindent XP2 TO ldiagdistance ldiagmin ] cvx def - XINDENT 0 FROM ldiagpsub /LFROM ldiagpointdef - 180 dg /LFROM@ANGLE ldiagangledef - ZINDENT 0 TO ldiagpsub /LTO ldiagpointdef - 0 dg /LTO@ANGLE ldiagangledef - /RADIUS [ radius XP1 XP2 ldiagdistance 2 div ldiagmin ] cvx def - /XP1PRE [ XP1 0 0 RADIUS 0 dg ldiagatangle ldiagpadd ] cvx def - /XP1POST [ XP1 0 0 RADIUS VERT ldiagatangle ldiagpadd ] cvx def - /XP1CTR [ XP1PRE 0 0 RADIUS VERT ldiagatangle ldiagpadd ] cvx def - XP1CTR 0 0 RADIUS XP1CTR XP1 ldiagangleto ldiagatangle ldiagpadd - /P1 ldiagpointdef - XP1PRE XP1POST ldiagangleto /P1@ANGLE ldiagangledef - /XP2PRE [ 0 0 RADIUS VERT ldiagatangle XP2 ldiagpsub ] cvx def - /XP2POST [ XP2 0 0 RADIUS 0 dg ldiagatangle ldiagpadd ] cvx def - /XP2CTR [ XP2PRE 0 0 RADIUS 0 dg ldiagatangle ldiagpadd ] cvx def - XP2CTR 0 0 RADIUS XP2CTR XP2 ldiagangleto ldiagatangle ldiagpadd - /P2 ldiagpointdef - XP2PRE XP2POST ldiagangleto /P2@ANGLE ldiagangledef - FROM LFROM XP1PRE - { } { [XP1CTR] P1 [XP1CTR] } { } { [XP1CTR clockwise] P1 [XP1CTR clockwise] } - { } { } { } { } VERT round ldiagquadcase - XP1POST LMID XP2PRE - { } { [XP2CTR] P2 [XP2CTR] } { } { [XP2CTR clockwise] P2 [XP2CTR clockwise] } - { } { } { } { } VERT round ldiagquadcase - XP2POST LTO TO - - % (leaving ldiaglvrcurvepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop -} def - -% farr tarr { from } { to } xindent zindent bias ldiagrvllinepath - -/ldiagrvllinepath -{ - % (entering ldiagrvllinepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop - /bias exch def - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - from (CTR) ldiagdolabel 0 dg from (CIRCUM) ldiagdolabel ldiagpadd - 0 0 fromarrowlength 0 dg ldiagatangle ldiagpadd /FROM ldiagpointdef - 0 dg /FROM@ANGLE ldiagangledef - to (CTR) ldiagdolabel 0 dg to (CIRCUM) ldiagdolabel ldiagpadd - 0 0 toarrowlength 0 dg ldiagatangle ldiagpadd /TO ldiagpointdef - 180 dg /TO@ANGLE ldiagangledef - /XRIGHT [ FROM pop TO pop ldiagmax bias add ] cvx def - XRIGHT FROM exch pop /P1 ldiagpointdef - XRIGHT TO exch pop /P2 ldiagpointdef - /VERT [ P1 P2 ldiagangleto ] cvx def - P1 P1 0 0 1 ft 0 dg ldiagatangle ldiagpadd 0 0 1 ft VERT ldiagatangle - ldiagpadd ldiagangleto /P1@ANGLE ldiagangledef - P2 P2 0 0 1 ft 180 dg ldiagatangle ldiagpadd 0 0 1 ft VERT ldiagatangle - ldiagpadd ldiagangleto /P2@ANGLE ldiagangledef - P1 0.5 ldiagpmul P2 0.5 ldiagpmul ldiagpadd /LMID ldiagpointdef - VERT /LMID@ANGLE ldiagangledef - /XINDENT [ xindent FROM P1 ldiagdistance ldiagmin ] cvx def - /ZINDENT [ zindent P2 TO ldiagdistance ldiagmin ] cvx def - FROM XINDENT 0 ldiagpadd /LFROM ldiagpointdef - 0 dg /LFROM@ANGLE ldiagangledef - TO ZINDENT 0 ldiagpadd /LTO ldiagpointdef - 180 dg /LTO@ANGLE ldiagangledef - FROM LFROM P1 LMID P2 LTO TO - - % (leaving ldiagrvllinepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop -} def - - -% farr tarr { from } { to } xindent zindent bias radius ldiagrvlcurvepath - -/ldiagrvlcurvepath -{ - % (entering ldiagrvlcurvepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop - /radius exch def - /bias exch def - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - from (CTR) ldiagdolabel 0 dg from (CIRCUM) ldiagdolabel ldiagpadd - 0 0 fromarrowlength 0 dg ldiagatangle ldiagpadd /FROM ldiagpointdef - 0 dg /FROM@ANGLE ldiagangledef - to (CTR) ldiagdolabel 0 dg to (CIRCUM) ldiagdolabel ldiagpadd - 0 0 toarrowlength 0 dg ldiagatangle ldiagpadd /TO ldiagpointdef - 180 dg /TO@ANGLE ldiagangledef - /XRIGHT [ FROM pop TO pop ldiagmax bias add ] cvx def - /XP1 [ XRIGHT FROM exch pop ] cvx def - /XP2 [ XRIGHT TO exch pop ] cvx def - /VERT [ XP1 XP2 ldiagangleto ] cvx def - XP1 0.5 ldiagpmul XP2 0.5 ldiagpmul ldiagpadd /LMID ldiagpointdef - VERT /LMID@ANGLE ldiagangledef - /XINDENT [ xindent FROM XP1 ldiagdistance ldiagmin ] cvx def - /ZINDENT [ zindent XP2 TO ldiagdistance ldiagmin ] cvx def - FROM XINDENT 0 ldiagpadd /LFROM ldiagpointdef - 0 dg /LFROM@ANGLE ldiagangledef - TO ZINDENT 0 ldiagpadd /LTO ldiagpointdef - 180 dg /LTO@ANGLE ldiagangledef - /RADIUS [ radius XP1 XP2 ldiagdistance 0.5 mul ldiagmin ] cvx def - /XP1PRE [ XP1 0 0 RADIUS 180 dg ldiagatangle ldiagpadd ] cvx def - /XP1POST [ XP1 0 0 RADIUS VERT ldiagatangle ldiagpadd ] cvx def - /XP1CTR [ XP1PRE 0 0 RADIUS VERT ldiagatangle ldiagpadd ] cvx def - XP1CTR 0 0 RADIUS XP1CTR XP1 ldiagangleto ldiagatangle ldiagpadd - /P1 ldiagpointdef - XP1PRE XP1POST ldiagangleto /P1@ANGLE ldiagangledef - /XP2PRE [ 0 0 RADIUS VERT ldiagatangle XP2 ldiagpsub ] cvx def - /XP2POST [ XP2 0 0 RADIUS 180 dg ldiagatangle ldiagpadd ] cvx def - /XP2CTR [ XP2PRE 0 0 RADIUS 180 dg ldiagatangle ldiagpadd ] cvx def - XP2CTR 0 0 RADIUS XP2CTR XP2 ldiagangleto ldiagatangle ldiagpadd - /P2 ldiagpointdef - XP2PRE XP2POST ldiagangleto /P2@ANGLE ldiagangledef - FROM LFROM XP1PRE - {} {[XP1CTR clockwise] P1 [XP1CTR clockwise]} {} {[XP1CTR] P1 [XP1CTR]} - {} {} {} {} VERT round ldiagquadcase - XP1POST LMID XP2PRE - {} {[XP2CTR clockwise] P2 [XP2CTR clockwise]} {} {[XP2CTR] P2 [XP2CTR]} - {} {} {} {} VERT round ldiagquadcase - XP2POST LTO TO - - % (leaving ldiagrvlcurvepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop -} def - -% farr tarr { from } { to } xindent zindent bias fbias tbias ldiagdwraplinepath - -/ldiagdwraplinepath -{ - % (entering ldiagdwraplinepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop - /tbias exch def - /fbias exch def - /bias exch def - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - /DIRN [ from (CTR) ldiagdolabel pop to (CTR) ldiagdolabel pop - lt { 180 dg } { 0 dg } ifelse ] cvx def - from (CTR) ldiagdolabel DIRN from (CIRCUM) ldiagdolabel ldiagpadd 0 0 - fromarrowlength DIRN ldiagatangle ldiagpadd /FROM ldiagpointdef - DIRN /FROM@ANGLE ldiagangledef - to (CTR) ldiagdolabel DIRN 180 dg add to (CIRCUM) ldiagdolabel ldiagpadd - 0 0 toarrowlength DIRN 180 dg add ldiagatangle ldiagpadd /TO ldiagpointdef - DIRN /TO@ANGLE ldiagangledef - FROM 0 0 fbias 0 ldiagmax DIRN ldiagatangle ldiagpadd /P1 ldiagpointdef - DIRN 180 dg eq { 225 dg } { -45 dg } ifelse /P1@ANGLE ldiagangledef - TO 0 0 tbias 0 ldiagmax DIRN 180 dg add ldiagatangle ldiagpadd - /P4 ldiagpointdef - DIRN 180 dg eq { 135 dg } { 45 dg } ifelse /P4@ANGLE ldiagangledef - /YC [ from (CTR) ldiagdolabel 270 dg from (CIRCUM) ldiagdolabel ldiagpadd - exch pop to (CTR) ldiagdolabel 270 dg to (CIRCUM) ldiagdolabel ldiagpadd - exch pop ldiagmin bias 0 ldiagmax sub ] cvx def - P1 pop YC /P2 ldiagpointdef - P4@ANGLE 180 dg sub /P2@ANGLE ldiagangledef - P4 pop YC /P3 ldiagpointdef - P1@ANGLE 180 dg sub /P3@ANGLE ldiagangledef - /XINDENT [ xindent FROM P1 ldiagdistance ldiagmin ] cvx def - FROM 0 0 XINDENT DIRN ldiagatangle ldiagpadd /LFROM ldiagpointdef - FROM@ANGLE /LFROM@ANGLE ldiagangledef - /ZINDENT [ zindent TO P4 ldiagdistance ldiagmin ] cvx def - TO 0 0 ZINDENT DIRN 180 dg add ldiagatangle ldiagpadd /LTO ldiagpointdef - TO@ANGLE /LTO@ANGLE ldiagangledef - P2 0.5 ldiagpmul P3 0.5 ldiagpmul ldiagpadd /LMID ldiagpointdef - DIRN 180 dg sub /LMID@ANGLE ldiagangledef - FROM P1 P2 P3 P4 TO - - % (leaving ldiagdwraplinepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop -} def - -% farr tarr { from } { to } xindent zindent bias fbias tbias radius -% ldiagdwrapcurvepath - -/ldiagdwrapcurvepath -{ - % (entering ldiagdwrapcurvepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop - /radius exch def - /tbias exch def - /fbias exch def - /bias exch def - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - /DIRN [ from (CTR) ldiagdolabel pop to (CTR) ldiagdolabel pop lt - { 180 dg } { 0 dg } ifelse ] cvx def - /CLOCK [ from (CTR) ldiagdolabel pop to (CTR) ldiagdolabel pop lt - { anticlockwise } { clockwise } ifelse ] cvx def - from (CTR) ldiagdolabel DIRN from (CIRCUM) ldiagdolabel ldiagpadd - 0 0 fromarrowlength DIRN ldiagatangle ldiagpadd /FROM ldiagpointdef - DIRN /FROM@ANGLE ldiagangledef - to (CTR) ldiagdolabel DIRN 180 dg add to (CIRCUM) ldiagdolabel ldiagpadd - 0 0 toarrowlength DIRN 180 dg add ldiagatangle ldiagpadd /TO ldiagpointdef - DIRN /TO@ANGLE ldiagangledef - /XP1 [ FROM 0 0 fbias 0 ldiagmax DIRN ldiagatangle ldiagpadd ] cvx def - /XP4 [ TO 0 0 tbias 0 ldiagmax DIRN 180 dg add ldiagatangle ldiagpadd ] cvx def - /YC [ from (CTR) ldiagdolabel 270 dg from (CIRCUM) ldiagdolabel ldiagpadd - exch pop to (CTR) ldiagdolabel 270 dg to (CIRCUM) ldiagdolabel ldiagpadd - exch pop ldiagmin bias 0 ldiagmax sub ] cvx def - /XP2 [ XP1 pop YC ] cvx def - /XP3 [ XP4 pop YC ] cvx def - /RP1 [ radius XP1 FROM ldiagdistance XP1 XP2 ldiagdistance 2 div - ldiagmin ldiagmin ] cvx def - /XP1PRE [ XP1 0 0 RP1 XP1 FROM ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP1POST [ XP1 0 0 RP1 XP1 XP2 ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP1CTR [ XP1PRE 0 0 RP1 XP1 XP2 ldiagangleto ldiagatangle ldiagpadd ] cvx def - XP1CTR 0 0 RP1 XP1CTR XP1 ldiagangleto ldiagatangle ldiagpadd /P1 ldiagpointdef - XP1CTR P1 ldiagangleto DIRN add 90 dg sub /P1@ANGLE ldiagangledef - /RP2 [ radius XP1 XP2 ldiagdistance 2 div XP2 XP3 ldiagdistance 2 div - ldiagmin ldiagmin ] cvx def - /XP2PRE [ XP2 0 0 RP2 XP2 XP1 ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP2POST [ XP2 0 0 RP2 XP2 XP3 ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP2CTR [ XP2PRE 0 0 RP2 XP2 XP3 ldiagangleto ldiagatangle ldiagpadd ] cvx def - XP2CTR 0 0 RP2 XP2CTR XP2 ldiagangleto ldiagatangle ldiagpadd /P2 ldiagpointdef - XP2CTR P2 ldiagangleto DIRN add 90 dg sub /P2@ANGLE ldiagangledef - /RP3 [ radius XP2 XP3 ldiagdistance 2 div XP3 XP4 ldiagdistance 2 div - ldiagmin ldiagmin ] cvx def - /XP3PRE [ XP3 0 0 RP3 XP3 XP2 ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP3POST [ XP3 0 0 RP3 XP3 XP4 ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP3CTR [ XP3PRE 0 0 RP3 XP3 XP4 ldiagangleto ldiagatangle ldiagpadd ] cvx def - XP3CTR 0 0 RP3 XP3CTR XP3 ldiagangleto ldiagatangle ldiagpadd /P3 ldiagpointdef - XP3CTR P3 ldiagangleto DIRN add 90 dg sub /P3@ANGLE ldiagangledef - /RP4 [ radius XP4 XP3 ldiagdistance 2 div XP4 TO ldiagdistance - ldiagmin ldiagmin ] cvx def - /XP4PRE [ XP4 0 0 RP4 XP4 XP3 ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP4POST [ XP4 0 0 RP4 XP4 TO ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP4CTR [ XP4PRE 0 0 RP4 XP4 TO ldiagangleto ldiagatangle ldiagpadd ] cvx def - XP4CTR 0 0 RP4 XP4CTR XP4 ldiagangleto ldiagatangle ldiagpadd /P4 ldiagpointdef - XP4CTR P4 ldiagangleto DIRN add 90 dg sub /P4@ANGLE ldiagangledef - /XINDENT [ xindent FROM XP1PRE ldiagdistance ldiagmin ] cvx def - FROM 0 0 XINDENT DIRN ldiagatangle ldiagpadd /LFROM ldiagpointdef - FROM@ANGLE /LFROM@ANGLE ldiagangledef - XP2 0.5 ldiagpmul XP3 0.5 ldiagpmul ldiagpadd /LMID ldiagpointdef - DIRN 180 dg sub /LMID@ANGLE ldiagangledef - /ZINDENT [ zindent TO XP4POST ldiagdistance ldiagmin ] cvx def - TO 0 0 ZINDENT DIRN 180 dg add ldiagatangle ldiagpadd /LTO ldiagpointdef - TO@ANGLE /LTO@ANGLE ldiagangledef - FROM LFROM - XP1PRE [XP1CTR CLOCK] XP1POST - XP2PRE [XP2CTR CLOCK] XP2POST - LMID - XP3PRE [XP3CTR CLOCK] XP3POST - XP4PRE [XP4CTR CLOCK] XP4POST - LTO TO - - % (leaving ldiagdwrapcurvepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop -} def - -% farr tarr { from } { to } xindent zindent bias fbias tbias ldiaguwraplinepath - -/ldiaguwraplinepath -{ - % (entering ldiaguwraplinepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop - /tbias exch def - /fbias exch def - /bias exch def - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - /DIRN [ from (CTR) ldiagdolabel pop to (CTR) ldiagdolabel pop lt - { 180 dg } { 0 dg } ifelse ] cvx def - from (CTR) ldiagdolabel DIRN from (CIRCUM) ldiagdolabel ldiagpadd - 0 0 fromarrowlength DIRN ldiagatangle ldiagpadd /FROM ldiagpointdef - DIRN /FROM@ANGLE ldiagangledef - to (CTR) ldiagdolabel DIRN 180 dg add to (CIRCUM) ldiagdolabel ldiagpadd - 0 0 toarrowlength DIRN 180 dg add ldiagatangle ldiagpadd /TO ldiagpointdef - DIRN /TO@ANGLE ldiagangledef - FROM 0 0 fbias 0 ldiagmax DIRN ldiagatangle ldiagpadd /P1 ldiagpointdef - DIRN 180 dg eq { 135 dg } { 45 dg } ifelse /P1@ANGLE ldiagangledef - TO 0 0 tbias 0 ldiagmax DIRN 180 dg add ldiagatangle ldiagpadd - /P4 ldiagpointdef - DIRN 180 dg eq { 225 dg } { -45 dg } ifelse /P4@ANGLE ldiagangledef - /YC [ from (CTR) ldiagdolabel 90 dg from (CIRCUM) ldiagdolabel ldiagpadd - exch pop to (CTR) ldiagdolabel 90 dg to (CIRCUM) ldiagdolabel ldiagpadd - exch pop ldiagmax bias 0 ldiagmax add ] cvx def - P1 pop YC /P2 ldiagpointdef - P4@ANGLE 180 dg sub /P2@ANGLE ldiagangledef - P4 pop YC /P3 ldiagpointdef - P1@ANGLE 180 dg sub /P3@ANGLE ldiagangledef - /XINDENT [ xindent FROM P1 ldiagdistance ldiagmin ] cvx def - FROM 0 0 XINDENT DIRN ldiagatangle ldiagpadd /LFROM ldiagpointdef - FROM@ANGLE /LFROM@ANGLE ldiagangledef - /ZINDENT [ zindent TO P4 ldiagdistance ldiagmin ] cvx def - TO 0 0 ZINDENT DIRN 180 dg add ldiagatangle ldiagpadd /LTO ldiagpointdef - TO@ANGLE /LTO@ANGLE ldiagangledef - P2 0.5 ldiagpmul P3 0.5 ldiagpmul ldiagpadd /LMID ldiagpointdef - DIRN 180 dg sub /LMID@ANGLE ldiagangledef - FROM P1 P2 P3 P4 TO - - % (leaving ldiaguwraplinepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop -} def - -% farr tarr { from } { to } xindent zindent bias fbias tbias radius -% ldiaguwrapcurvepath - -/ldiaguwrapcurvepath -{ - % (entering ldiaguwrapcurvepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop - /radius exch def - /tbias exch def - /fbias exch def - /bias exch def - /zindent exch def - /xindent exch def - cvlit /to exch def - cvlit /from exch def - /toarrowlength exch def - /fromarrowlength exch def - - /DIRN [ from (CTR) ldiagdolabel pop to (CTR) ldiagdolabel pop lt - { 180 dg } { 0 dg } ifelse ] cvx def - /CLOCK [ from (CTR) ldiagdolabel pop to (CTR) ldiagdolabel pop lt - { clockwise } { anticlockwise } ifelse ] cvx def - from (CTR) ldiagdolabel DIRN from (CIRCUM) ldiagdolabel ldiagpadd - 0 0 fromarrowlength DIRN ldiagatangle ldiagpadd /FROM ldiagpointdef - DIRN /FROM@ANGLE ldiagangledef - to (CTR) ldiagdolabel DIRN 180 dg add to (CIRCUM) ldiagdolabel ldiagpadd - 0 0 toarrowlength DIRN 180 dg add ldiagatangle ldiagpadd /TO ldiagpointdef - DIRN /TO@ANGLE ldiagangledef - /XP1 [ FROM 0 0 fbias 0 ldiagmax DIRN ldiagatangle ldiagpadd ] cvx def - /XP4 [ TO 0 0 tbias 0 ldiagmax DIRN 180 dg add ldiagatangle ldiagpadd ] cvx def - /YC [ from (CTR) ldiagdolabel 90 dg from (CIRCUM) ldiagdolabel ldiagpadd - exch pop to (CTR) ldiagdolabel 90 dg to (CIRCUM) ldiagdolabel ldiagpadd - exch pop ldiagmax bias 0 ldiagmax add ] cvx def - /XP2 [ XP1 pop YC ] cvx def - /XP3 [ XP4 pop YC ] cvx def - /RP1 [ radius XP1 FROM ldiagdistance XP1 XP2 ldiagdistance 2 div - ldiagmin ldiagmin ] cvx def - /XP1PRE [ XP1 0 0 RP1 XP1 FROM ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP1POST [ XP1 0 0 RP1 XP1 XP2 ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP1CTR [ XP1PRE 0 0 RP1 XP1 XP2 ldiagangleto ldiagatangle ldiagpadd ] cvx def - XP1CTR 0 0 RP1 XP1CTR XP1 ldiagangleto ldiagatangle ldiagpadd /P1 ldiagpointdef - XP1CTR P1 ldiagangleto DIRN add 90 dg add /P1@ANGLE ldiagangledef - /RP2 [ radius XP1 XP2 ldiagdistance 2 div XP2 XP3 ldiagdistance 2 div - ldiagmin ldiagmin ] cvx def - /XP2PRE [ XP2 0 0 RP2 XP2 XP1 ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP2POST [ XP2 0 0 RP2 XP2 XP3 ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP2CTR [ XP2PRE 0 0 RP2 XP2 XP3 ldiagangleto ldiagatangle ldiagpadd ] cvx def - XP2CTR 0 0 RP2 XP2CTR XP2 ldiagangleto ldiagatangle ldiagpadd /P2 ldiagpointdef - XP2CTR P2 ldiagangleto DIRN add 90 dg add /P2@ANGLE ldiagangledef - /RP3 [ radius XP2 XP3 ldiagdistance 2 div XP3 XP4 ldiagdistance 2 div - ldiagmin ldiagmin ] cvx def - /XP3PRE [ XP3 0 0 RP3 XP3 XP2 ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP3POST [ XP3 0 0 RP3 XP3 XP4 ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP3CTR [ XP3PRE 0 0 RP3 XP3 XP4 ldiagangleto ldiagatangle ldiagpadd ] cvx def - XP3CTR 0 0 RP3 XP3CTR XP3 ldiagangleto ldiagatangle ldiagpadd /P3 ldiagpointdef - XP3CTR P3 ldiagangleto DIRN add 90 dg add /P3@ANGLE ldiagangledef - /RP4 [ radius XP4 XP3 ldiagdistance 2 div XP4 TO ldiagdistance - ldiagmin ldiagmin ] cvx def - /XP4PRE [ XP4 0 0 RP4 XP4 XP3 ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP4POST [ XP4 0 0 RP4 XP4 TO ldiagangleto ldiagatangle ldiagpadd ] cvx def - /XP4CTR [ XP4PRE 0 0 RP4 XP4 TO ldiagangleto ldiagatangle ldiagpadd ] cvx def - XP4CTR 0 0 RP4 XP4CTR XP4 ldiagangleto ldiagatangle ldiagpadd /P4 ldiagpointdef - XP4CTR P4 ldiagangleto DIRN add 90 dg add /P4@ANGLE ldiagangledef - /XINDENT [ xindent FROM XP1PRE ldiagdistance ldiagmin ] cvx def - FROM 0 0 XINDENT DIRN ldiagatangle ldiagpadd /LFROM ldiagpointdef - FROM@ANGLE /LFROM@ANGLE ldiagangledef - XP2 0.5 ldiagpmul XP3 0.5 ldiagpmul ldiagpadd /LMID ldiagpointdef - DIRN 180 dg sub /LMID@ANGLE ldiagangledef - /ZINDENT [ zindent TO XP4POST ldiagdistance ldiagmin ] cvx def - TO 0 0 ZINDENT DIRN 180 dg add ldiagatangle ldiagpadd /LTO ldiagpointdef - TO@ANGLE /LTO@ANGLE ldiagangledef - FROM LFROM - XP1PRE [XP1CTR CLOCK] XP1POST - XP2PRE [XP2CTR CLOCK] XP2POST - LMID - XP3PRE [XP3CTR CLOCK] XP3POST - XP4PRE [XP4CTR CLOCK] XP4POST - LTO TO - - % (leaving ldiaguwrapcurvepath) 0 ldiagdebugprint - % count ( stack size is) 1 ldiagdebugprint pop -} def - -% shape and labels of the @SolidArrowHead symbol -% - ldiagsolidarrowhead - -/ldiagsolidarrowhead -{ - 0 0 xsize ysize 0.5 mul 0 ysize -} def - -% shape and labels of the @OpenArrowHead symbol -% <pathwidth> ldiagopenarrowhead - -/ldiagopenarrowhead -{ - /pathwidth exch def - /PSW [ 0 0 ] cvx def - /PNW [ 0 ysize ] cvx def - /PE [ xsize ysize 0.5 mul ] cvx def - /REL [ 0 0 pathwidth PE PNW ldiagangleto 90 add ldiagatangle ] cvx def - /PNA [ 0 ysize 0.5 mul pathwidth 0.5 mul add ] cvx def - /PSA [ 0 ysize 0.5 mul pathwidth 0.5 mul sub ] cvx def - /PNI [ PNA PNA xsize 0 ldiagpadd PNW REL ldiagpadd - PE REL ldiagpadd ldiaglineintersect ] cvx def - /PSI [ 0 pathwidth PNI ldiagpsub ] cvx def - - PSW PE PNW PNI PNA PSA PSI PSW -} def - -% shape and labels of the @HalfOpenArrowHead symbol -% <pathwidth> ldiaghalfopenarrowhead - -/ldiaghalfopenarrowhead -{ - /pathwidth exch def - 0 0 - xsize ysize 0.5 mul - 0 ysize - xsize 0.3 mul ysize 0.5 mul pathwidth 0.5 mul add - 0 ysize 0.5 mul pathwidth 0.5 mul add - 0 ysize 0.5 mul pathwidth 0.5 mul sub - xsize 0.3 mul ysize 0.5 mul pathwidth 0.5 mul sub - 0 0 -} def - -% shape and labels of the @SolidCurvedArrowHead symbol -% - ldiagsolidcurvedarrowhead - -/ldiagsolidcurvedarrowhead -{ - 0 0 - [0 0 xsize ysize 0.5 mul ldiaglinebetween - xsize 0 xsize ysize ldiaglineintersect clockwise] - xsize ysize 0.5 mul - [xsize ysize 0.5 mul 0 ysize ldiaglinebetween - xsize 0 xsize ysize ldiaglineintersect clockwise] - 0 ysize -} def - -% shape and labels of the @OpenCurvedArrowHead symbol -% <pathwidth> ldiagopencurvedarrowhead - -/ldiagopencurvedarrowhead -{ - /pathwidth exch def - /LR [ 0 0 xsize ysize 0.5 mul ldiaglinebetween - xsize 0 xsize ysize ldiaglineintersect - ] cvx def - /UR [ xsize ysize 0.5 mul 0 ysize ldiaglinebetween - xsize 0 xsize ysize ldiaglineintersect - ] cvx def - /PW2 [ pathwidth 0.5 mul ] cvx def - /UMID [ - 0 ysize 0.5 mul PW2 add - xsize ysize 0.5 mul PW2 add - 0 ysize 0 0 1 ft UR 0 ysize ldiagangleto 90 add ldiagatangle - ldiagpadd 0 ysize ldiaglineintersect - ] cvx def - /LMID [ 0 pathwidth UMID ldiagpsub ] cvx def - 0 0 - [LR clockwise] - xsize ysize 0.5 mul - [UR clockwise] - 0 ysize - UMID - 0 ysize 0.5 mul PW2 add - 0 ysize 0.5 mul PW2 sub - LMID - 0 0 -} def - -% shape and labels of the @HalfOpenCurvedArrowHead symbol -% <pathwidth> ldiaghalfopencurvedarrowhead - -/ldiaghalfopencurvedarrowhead -{ - /pathwidth exch def - /LR [ 0 0 xsize ysize 0.5 mul ldiaglinebetween - xsize 0 xsize ysize ldiaglineintersect - ] cvx def - /UR [ xsize ysize 0.5 mul 0 ysize ldiaglinebetween - xsize 0 xsize ysize ldiaglineintersect - ] cvx def - /BR [ 0 0 LR 0 ysize UR ldiaglineintersect ] cvx def - /BRAD [ 0 0 BR ldiagdistance ] cvx def - /PW2 [ pathwidth 0.5 mul ] cvx def - /XDIST [ BRAD dup mul PW2 dup mul sub sqrt ] cvx def - /UMID [ BR XDIST PW2 ldiagpadd ] cvx def - /LMID [ BR XDIST 0 PW2 sub ldiagpadd ] cvx def - 0 0 - [LR clockwise] - xsize ysize 0.5 mul - [UR clockwise] - 0 ysize - [BR clockwise] - UMID - 0 ysize 0.5 mul PW2 add - 0 ysize 0.5 mul PW2 sub - LMID - [BR clockwise] - 0 0 -} def - -end -%%EndResource - -%%BeginResource: procset LoutBasicSetup -% @PrependGraphic file /export/home/6monthspace/jeff/lout.lib/include/bsf.lpg - -% width height linethickness louteuro - -% draw a Euro symbol of this width and height with this line thickness -/louteuro { - 20 dict begin - /eurothick exch def - /euroheight exch def - /eurowidth exch def - /eurostrokewidth euroheight 0.8 mul def - /eurostep eurothick 60 cos mul 60 sin div def - /eurotheta 40 def - - % llx lly width thickness louteurobox - - % draw angled box starting at (llx, lly) with given width and thickness - /louteurobox - { - /euroboxthick exch def - /euroboxwidth exch def - newpath moveto euroboxwidth 0 rlineto - eurostep euroboxthick rlineto - euroboxwidth neg 0 rlineto closepath fill - } def - - % lower cross stroke - 0 euroheight 2 div eurothick 1.5 mul sub - eurostrokewidth eurothick louteurobox - - % upper cross stroke - 0 euroheight 2 div eurothick 0.5 mul add - eurostrokewidth eurostep 2 mul add eurothick louteurobox - - % circular part - /eurohctr eurowidth euroheight 2 div eurotheta cos mul sub def - /eurovctr euroheight 2 div def - newpath - eurohctr eurovctr eurovctr eurotheta 350 eurotheta sub arc - eurohctr eurovctr eurovctr eurothick sub 365 eurotheta sub eurotheta arcn - closepath fill - end -} def - -% path for @FullWidthRule symbol -/LoutRule -{ 0 0 moveto xsize 0 lineto -} def - -% path for @Box symbol -/LoutBox -{ 0 0 moveto xsize 0 lineto - xsize ysize lineto 0 ysize lineto - closepath -} def - -% path for @CurveBox symbol -/LoutCurveBox -{ xmark 0 moveto - xsize xmark sub xmark xmark 270 360 arc - xsize xmark sub ysize xmark sub xmark 0 90 arc - xmark ysize xmark sub xmark 90 180 arc - xmark xmark xmark 180 270 arc - closepath -} def - -% path for @ShadowBox symbol -/LoutShadowBox -{ xmark 2 mul 0 moveto xsize 0 lineto - xsize ysize xmark 2 mul sub lineto - xsize xmark sub ysize xmark 2 mul sub lineto - xsize xmark sub xmark lineto - xmark 2 mul xmark lineto - closepath -} def - -% set up dictionary containing margin note data: parity LoutMargSet - -/LoutMargSet -{ /LoutMargDict 12 dict def - LoutMargDict begin - /parity exch def - /matr matrix currentmatrix def - /rightx xsize def - /lefty ysize def % highest allowable point for top of next left note - /righty ysize def % highest allowable point for top of next right note - /max { 2 copy gt { pop } { exch pop } ifelse } def - /min { 2 copy lt { pop } { exch pop } ifelse } def - end -} def - -%translate coordinate system for marginal notes: type LoutMargShift - -% where type 0 is left margin, 1 is right margin, 2 is outer, 3 is inner -/LoutMargShift -{ LoutMargDict begin - - % y coordinate of top of note, in margin coords, before vertical adjust - 0 ysize transform matr itransform exch pop - - % decide whether left or right margin based on type and parity - exch [ 0 1 parity 1 parity sub ] exch get 0 eq - { - % left margin: adjust top of note downwards if overlaps previous note - lefty min - - % bottom of note is new lefty position and also translate position - ysize sub dup /lefty exch def - - % want right edge of note at coordinate zero - xsize neg exch - } - { - % right margin: adjust top of note downwards if overlaps previous note - righty min - - % bottom of note is new righty position and also translate position - ysize sub dup /righty exch def - - % want left edge of note at coordinate rightx - rightx exch - } ifelse - - % stack now contains coord of bottom left corner in margin coordinates - matr setmatrix translate - end -} def - -% create LoutPageDict with left, right, foot, top for @Place symbol users -/LoutPageSet -{ - /LoutPageDict 5 dict def - LoutPageDict begin - /matr matrix currentmatrix def - /left 0 def - /right xsize def - /foot 0 def - /top ysize def - end - -} def - -%%EndResource - -%%EndProlog - -%%BeginSetup -%%IncludeResource: font Times-Roman -/Times-Romanfnt82 vec2 /Times-Roman LoutRecode -/fnt82 { /Times-Romanfnt82 LoutFont } def -%%IncludeResource: font Helvetica -/Helveticafnt35 vec2 /Helvetica LoutRecode -/fnt35 { /Helveticafnt35 LoutFont } def -%%IncludeResource: font Symbol -/fnt78 { /Symbol LoutFont } def -%%EndSetup - -%%Page: i 1 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Helvetica -%%+ font Symbol -/pgsave save def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup - -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -1 LoutMargSet -grestore -600 fnt35 1751 12125(A)m 2310(User')s 30(s)k 4123(Guide)s -5863(to)s 6507(the)s 3956 10685(Lout)m 616 9245(Document)m 3500(F)s 18(or)k -15(matting)k -6490(System)s 240 fnt35 3544 6059(Jeffre)m 4(y)k 4321(H.)s -4606(Kingston)s 3883 4395(V)m 19(ersion)k 4726(3.20)s 3974 4107(Apr)m -3(il,)k -4567(2000)s 0 340(Cop)m 7(yr)k -3(ight)k 240 fnt78 -1080 342(\343)m 240 fnt35 1323 340(1991,)m 1967(2000)s 2558(Jeffre)s 4(y)k -3335(H.)s 3620(Kingston,)s 4663(Basser)s 5475(Depar)s -9(tment)k -6793(of)s 7055(Computer)s 8171(Science)s 3(,)k 0 52(The)m -469(Univ)s 6(ersity)k 1577(of)s 1839(Sydne)s 4(y)k -2698(2006,)s 3342(A)s 7(ustr)k 2(alia.)k 4441(ISBN)s -5048(0)s 5239(86758)s 5961(951)s 6379(5.)s -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: ii 2 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Bold -/pgsave save def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -0 LoutMargSet -grestore -480 fnt84 0 12955(Contents)m 240 fnt84 0 11982(Chapter)m 908(1)s -240 fnt82 1015 11983(.)m 240 fnt84 1179 11982(Computer)m 2286(Pr)s 4(ograms)k -240 fnt82 3770 11983(..)m 4114(..)s 4458(..)s 4802(..)s -5146(..)s 5490(..)s 5834(..)s 6178(..)s 6522(..)s -6866(..)s 7210(..)s 7554(..)s 7898(..)s 8242(..)s -8971(1)s 720 11638(1.1.)m 1184(T)s 19(ypesetting)k 2347(computer)s -3310(programs)s 4264(independently)s 5674(of)s 5945(an)s 3(y)k -6342(document)s 7554(..)s 7898(..)s 8242(..)s 8971(1)s -720 11293(1.2.)m 1184(T)s 19(ypesetting)k 2347(computer)s 3310(programs)s -4264(as)s 4514(part)s 4945(of)s 5216(a)s 5382(lar)s 4(ger)k -5994(document)s 7210(..)s 7554(..)s 7898(..)s 8242(..)s -8952(2)s 720 10948(1.3.)m 1184(Changing)s 2169(the)s 2517(appearance)s -3648(of)s 3919(a)s 4085(program)s 5146(..)s 5490(..)s -5834(..)s 6178(..)s 6522(..)s 6866(..)s 7210(..)s -7554(..)s 7898(..)s 8242(..)s 8952(4)s 720 10603(1.4.)m -1184(Changing)s 2169(the)s 2517(appearance)s 3648(of)s 3919(all)s -4212(programs)s 5166(simultaneously)s 6866(..)s 7210(..)s 7554(..)s -7898(..)s 8242(..)s 8953(6)s 720 10258(1.5.)m 1184(Dealing)s -1994(with)s 2476(tab)s 2821(characters)s 3839(in)s 4082(programs)s -5490(..)s 5834(..)s 6178(..)s 6522(..)s 6866(..)s -7210(..)s 7554(..)s 7898(..)s 8242(..)s 8959(8)s -720 9913(1.6.)m 1184(Dealing)s 1994(with)s 2476(formfeed)s 3409(characters)s -4427(in)s 4670(programs)s 5834(..)s 6178(..)s 6522(..)s -6866(..)s 7210(..)s 7554(..)s 7898(..)s 8242(..)s -8955(9)s 720 9568(1.7.)m 1184(Embedding)s 2341(Lout)s 2853(commands)s -3941(within)s 4609(program)s 5479(comments)s 6866(..)s 7210(..)s -7554(..)s 7898(..)s 8242(..)s 8831(10)s 720 9223(1.8.)m -1184(Embedding)s 2341(program)s 3211(te)s 3(xt)k 3626(within)s -4294(program)s 5164(comments)s 6522(..)s 6866(..)s 7210(..)s -7554(..)s 7898(..)s 8242(..)s 8831(10)s 720 8878(1.9.)m -1184(Reading)s 2035(and)s 2439(selecting)s 3341(program)s 4211(te)s 3(xt)k -4626(from)s 5150(separate)s 5988(\207les)s 6866(..)s 7210(..)s -7554(..)s 7898(..)s 8242(..)s 8851(11)s 720 8533(1.10.)m -1304(Error)s 1867(messages)s 3082(..)s 3426(..)s 3770(..)s -4114(..)s 4458(..)s 4802(..)s 5146(..)s 5490(..)s -5834(..)s 6178(..)s 6522(..)s 6866(..)s 7210(..)s -7554(..)s 7898(..)s 8242(..)s 8832(12)s 720 8188(1.11.)m -1304(Notes)s 1913(on)s 2210(Perl)s 2649(and)s 3053(Pod)s -3770(..)s 4114(..)s 4458(..)s 4802(..)s 5146(..)s -5490(..)s 5834(..)s 6178(..)s 6522(..)s 6866(..)s -7210(..)s 7554(..)s 7898(..)s 8242(..)s 8832(12)s -240 fnt84 0 7558(Refer)m 4(ences)k 240 fnt82 1362 7559(..)m -1706(..)s 2050(..)s 2394(..)s 2738(..)s 3082(..)s -3426(..)s 3770(..)s 4114(..)s 4458(..)s 4802(..)s -5146(..)s 5490(..)s 5834(..)s 6178(..)s 6522(..)s -6866(..)s 7210(..)s 7554(..)s 7898(..)s 8242(..)s -8840(15)s 240 fnt84 0 6930(Index)m 240 fnt82 1018 6931(..)m -1362(..)s 1706(..)s 2050(..)s 2394(..)s 2738(..)s -3082(..)s 3426(..)s 3770(..)s 4114(..)s 4458(..)s -4802(..)s 5146(..)s 5490(..)s 5834(..)s 6178(..)s -6522(..)s 6866(..)s 7210(..)s 7554(..)s 7898(..)s -8242(..)s 8833(16)s -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 1 3 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Bold -%%+ font Helvetica -%%+ font Times-Italic -%%+ font Times-Italic -/pgsave save def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -%%IncludeResource: font Times-Italic -/Times-Italicfnt90 vec2 /Times-Italic LoutRecode -/fnt90 { /Times-Italicfnt90 LoutFont } def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -1 LoutMargSet -grestore -480 fnt84 0 12955(Chapter)m 1819(1.)s 2400(Computer)s 4618(Pr)s 8(ograms)k -240 fnt82 0 12003(This)m 471(chapter)s 1228(describes)s 2162(ho)s 6(w)k -2617(to)s 2850(typeset)s 3581(computer)s 4538(program)s 5403(te)s 3(xt)k -5812(using)s 6378(Lout)s 6884(in)s 7121(conjunction)s 8302(with)s -8778(the)s 220 fnt35 0 11712(prg2lout)m 153 fnt82 788 11804(1)m -240 fnt82 908 11715(\207lter)m 1418(program,)s 2335(which)s 2977(is)s -3187(al)s 2(w)k 2(ays)k 3898(installed)s 4765(where)s 6(v)k 3(er)k -5705(Lout)s 6217(is.)s 480 11341(It)m 680(is)s 884(possible)s -1719(to)s 1952(simply)s 2652(print)s 3157(out)s 3518(one)s -3914(or)s 4168(more)s 4709(program)s 5574(\207les)s 6017(independently)s -7422(of)s 7687(an)s 3(y)k 8078(document.)s 0 11053(Alternati)m 6(v)k 3(ely)k 15(,)k -1355(the)s 1715(program)s 2598(te)s 3(xt)k 3025(may)s -3503(be)s 3798(printed)s 4545(as)s 4807(part)s 5251(of)s -5534(a)s 5712(lar)s 4(ger)k 6337(Lout)s 6861(document.)s -7981(Either)s 8637(w)s 2(ay)k 15(,)k 0 10765(Lout)m -525(does)s 1028(not)s 1407(lay)s 1767(out)s 2146(the)s -2507(programs)s 3475(in)s 3731(the)s 4092(sense)s 4679(of)s -4964(choosing)s 5895(line)s 6322(breaks)s 7011(and)s 7428(indenting;)s -8457(it)s 8663(uses)s 0 10477(whate)m 6(v)k 3(er)k -942(line)s 1371(breaks)s 2061(and)s 2480(indenting)s 3452(you)s -3882(gi)s 6(v)k 3(e)k 4356(to)s 4610(the)s -4973(program.)s 5962(What)s 6555(Lout)s 7082(does)s 7587(do)s -7895(is)s 8120(cope)s 8644(with)s 0 10189(characters)m 1044(in)s -1313(the)s 1688(program)s 2584(te)s 3(xt)k 3026(that)s -3470(it)s 3689(w)s 2(ould)k 4370(ordinarily)s 5393(either)s -6022(reject)s 6638(or)s 6923(interpret)s 7818(in)s 8087(some)s -8675(w)s 2(ay)k 0 9901(\(braces)m 729(and)s 1121(so)s -1375(on\),)s 1790(ensuring)s 2655(that)s 3061(you)s 3464(can)s -3842(include)s 4590(program)s 5448(te)s 3(xts)k 5936(with)s -6406(absolutely)s 7431(no)s 7712(modi\207cations;)s 0 9613(plus,)m 506(if)s -723(you)s 1138(wish,)s 1697(Lout)s 2209(will)s 2635(print)s -3146(k)s 2(e)k 3(yw)k 2(ords)k 4121(in)s -4364(bold,)s 4897(identi\207ers)s 5903(in)s 6146(italics,)s 6822(add)s -7226(line)s 7640(numbers,)s 8571(etc.)s 480 9239(At)m 779(the)s -1127(time)s 1607(of)s 1878(writing,)s 2675(the)s 3023(a)s 4(v)k 6(ailable)k -3931(programming)s 5286(languages)s 6294(are:)s 1808 12 0 12 240 288 60 635 8599 LoutGr2 -LoutBox ltblblack -grestore - -grestore -240 fnt90 779 8703(Langua)m 2(g)k 2(e)k -1787(name)s gsave -2443 8599 translate -240 fnt82 1730 12 0 12 240 288 60 LoutGraphic -gsave -LoutBox ltblblack -grestore - -grestore -2587(Setup)s 3172(\207le)s 3517(name)s gsave -4173 8599 translate -240 fnt82 1469 12 0 12 240 288 60 LoutGraphic -gsave -LoutBox ltblblack -grestore - -grestore -4317(Lout)s -4820(symbol)s gsave -5642 8599 translate -240 fnt82 1499 12 0 12 240 288 60 LoutGraphic -gsave -LoutBox ltblblack -grestore - -grestore -5786(Default)s 6567(style)s gsave -7141 8599 translate -240 fnt82 1290 12 0 12 240 288 60 LoutGraphic -gsave -LoutBox ltblblack -grestore - -grestore -7285(`)s 7419(')s -7548(escapes)s 240 fnt82 779 8413(C,)m 1046(C++)s 220 fnt35 -2587 8410(cpr)m -3(int)k 4317(@CP)s 5786(\207x)s 6(ed)k -240 fnt82 7285 8413(No)m 779 8125(Eif)m 6(fel)k 220 fnt35 -2587 8122(eiff)m 6(el)k 4317(@Eiff)s 6(el)k 5786(v)s 5(ar)k -6(ying)k -240 fnt82 7285 8125(Y)m 24(es)k 779 7837(Blue)m 220 fnt35 -2587 7834(b)m 4(lue)k 4317(@Blue)s 5786(v)s 5(ar)k -6(ying)k -240 fnt82 7285 7837(Y)m 24(es)k 779 7549(Perl)m 220 fnt35 -2587 7546(per)m -3(l)k 4317(@P)s 11(er)k -3(l)k -5786(\207x)s 6(ed)k 240 fnt82 7285 7549(No)m 779 7261(Pod)m -220 fnt35 2587 7258(pod)m 4317(@P)s 11(od)k 5786(v)s 5(ar)k -6(ying)k -240 fnt82 7285 7261(No)m 0 6720(C)m 213(and)s 619(C++)s -1103(are)s 1452(handled)s 2270(together)s 3114(since,)s 3714(for)s -4054(formatting)s 5116(purposes,)s 6076(the)s 3(y)k 6540(dif)s 6(fer)k -7125(only)s 7607(in)s 7851(that)s 8271(C++)s 8756(has)s -0 6432(some)m 558(additional)s 1566(k)s 2(e)k 3(yw)k 2(ords)k -2538(plus)s 2985(an)s 3265(e)s 3(xtra)k 3796(w)s 2(ay)k -4244(to)s 4480(mak)s 2(e)k 5049(comments.)s 6193(Whene)s 6(v)k 3(er)k -7224(we)s 7556(mention)s 8394(C)s 8602(from)s 0 6144(no)m 6(w)k -465(on,)s 816(we)s 1156(mean)s 1735(both)s 2223(C)s -2439(and)s 2848(C++.)s 3446(See)s 3852(Section)s 4630(1.11)s -5089(for)s 5432(more)s 5983(on)s 6285(Perl)s 6728(and)s -7137(its)s 7417(handmaiden)s 8649(Pod.)s 0 5856(The)m 428(second)s -1151(to)s 1390(\207fth)s 1845(columns)s 2707(of)s 2978(this)s -3374(table)s 3894(will)s 4320(be)s 4602(e)s 3(xplained)k -5587(at)s 5819(v)s 6(arious)k 6568(points)s 7204(later)s -7687(in)s 7930(this)s 8326(chapter)s 13(.)k 480 5482(The)m -913(list)s 1270(of)s 1547(languages)s 2560(is)s 2776(lik)s 2(ely)k -3378(to)s 3623(e)s 3(xpand,)k 4424(because)s 5243(the)s -220 fnt35 5597 5479(prg2lout)m 240 fnt82 6450 5482(program)m 7326(has)s -7702(been)s 8217(designed)s 0 5194(to)m 252(mak)s 2(e)k -838(it)s 1044(relati)s 6(v)k 3(ely)k 2004(easy)s -2497(to)s 2750(add)s 3168(ne)s 6(w)k 3629(languages)s -4651(\(you)s 5159(don')s 4(t)k 5734(ha)s 4(v)k 3(e)k -6249(to)s 6502(write)s 7062(e)s 3(x)k 3(ecutable)k -8148(code,)s 8721(just)s 0 4906(declare)m 768(a)s 957(lot)s -1292(of)s 1586(records)s 2363(describing)s 3435(your)s 3957(language\).)s -5087(Consult)s 5915(the)s 6286(instructions)s 7475(at)s 7730(the)s -8101(top)s 8483(of)s 8778(the)s 0 4618(source)m 680(\207le)s -1041(of)s 1312(that)s 1730(program)s 2600(\()s 240 fnt83 -2673 4620(pr)m 8(g2lout.c)k 240 fnt82 3652 4618(\))m 3780(if)s -3997(you)s 4412(w)s 2(ant)k 4935(to)s 5174(try)s -5493(it)s 5685(yourself.)s 240 fnt84 0 3825(1.1.)m 471(T)s 17(ypesetting)k -1705(computer)s 2745(pr)s 4(ograms)k 3792(independently)s 5295(of)s -5567(any)s 5996(document)s 240 fnt82 480 3348(Printing)m 1299(of)s -1566(program)s 2432(\207les)s 2876(independently)s 4282(of)s 4549(an)s 3(y)k -4942(document)s 5941(is)s 6147(accomplished)s 7516(by)s 7806(the)s -8149(follo)s 6(wing)k 0 3060(Unix)m 534(pipeline:)s 220 fnt35 -480 2559(prg2lout -l language options \207les | lout -s > out.ps)m 240 fnt82 0 2060(where)m 220 fnt35 626 2057(language)m -240 fnt82 1566 2060(stands)m 2201(for)s 2525(an)s 3(y)k -2908(one)s 3296(of)s 3553(the)s 3886(programming)s 5227(language)s -6133(names)s 6781(in)s 7010(the)s 7344(\207rst)s 7761(column)s -8522(of)s 8778(the)s 1134 0 0 0 240 288 60 0 1553 LoutGr2 -0 0 moveto xsize 0 lineto stroke -grestore - -grestore -122 fnt82 0 1358(1)m 192 fnt82 -62 1288(Prior)m 496(to)s 693(V)s 21(ersion)k 1328(3.18)s -1707(of)s 1928(Lout,)s 2380(this)s 2702(chapter)s 3318(described)s -4103(ho)s 4(w)k 4477(to)s 4674(typeset)s 5268(programs)s -6036(written)s 6628(in)s 6828(the)s 7112(C)s 7287(programming)s -8377(language)s 0 1058(using)m 487(the)s 172 fnt35 795 1057(c2lout)m -192 fnt82 1326 1058(\207lter)m 7(,)k 1794(and)s 2148(Eif)s 4(fel)k -2651(programs)s 3444(using)s 3931(the)s 172 fnt35 4240 1057(eif2lout)m -192 fnt82 4864 1058(\207lter)m 10(.)k 5375(These)s 5906(ha)s 3(v)k 2(e)k -6338(no)s 4(w)k 6736(been)s 7174(withdra)s 2(wn)k -8065(and)s 8419(replaced)s 0 828(by)m 172 fnt35 270 827(prg2lout)m -192 fnt82 884 828(,)m 1005(which)s 1553(handles)s 2214(multiple)s -2931(languages.)s 3863(Ordinary)s 4631(Lout)s 5076(documents)s 5981(require)s -6602(no)s 6871(modi\207cations)s 7989(as)s 8223(a)s 8391(result)s -8898(of)s 0 598(this)m 317(change.)s 192 fnt84 4490 0(1)m - -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 2 4 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Bold -%%+ font Times-Italic -%%+ font Helvetica -/pgsave save def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -0 LoutMargSet -grestore -240 fnt84 0 13840(2)m 240 fnt83 5981 13843(Chapter)m 6831(1.)s -7105(Computer)s 8128(Pr)s 10(o)k 2(gr)k 3(ams)k -240 fnt82 0 13205(table)m 509(abo)s 3(v)k 3(e.)k -1228(As)s 1533(usual)s 2082(with)s 2553(Lout,)s 3100(the)s -3437(output)s 4098(will)s 4512(be)s 4783(a)s 4938(PostScript)s -5968(\207le.)s 6426(Each)s 6950(input)s 7490(\207le)s 7840(will)s -8255(be)s 3(gin)k 8829(on)s 0 12917(a)m 170(ne)s 6(w)k -622(page)s 1135(of)s 1411(the)s 1764(output,)s 2488(starting)s -3262(with)s 3749(its)s 4030(name)s 4609(in)s 4857(bold)s -5346(type.)s 5927(The)s 6360(options)s 7121(pro)s 3(vide)k -7910(control)s 8647(o)s 3(v)k 3(er)k 0 12629(the)m -348(\207nal)s 828(appearance,)s 2010(as)s 2260(follo)s 6(ws:)k -220 fnt35 0 12121(-p)m 240 fnt83 187 12126(style)m 240 fnt82 -960 12124(Select)m 1630(a)s 1823(printing)s 2661(style.)s 3303(Y)s 26(our)k -3856(choices)s 4652(are)s 220 fnt35 5026 12121(-p\207x)m 6(ed)k -240 fnt82 5667 12124(,)m 220 fnt35 5801 12121(-pv)m 5(ar)k -6(ying)k -240 fnt82 6692 12124(,)m 6827(and)s 220 fnt35 7258 12121(-psymbol)m -240 fnt82 8134 12124(,)m 8268(with)s 8778(the)s 960 11836(def)m 2(ault)k -1707(v)s 6(alue)k 2302(v)s 6(arying)k 3106(with)s -3615(the)s 3990(language)s 4936(as)s 5213(gi)s 6(v)k 3(en)k -5820(in)s 6089(the)s 6464(fourth)s 7132(column)s 7933(of)s -8231(the)s 8606(table)s 960 11548(abo)m 3(v)k 3(e.)k -1690(Consult)s 2495(Section)s 3269(1.2)s 3623(for)s 3961(e)s 3(xamples)k -4912(of)s 5183(these)s 5730(styles.)s 220 fnt35 0 11042(-n)m -240 fnt82 960 11045(Do)m 1306(not)s 1672(print)s 2183(\207le)s -2544(names.)s 220 fnt35 0 10539(-f)m 240 fnt83 131 10544(font)m -240 fnt82 960 10542(Select)m 1589(a)s 1740(Lout)s 2237(font)s -2667(f)s 2(amily)k 15(.)k 3423(The)s 3836(def)s 2(ault)k -4542(is)s 220 fnt35 4737 10539(-fCour)m -3(ier)k 240 fnt82 -5637 10542(for)m 220 fnt35 5961 10539(-p\207x)m 6(ed)k 240 fnt82 -6602 10542(,)m 6694(and)s 220 fnt35 7083 10539(-fTimes)m 240 fnt82 -7852 10542(for)m 220 fnt35 8175 10539(-pv)m 5(ar)k -6(ying)k -240 fnt82 960 10254(and)m 220 fnt35 1364 10251(-psymbol)m 240 fnt82 -2240 10254(.)m 220 fnt35 0 9750(-v)m 240 fnt83 182 9755(vsize)m -240 fnt82 960 9753(Select)m 1594(an)s 1867(inter)s 4(-line)k -2783(spacing)s 3557(size)s 3975(in)s 4208(Lout)s 4710(units.)s -5329(The)s 5747(def)s 2(ault)k 6459(is)s 220 fnt35 -6659 9750(-v1.1fx)m 240 fnt82 7366 9753(meaning)m 8233(1.1)s 8558(times)s -960 9465(the)m 1308(font)s 1753(size)s 2180(measured)s 3154(from)s -3678(baseline)s 4517(to)s 4756(baseline.)s 220 fnt35 0 9007(-L)m -240 fnt83 191 9012(number)m 240 fnt82 960 9010(Add)m 1478(line)s -1939(numbers)s 2861(to)s 3147(the)s 3542(program)s 4459(print,)s -5064(starting)s 5880(with)s 240 fnt83 6409 9012(number)m 240 fnt82 -7146 9010(,)m 7300(or)s 7606(1)s 7808(if)s 240 fnt83 -8072 9012(number)m 240 fnt82 8916 9010(is)m 960 8722(omitted.)m 220 fnt35 -0 8264(-S)m 240 fnt83 209 8269(\207le)m 240 fnt82 960 8267(Use)m -240 fnt83 1389 8269(\207le)m 240 fnt82 1736 8267(as)m 1988(the)s -2337(setup)s 2897(\207le)s 3260(for)s 3599(printing)s 4411(your)s -4912(language.)s 5941(This)s 6419(allo)s 6(ws)k 7090(you)s -7506(to)s 7747(change)s 8483(all)s 8778(the)s 960 7979(options)m -1716(mentioned)s 2784(in)s 3027(subsequent)s 4151(sections,)s 5028(rather)s -5644(than)s 6113(just)s 6518(the)s 6866(fe)s 6(w)k -7272(gi)s 6(v)k 3(en)k 7852(here.)s 0 7474(There)m -613(are)s 960(also)s 220 fnt35 1398 7471(-t)m 240 fnt82 -1588 7474(and)m 220 fnt35 1992 7471(-T)m 240 fnt82 2256 7474(options)m -3012(for)s 3350(dealing)s 4107(with)s 4589(tab)s 4934(characters)s -5952(\(Section)s 6805(1.5\).)s 240 fnt84 0 6681(1.2.)m 471(T)s 17(ypesetting)k -1705(computer)s 2745(pr)s 4(ograms)k 3792(as)s 4059(part)s -4557(of)s 4829(a)s 5007(lar)s 2(ger)k 5687(document)s -240 fnt82 480 6204(When)m 1097(the)s 1432(program)s 2289(te)s 3(xts)k -2775(are)s 3109(to)s 3336(be)s 3605(part)s 4023(of)s -4281(a)s 4434(lar)s 4(ger)k 5034(Lout)s 5533(document,)s -6571(the)s 6906(procedure)s 7905(is)s 8102(some)s 6(what)k -0 5916(dif)m 6(ferent.)k 979(Y)s 26(ou)k 1421(need)s -1931(to)s 2170(include)s 2930(the)s 3278(setup)s 3836(\207le)s -4197(appropriate)s 5341(to)s 5580(your)s 6079(language,)s 7050(lik)s 2(e)k -7462(this:)s 220 fnt35 480 5415(@SysInclude { cpr)m -3(int })k 480 5127(@SysInclude { doc })m -480 4839(@Doc @T)m 26(e)k 6(xt @Begin)k 480 4551(...)m 480 4263(@End @T)m 26(e)k 6(xt)k -240 fnt82 0 3808(The)m 220 fnt35 422 3805(cpr)m -3(int)k -240 fnt82 1011 3808(setup)m 1563(\207le)s 1917(includes)s 2759(e)s 6(v)k 3(erything)k -3820(needed)s 4549(to)s 4782(set)s 5101(up)s 5387(for)s -5719(C)s 5925(program)s 6788(formatting;)s 7902(for)s 8234(the)s -8575(other)s 0 3520(languages,)m 1064(consult)s 1815(the)s 2163(second)s -2886(column)s 3661(of)s 3932(the)s 4280(table)s 4800(at)s -5032(the)s 5380(start)s 5850(of)s 6121(this)s 6517(chapter)s 13(.)k -480 3146(The)m 914(program)s 1791(te)s 3(xts)k 2297(within)s -2972(the)s 3327(Lout)s 3846(document)s 4857(are)s 5210(enclosed)s -6112(in)s 6362(braces)s 7030(preceded)s 7958(by)s 8259(the)s -8614(Lout)s 0 2858(symbol)m 760(from)s 1284(the)s 1632(third)s -2141(column)s 2916(of)s 3187(the)s 3535(table,)s 4106(lik)s 2(e)k -4518(this)s 4914(for)s 5252(the)s 5600(C)s 5812(language:)s - -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 3 5 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Italic -%%+ font Times-Bold -%%+ font Helvetica -%%+ font Courier -/pgsave save def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -%%IncludeResource: font Courier -/Courierfnt29 vec2 /Courier LoutRecode -/fnt29 { /Courierfnt29 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -1 LoutMargSet -grestore -240 fnt83 0 13843(1.2.)m 454(T)s 17(ypesetting)k 1593(computer)s -2562(pr)s 10(o)k 2(gr)k 3(ams)k 3534(as)s -3802(part)s 4265(of)s 4546(a)s 4721(lar)s 8(g)k 2(er)k -5374(document)s 240 fnt84 8953 13840(3)m 220 fnt35 480 13207(@IndentedDispla)m 6(y @CP {)k -480 12919(#include <stdio)m 8(.h>)k 480 12343(treepr)m -3(int\(p\) /* pr)k -3(int tree p recursiv)k 5(ely */)k -480 12055(str)m -3(uct tnode *p;)k 480 11767({)m 480 11479( if \(p != NULL\) {)m 480 11191( treepr)m -3(int\(p->left\);)k -480 10903( pr)m -3(intf\("%4d %s\\n", p->count, p->w)k 2(ord\);)k 480 10615( treepr)m -3(int\(p->r)k -3(ight\);)k -480 10327( })m 480 10039(})m 480 9751(})m 240 fnt82 0 9257(Although)m -962(computer)s 1925(programs)s 2879(violate)s 3584(the)s 3932(rules)s -4447(of)s 4718(le)s 3(g)k 1(al)k 5232(Lout)s -5744(input)s 6296(in)s 6539(man)s 3(y)k 7121(w)s 2(ays,)k -7718(these)s 8265(rules)s 8779(are)s 0 8969(suspended)m 1042(by)s -1322(the)s 220 fnt35 1655 8966(@CP)m 240 fnt82 2173 8969(,)m -220 fnt35 2266 8966(@Eiff)m 6(el)k 240 fnt82 3000 8969(etc.)m -3368(symbols,A)s 4441(allo)s 6(wing)k 5311(the)s 5645(program)s -6500(te)s 3(xt)k 6901(to)s 7125(be)s 7393(incorporated)s -8644(with)s 0 8681(absolutely)m 1037(no)s 1330(modi\207cations.)s 2796(The)s -3224(result)s 3814(is)s 220 fnt29 480 8198(#include)m 1668(<stdio.h>)s -480 7622(treeprint\(p\))m 3120(/*)s 3516(print)s 4308(tree)s 4968(p)s -5232(recursively)s 6816(*/)s 480 7334(struct)m 1404(tnode)s 2196 7291(*)m -2328 7334(p;)m 480 7046({)m 1536 6758(if)m 1932(\(p)s 2328(!=)s -2724(NULL\))s 3516({)s 2592 6470(treeprint\(p->left\);)m 2592 6182(printf\("%4d)m 4176(%s\\n",)s -5100(p->count,)s 6420(p->word\);)s 2592 5894(treeprint\(p->right\);)m 1536 5606(})m 480 5318(})m -240 fnt82 0 4843(W)m 19(e)k 393(ha)s 4(v)k 3(e)k -919(chosen)s 1665(to)s 1929(use)s 2328(the)s 220 fnt35 -2701 4840(@IndentedDispla)m 6(y)k 240 fnt82 4572 4843(symbol)m 5357(from)s -5905(Section)s 6704(??)s 6993(to)s 7257(obtain)s 7936(an)s -8244(indented)s 0 4555(display)m 15(,)k 780(b)s 4(ut)k -1138(in)s 1378(f)s 2(act)k 220 fnt35 1789 4552(@CP)m -240 fnt82 2307 4555(,)m 220 fnt35 2411 4552(@Eiff)m 6(el)k -240 fnt82 3156 4555(and)m 3557(the)s 3901(rest)s 4301(may)s -4764(appear)s 5457(an)s 3(ywhere)k 6437(at)s 6665(all:)s -7066(the)s 7410(result)s 7997(is)s 8203(an)s 8482(object)s -0 4267(in)m 247(the)s 599(usual)s 1163(w)s 2(ay)k 15(,)k -1656(which)s 2302(may)s 2772(go)s 3069(an)s 3(ywhere.)k -4164(When)s 4797(including)s 5758(a)s 5928(program)s 6802(te)s 3(xt)k -7221(within)s 7893(a)s 8063(paragraph,)s 0 3979(use)m 220 fnt35 -365 3976(@OneCol @CP { ...)m 13( })k 240 fnt82 2459 3979(\(or)m 220 fnt35 -2787 3976(@OneCol @Eiff)m 6(el { ...)k 13( })k 240 fnt82 5057 3979(etc.)m -5429(for)s 5757(other)s 6298(languages\))s 7373(to)s 7602(pre)s 6(v)k 3(ent)k -8360(it)s 8541(being)s 0 3691(brok)m 2(en)k 720(across)s -1368(tw)s 2(o)k 1778(lines,)s 2336(if)s 2553(desired.)s -480 3317(In)m 732(cases)s 1282(where)s 1917(the)s 2260(program)s -3125(te)s 3(xt)k 3535(has)s 3900(unbalanced)s 5043(braces,)s -5755(it)s 5942(is)s 6147(necessary)s 7125(to)s 7359(use)s -7729(the)s 8072(alternati)s 6(v)k 3(e)k 0 3029(form)m -220 fnt35 514 3026(@CP @Begin ...)m 13( @End @CP)k 240 fnt82 3418 3029(\(or)m -3746(the)s 4083(equi)s 6(v)k 6(alent)k 5117(for)s -5444(other)s 5984(languages\),)s 7117(so)s 7372(that)s 7780(Lout)s -8281(does)s 8760(not)s 0 2741(confuse)m 793(program)s 1656(braces)s -2309(with)s 2784(Lout)s 3288(braces.)s 4055(In)s 4303(that)s -4714(case)s 5173(the)s 5514(program)s 6376(te)s 3(xt)k -6784(must)s 7301(not)s 7660(contain)s 220 fnt35 8413 2738(@End)m -240 fnt82 9014 2741(;)m 0 2453(and)m 412(in)s 663(either)s -1275(case)s 1750(the)s 2106(program)s 2985(te)s 3(xt)k -3408(must)s 3941(not)s 4316(include)s 220 fnt35 5084 2450(@Include)m -240 fnt82 6074 2453(or)m 220 fnt35 6342 2450(@SysInclude)m 240 fnt82 -7698 2453(unless)m 8355(you)s 8779(are)s 0 2165(really)m 597(including)s -1554(a)s 1720(\207le)s 2081(at)s 2313(that)s 2731(point)s -3283(\(Section)s 4136(1.9\).)s 480 1791(If)m 763(your)s 1316(Lout)s -1882(document)s 2939(contains)s 3841(program)s 4765(te)s 3(xts)k -5317(in)s 5614(se)s 6(v)k 3(eral)k 6390(languages,)s -7507(simply)s 8266(add)s 8724(one)s 220 fnt35 0 1500(@SysInclude)m -240 fnt82 1342 1503(line)m 1749(for)s 2080(each)s 2569(of)s -2833(them)s 3364(and)s 3761(proceed)s 4570(as)s 4813(before.)s -5580(If)s 5803(your)s 6296(programming)s 7644(language)s 8557(is)s -8760(not)s 0 1215(currently)m 916(supported,)s 1967(a)s 2133(viable)s -2773(alternati)s 6(v)k 3(e)k 3827(is)s 220 fnt35 -480 714(@F @V)m 17(erbatim { ...)k 13( })k 240 fnt82 0 220(These)m -612(symbols)s 1445(cause)s 2017(the)s 2349(te)s 3(xt)k -2749(between)s 3587(braces)s 4233(to)s 4456(be)s 4722(set)s -5032(v)s 3(erbatim)k 5922(in)s 6150(a)s 6300(\207x)s 3(ed-)k -6844(width)s 7431(font,)s 7907(as)s 8141(e)s 3(xplained)k - -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 4 6 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Bold -%%+ font Times-Italic -%%+ font Helvetica -/pgsave save def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -0 LoutMargSet -grestore -240 fnt84 0 13840(4)m 240 fnt83 5981 13843(Chapter)m 6831(1.)s -7105(Computer)s 8128(Pr)s 10(o)k 2(gr)k 3(ams)k -240 fnt82 0 13205(else)m 6(where)k 1008(in)s 1254(this)s -1653(guide.)s 2352(This)s 2831(f)s 2(allback)k 3662(method)s -4442(will)s 4871(not)s 5240(handle)s 5937(tab)s 6285(and)s -6692(formfeed)s 7628(characters)s 8650(v)s 3(ery)k 0 12917(well.)m -571(Ag)s 1(ain,)k 1257(use)s 220 fnt35 1628 12914(@V)m 17(erbatim @Begin ...)k 13( @End @V)k 17(erbatim)k -240 fnt82 5645 12917(if)m 5858(your)s 6352(program)s 7218(te)s 3(xt)k -7628(contains)s 8471(unbal)s 8998(-)s 0 12629(anced)m 616(braces.)s -240 fnt84 0 11886(1.3.)m 471(Changing)s 1525(the)s 1899(appearance)s -3138(of)s 3410(a)s 3588(pr)s 4(ogram)k 240 fnt82 -480 11409(The)m 220 fnt35 915 11406(@CP)m 240 fnt82 1433 11409(,)m -220 fnt35 1548 11406(@Eiff)m 6(el)k 240 fnt82 2305 11409(etc.)m -2695(symbols)s 3551(ha)s 4(v)k 3(e)k 4060(a)s -4234(number)s 5033(of)s 5312(options)s 6075(for)s 6421(changing)s -7360(the)s 7716(appearance)s 8855(of)s 0 11121(the)m 357(printed)s -1102(program.)s 2086(These)s 2723(options)s 3489(are)s 3846(the)s -4204(same)s 4761(for)s 5109(all)s 5412(symbols,)s 6327(although)s -7232(their)s 7739(def)s 2(ault)k 8470(v)s 6(alues)k -0 10833(may)m 468(v)s 6(ary)k 15(.)k 1039(The)s -220 fnt35 1470 10830(style)m 240 fnt82 1976 10833(option)m 2648(changes)s -3473(the)s 3824(printing)s 4637(style;)s 5203(its)s 5482(v)s 6(alue)k -6053(may)s 6522(be)s 220 fnt35 6807 10830(\207x)m 6(ed)k -240 fnt82 7316 10833(\(\207x)m 3(ed-width)k 8555(font\),)s 220 fnt35 -0 10542(v)m 5(ar)k -6(ying)k 240 fnt82 777 10545(\(v)m 6(arying-width)k -2284(font\),)s 2876(or)s 220 fnt35 3157 10542(symbol)m 240 fnt82 -3919 10545(\(v)m 6(arying-width)k 5426(font)s 5892(with)s 6396(mathematical)s -7758(symbols)s 8629(used)s 0 10257(for)m 342(some)s 907(operators\).)s -2043(Its)s 2336(def)s 2(ault)k 3061(v)s 6(alue)k -3633(depends)s 4473(on)s 4774(the)s 5126(language,)s 6101(and)s -6509(may)s 6979(be)s 7265(found)s 7886(in)s 8133(the)s -8485(fourth)s 0 9969(column)m 775(of)s 1045(the)s 1392(table)s -1911(at)s 2143(the)s 2490(start)s 2959(of)s 3229(this)s -3624(chapter)s 13(.)k 4478(The)s 4905(e)s 3(xample)k -5767(in)s 6009(the)s 6357(pre)s 6(vious)k 7225(section)s -7958(w)s 2(as)k 8378(in)s 220 fnt35 8620 9966(\207x)m 6(ed)k -240 fnt82 0 9681(style;)m 563(we)s 898(can)s 1287(switch)s -1968(styles)s 2563(lik)s 2(e)k 2975(this:)s 220 fnt35 -480 9180(@CP)m 480 8892( style { v)m 5(ar)k -6(ying })k 480 8604({)m -480 8316(#include <stdio)m 8(.h>)k 480 7740(treepr)m -3(int\(p\) /* pr)k -3(int tree p recursiv)k 5(ely */)k -480 7452(str)m -3(uct tnode *p;)k 480 7164({)m 480 6876( if \(p != NULL\) {)m 480 6588( treepr)m -3(int\(p->left\);)k -480 6300( pr)m -3(intf\("%4d %s\\n", p->count, p->w)k 2(ord\);)k 480 6012( treepr)m -3(int\(p->r)k -3(ight\);)k -480 5724( })m 480 5436(})m 480 5148(})m 240 fnt82 0 4654(The)m -428(result)s 1018(in)s 1261(this)s 1657(case)s 2124(will)s -2550(be)s 480 4198(#)m 240 fnt83 600 4200(include)m 240 fnt82 -1357 4198(<)m 240 fnt83 1486 4200(stdio)m 240 fnt82 1944 4198(.)m -240 fnt83 1988 4200(h)m 240 fnt82 2103 4198(>)m 240 fnt83 -480 3624(tr)m 8(eeprint)k 240 fnt82 1312 3622(\()m 240 fnt83 -1385 3624(p)m 240 fnt82 1498 3622(\))m 2046(/*)s 2276(print)s -2787(tree)s 3200(p)s 3373(recursi)s 6(v)k 3(ely)k -4479(*/)s 240 fnt84 480 3333(struct)m 240 fnt83 1136 3336(tnode)m -240 fnt82 1721 3280(*)m 240 fnt83 1825 3336(p)m 240 fnt82 -1938 3334(;)m 480 3046({)m 240 fnt84 960 2757(if)m 240 fnt82 -1178 2758(\()m 240 fnt83 1251 2760(p)m 240 fnt82 1424 2758(!=)m -240 fnt83 1691 2760(NULL)m 240 fnt82 2290 2758(\))m 2418({)s -240 fnt83 1440 2472(tr)m 8(eeprint)k 240 fnt82 2272 2470(\()m -240 fnt83 2345 2472(p)m 240 fnt82 2458 2470(->)m 240 fnt83 -2666 2472(left)m 240 fnt82 2974 2470(\);)m 240 fnt83 1440 2184(printf)m -240 fnt82 2006 2182(\()m 240 fnt83 2079 2184("%4d)m 2684(%s\\n")s -240 fnt82 3264 2182(,)m 240 fnt83 3371 2184(p)m 240 fnt82 -3484 2182(->)m 240 fnt83 3692 2184(count)m 240 fnt82 4228 2182(,)m -240 fnt83 4335 2184(p)m 240 fnt82 4448 2182(->)m 240 fnt83 -4656 2184(wor)m 8(d)k 240 fnt82 5147 2182(\);)m 240 fnt83 -1440 1896(tr)m 8(eeprint)k 240 fnt82 2272 1894(\()m 240 fnt83 -2345 1896(p)m 240 fnt82 2458 1894(->)m 240 fnt83 2666 1896(right)m -240 fnt82 3135 1894(\);)m 960 1606(})m 480 1318(})m 0 824(If)m -230(we)s 565(use)s 220 fnt35 940 821(style { symbol })m 240 fnt82 -2466 824(we)m 2801(get)s 3153(this:)s -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 5 7 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Italic -%%+ font Times-Bold -%%+ font Symbol -%%+ font Helvetica -/pgsave save def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -1 LoutMargSet -grestore -240 fnt83 0 13843(1.3.)m 454(Changing)s 1454(the)s 1799(appear)s 3(ance)k -2980(of)s 3261(a)s 3436(pr)s 10(o)k 2(gr)k 3(am)k -240 fnt84 8953 13840(5)m 240 fnt82 480 13203(#)m 240 fnt83 -600 13205(include)m 240 fnt78 1357 13197(<)m 240 fnt83 1482 13205(stdio)m -240 fnt82 1940 13203(.)m 240 fnt83 1984 13205(h)m 240 fnt78 -2099 13197(>)m 240 fnt83 480 12629(tr)m 8(eeprint)k 240 fnt82 -1312 12627(\()m 240 fnt83 1385 12629(p)m 240 fnt82 1498 12627(\))m -2046(/*)s 2276(print)s 2787(tree)s 3200(p)s 3373(recursi)s 6(v)k 3(ely)k -4479(*/)s 240 fnt84 480 12338(struct)m 240 fnt83 1136 12341(tnode)m -240 fnt82 1721 12285(*)m 240 fnt83 1825 12341(p)m 240 fnt82 -1938 12339(;)m 480 12051({)m 240 fnt84 960 11762(if)m 240 fnt82 -1178 11763(\()m 240 fnt83 1251 11765(p)m 240 fnt78 1424 11757(\271)m -240 fnt83 1613 11765(NULL)m 240 fnt82 2212 11763(\))m 2340({)s -240 fnt83 1440 11477(tr)m 8(eeprint)k 240 fnt82 2272 11475(\()m -240 fnt83 2345 11477(p)m 240 fnt78 2458 11469(\256)m 240 fnt83 -2688 11477(left)m 240 fnt82 2996 11475(\);)m 240 fnt83 1440 11189(printf)m -240 fnt82 2006 11187(\()m 240 fnt83 2079 11189("%4d)m 2684(%s\\n")s -240 fnt82 3264 11187(,)m 240 fnt83 3371 11189(p)m 240 fnt78 -3484 11181(\256)m 240 fnt83 3714 11189(count)m 240 fnt82 4250 11187(,)m -240 fnt83 4357 11189(p)m 240 fnt78 4470 11181(\256)m 240 fnt83 -4700 11189(wor)m 8(d)k 240 fnt82 5191 11187(\);)m 240 fnt83 -1440 10901(tr)m 8(eeprint)k 240 fnt82 2272 10899(\()m 240 fnt83 -2345 10901(p)m 240 fnt78 2458 10893(\256)m 240 fnt83 2688 10901(right)m -240 fnt82 3157 10899(\);)m 960 10611(})m 480 10323(})m 0 9829(with)m -482(mathematical)s 1823(symbols)s 2672(replacing)s 3614(some)s 4175(of)s -4446(the)s 4794(operators.)s 480 9455(The)m 220 fnt35 901 9452(@CP)m -240 fnt82 1419 9455(,)m 220 fnt35 1519 9452(@Eiff)m 6(el)k -240 fnt82 2261 9455(etc.)m 2636(symbols)s 3478(ha)s 4(v)k 3(e)k -3972(additional)s 4976(options)s 5725(which)s 6360(allo)s 6(w)k -6932(a)s 7091(\207ner)s 7582(control)s 8307(o)s 3(v)k 3(er)k -8778(the)s 0 9167(style.)m 615(Here)s 1135(the)s 3(y)k -1598(all)s 1891(are,)s 2289(with)s 2771(their)s 3268(def)s 2(ault)k -3989(v)s 6(alues:)k 220 fnt35 480 8666(@CP [ or @Eiff)m 6(el, @Blue)k 3(, etc.)k 13( ])k -480 8378( style { \207x)m 6(ed })k 480 8090( n)m 2(umbered { No })k 480 7802( f)m 6(ont { Cour)k -3(ier })k -480 7514( siz)m 3(e { -1.0p })k 480 7226( line { 1.0vx })m 480 6938( tabin { 8 })m 480 6650( tabout { 8s })m -480 6362( identi\207ers { Base })m 480 6074( k)m 4(e)k 4(yw)k 2(ords { Base })k -480 5786( oper)m 2(ators { Base })k 480 5498( n)m 2(umbers { Base })k 480 5210( str)m -3(ings { Base })k -480 4922( comments { Base })m 480 4634({)m 480 4346( ...)m 480 4058(})m 240 fnt82 -0 3564(W)m 19(e)k 387(are)s 753(already)s 1529(f)s 2(amiliar)k -2360(with)s 220 fnt35 2861 3561(style)m 240 fnt82 3304 3564(.)m -3487(After)s 4069(that)s 4506(comes)s 220 fnt35 5187 3561(n)m 2(umbered)k -240 fnt82 6161 3564(,)m 6287(whose)s 6974(v)s 6(alue)k -7561(may)s 8046(be)s 220 fnt35 8347 3561(No)m 240 fnt82 -8699 3564(\(the)m 0 3276(def)m 2(ault\),)k 220 fnt35 842 3273(Y)m 30(es)k -240 fnt82 1183 3276(,)m 1285(or)s 1538(a)s 1699(number)s 9(,)k -2522(and)s 2921(which)s 3557(determines)s 4651(whether)s 5475(or)s -5729(not)s 6089(line)s 6498(numbers)s 7367(are)s 7709(to)s -7942(be)s 8219(added)s 8843(an)s 0 2988(if)m 217(so)s -482(the)s 829(v)s 6(alue)k 1397(of)s 1667(the)s -2014(\207rst)s 2444(one.)s 2954(Ne)s 3(xt)k 3475(we)s -3809(ha)s 4(v)k 3(e)k 220 fnt35 4309 2985(f)m 6(ont)k -240 fnt82 4665 2988(,)m 4772(which)s 5413(determines)s 6511(the)s -6858(font)s 7303(f)s 2(amily)k 7977(to)s 8215(use,)s -220 fnt35 8640 2985(siz)m 3(e)k 240 fnt82 9019 2988(,)m -0 2700(the)m 347(font)s 791(size)s 1217(to)s 1455(use,)s -1880(and)s 220 fnt35 2283 2697(line)m 240 fnt82 2615 2700(,)m -2721(the)s 3068(inter)s 4(-line)k 3992(spacing.)s 4886(The)s -5313(def)s 2(ault)k 6033(v)s 6(alue)k 6600(for)s -220 fnt35 6937 2697(siz)m 3(e)k 240 fnt82 7375 2700(asks)m -7837(for)s 8174(one)s 8574(point)s 0 2412(smaller)m 765(than)s -1238(in)s 1485(the)s 1837(surrounding)s 3051(document;)s 4111(this)s -4511(w)s 2(as)k 4936(done)s 5462(to)s 5705(compensate)s -6894(for)s 7236(Courier')s 13(s)k 8180(relati)s 6(v)k 3(ely)k -0 2124(lar)m 4(ge)k 529(appearance)s 1660(compared)s 2661(to)s -2900(other)s 3451(fonts)s 3980(of)s 4251(the)s 4599(same)s -5146(nominal)s 5985(size.)s 480 1750(The)m 220 fnt35 919 1747(tabin)m -240 fnt82 1451 1750(and)m 220 fnt35 1866 1747(tabout)m 240 fnt82 -2543 1750(options)m 3310(are)s 3668(the)s 4027(subject)s 4775(of)s -5057(Section)s 5842(1.5.)s 6317(After)s 6891(them)s 7440(come)s -8025(six)s 8370(options)s 0 1462(gi)m 6(ving)k 701(the)s -1091(particular)s 2107(font)s 2594(f)s 2(aces)k 3175(in)s -3461(which)s 4145(to)s 4426(print)s 4979(identi\207ers,)s 6083(k)s 2(e)k 3(yw)k 2(ords,)k -7156(operators,)s 8195(numbers,)s 0 1174(strings,)m 741(and)s 1141(comments.)s -220 fnt35 2285 1171(Base)m 240 fnt82 2833 1174(means)m 3492(the)s -3836(basic)s 4377(f)s 2(ace;)k 4880(other)s 5428(commonly)s -6502(a)s 4(v)k 6(ailable)k 7407(choices)s 8171(are)s -220 fnt35 8514 1171(Slope)m 240 fnt82 0 886(and)m 220 fnt35 -415 883(Bold)m 240 fnt82 841 886(.)m 1016(These)s 1654(options)s -2421(may)s 2898(all)s 3202(be)s 3495(set)s 3831(to)s -4081(dif)s 6(ferent)k 4967(f)s 2(aces)k 5517(if)s -5745(desired.)s 6610(The)s 7049(def)s 2(ault)k 7781(v)s 6(alues)k -8449(sho)s 6(wn)k 0 598(are)m 347(correct)s 1069(for)s -220 fnt35 1407 595(style { \207x)m 6(ed })k 240 fnt82 2696 598(only;)m -3234(the)s 3582(other)s 4133(styles)s 4728(ha)s 4(v)k 3(e)k -5229(other)s 5780(def)s 2(aults)k 6585(\(Section)s 7438(1.4\).)s - -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 6 8 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Bold -%%+ font Times-Italic -%%+ font Helvetica -/pgsave save def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -0 LoutMargSet -grestore -240 fnt84 0 13840(6)m 240 fnt83 5981 13843(Chapter)m 6831(1.)s -7105(Computer)s 8128(Pr)s 10(o)k 2(gr)k 3(ams)k -240 fnt84 0 13203(1.4.)m 471(Changing)s 1525(the)s 1899(appearance)s -3138(of)s 3410(all)s 3717(pr)s 4(ograms)k 4764(simultaneously)s -240 fnt82 480 12726(W)m 19(e)k 853(ha)s 4(v)k 3(e)k -1358(just)s 1767(seen)s 2253(that)s 2675(the)s 220 fnt35 -3027 12723(@CP)m 240 fnt82 3545 12726(,)m 220 fnt35 3656 12723(@Eiff)m 6(el)k -240 fnt82 4409 12726(etc.)m 4795(symbols)s 5648(ha)s 4(v)k 3(e)k -6153(man)s 3(y)k 6740(options)s 7500(for)s 7842(changing)s -8778(the)s 0 12438(appearance)m 1130(of)s 1399(the)s 1746(program)s -2614(te)s 3(xt.)k 3131(Ho)s 6(we)k 6(v)k 3(er)k 9(,)k -4090(most)s 4613(people)s 5306(w)s 2(ould)k 5959(not)s -6323(w)s 2(ant)k 6845(to)s 7082(ha)s 4(v)k 3(e)k -7582(a)s 7746(dif)s 6(ferent)k 8619(style)s 0 12150(for)m -333(e)s 6(v)k 3(ery)k 903(program)s 1768(te)s 3(xt)k -2177(in)s 2415(their)s 2906(document;)s 3957(the)s 3(y)k -4414(w)s 2(ant)k 4931(to)s 5165(de\207ne)s 5800(the)s -6143(style)s 6644(once)s 7147(at)s 7373(the)s 7716(start,)s -8227(and)s 8625(ha)s 4(v)k 3(e)k 0 11862(all)m -281(their)s 765(program)s 1622(te)s 3(xts)k 2109(come)s -2670(out)s 3023(in)s 3254(that)s 3659(style)s 4153(without)s -4932(laboriously)s 6049(setting)s 6726(options)s 7470(on)s 7754(e)s 6(v)k 3(ery)k -8317(symbol.)s 0 11574(Y)m 26(ou)k 442(do)s 735(this)s -1131(by)s 1425(cop)s 2(ying)k 2248(the)s 2596(setup)s -3154(\207le)s 3515(and)s 3919(changing)s 4850(it.)s 480 11200(F)m 3(or)k -882(general)s 1653(information)s 2852(about)s 3457(ho)s 6(w)k -3932(to)s 4184(mak)s 2(e)k 4770(your)s 5282(o)s 6(wn)k -5759(setup)s 6331(\207le,)s 6756(consult)s 7521(Section)s 8308(??.)s -8698(The)s 0 10912(options)m 775(that)s 1212(determine)s 2242(the)s -2609(def)s 2(ault)k 3349(v)s 6(alues)k 4024(are)s -4390(in)s 4652(the)s 220 fnt35 5019 10909(@Use)m 240 fnt82 -5703 10912(clause)m 6375(which)s 7036(occupies)s 7943(most)s 8487(of)s -8778(the)s 0 10624(setup)m 558(\207le.)s 1027(Here)s 1547(is)s -1757(part)s 2188(of)s 2459(the)s 220 fnt35 2807 10621(@Use)m -240 fnt82 3472 10624(clause)m 4125(from)s 220 fnt35 4649 10621(cpr)m -3(int)k -240 fnt82 5184 10624(:)m 220 fnt35 612 10083(@Use { @CPSetup)m 612 9795( #)m -1034(pipe)s 3565({)s 4675(})s 612 9507( #)m 1034(n)s 2(umbered)k -3565({)s 3690(No)s 4675(})s 612 9219( #)m 1034(style)s -3565({)s 3690(\207x)s 6(ed)k 4675(})s 612 8643( #)m -1034(\207x)s 6(edf)k 6(ont)k 3565({)s 3690(Cour)s -3(ier)k -4675(})s 612 8355( #)m 1034(\207x)s 6(edsiz)k 3(e)k -3565({)s 3690(-1.0p)s 4675(})s 612 8067( #)m 1034(\207x)s 6(edline)k -3565({)s 3690(1.0vx)s 4675(})s 612 7779( #)m 1034(\207x)s 6(edtabin)k -3565({)s 3690(8)s 4675(})s 612 7491( #)m 1034(\207x)s 6(edtabout)k -3565({)s 3690(8s)s 4675(})s 612 6915( #)m 1034(\207x)s 6(edidenti\207ers)k -3565({)s 3690(Base)s 4675(})s 612 6627( #)m 1034(\207x)s 6(edk)k 4(e)k 4(yw)k 2(ords)k -3565({)s 3690(Base)s 4675(})s 612 6339( #)m 1034(\207x)s 6(edoper)k 2(ators)k -3565({)s 3690(Base)s 4675(})s 612 6051( #)m 1034(\207x)s 6(edn)k 2(umbers)k -3565({)s 3690(Base)s 4675(})s 612 5763( #)m 1034(\207x)s 6(edstr)k -3(ings)k -3565({)s 3690(Base)s 4675(})s 612 5475( #)m 1034(\207x)s 6(edcomments)k -3565({)s 3690(Base)s 4675(})s 612 5187( #)m 1034(\207x)s 6(edlinen)k 2(umbers)k -3565({)s 3690(Base)s 4675(})s 612 4611( #)m 1034(\207x)s 6(edidenti\207ersf)k 6(or)k -5(mat)k -3565({)s 3690(@Body)s 4675(})s 612 4323( #)m 1034(\207x)s 6(edk)k 4(e)k 4(yw)k 2(ordsf)k 6(or)k -5(mat)k -3565({)s 3690(@Body)s 4675(})s 612 4035( #)m 1034(\207x)s 6(edoper)k 2(atorsf)k 6(or)k -5(mat)k -3565({)s 3690(@Body)s 4675(})s 612 3747( #)m 1034(\207x)s 6(edn)k 2(umbersf)k 6(or)k -5(mat)k -3565({)s 3690(@Body)s 4675(})s 612 3459( #)m 1034(\207x)s 6(edstr)k -3(ingsf)k 6(or)k -5(mat)k -3565({)s 3690(@Body)s 4675(})s 612 3171( #)m 1034(\207x)s 6(edcommentsf)k 6(or)k -5(mat)k -3565({)s 3690(@Body)s 4675(})s 612 2883( #)m 1034(\207x)s 6(edlinen)k 2(umbersf)k 6(or)k -5(mat)k -3565({)s 3690(@Body)s 4675(})s 612 2307(...)m 612 1731(})m -240 fnt82 0 1193(The)m 220 fnt35 448 1190(pipe)m 240 fnt82 -934 1193(option)m 1623(will)s 2069(be)s 2371(e)s 3(xplained)k -3376(in)s 3639(Section)s 4434(1.9.)s 4918(The)s 5366(options)s -6142(whose)s 6830(name)s 7424(be)s 3(gins)k 8117(with)s -220 fnt35 8620 1190(\207x)m 6(ed)k 240 fnt82 0 905(apply)m -600(only)s 1094(when)s 220 fnt35 1685 902(style)m 240 fnt82 -2202 905(is)m 220 fnt35 2427 902(\207x)m 6(ed)k 240 fnt82 -2873 905(;)m 2999(there)s 3547(are)s 3908(corresponding)s 5344(options,)s -6171(not)s 6551(sho)s 6(wn,)k 7293(which)s 7949(apply)s -8550(when)s 220 fnt35 0 614(style)m 240 fnt82 503 617(is)m -220 fnt35 713 614(v)m 5(ar)k -6(ying)k 240 fnt82 -1469 617(and)m 220 fnt35 1873 614(symbol)m 240 fnt82 2554 617(.)m -480 243(W)m 19(e)k 849(can)s 1238(see)s 1599(in)s -1841(this)s 2237(e)s 3(xtract)k 2943(that)s 3360(the)s -3708(def)s 2(ault)k 4429(v)s 6(alue)k 4996(of)s -220 fnt35 5267 240(style)m 240 fnt82 5770 243(is)m 220 fnt35 -5979 240(\207x)m 6(ed)k 240 fnt82 6425 243(,)m 6532(and)s -6936(of)s 220 fnt35 7206 240(n)m 2(umbers)k 240 fnt82 -8111 243(is)m 220 fnt35 8321 240(No)m 240 fnt82 8594 243(.)m -8757(W)s 19(e)k -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 7 9 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Italic -%%+ font Times-Bold -%%+ font Helvetica -/pgsave save def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -1 LoutMargSet -grestore -240 fnt83 0 13843(1.4.)m 454(Changing)s 1454(the)s 1799(appear)s 3(ance)k -2980(of)s 3261(all)s 3573(pr)s 10(o)k 2(gr)k 3(ams)k -4545(simultaneously)s 240 fnt84 8951 13840(7)m 240 fnt82 0 13205(can)m -396(also)s 842(see)s 1211(the)s 1567(def)s 2(ault)k -2296(font)s 2749(f)s 2(amily)k 15(,)k 3470(font)s -3923(f)s 2(ace,)k 4433(font)s 4886(size,)s 5372(line)s -5794(spacing,)s 6640(and)s 7052(tab)s 7405(settings)s 8194(when)s -8778(the)s 0 12917(style)m 502(is)s 220 fnt35 706 12914(\207x)m 6(ed)k -240 fnt82 1152 12917(.)m 1311(The)s 1733(font)s 2173(f)s 2(amily)k -2842(name)s 3411(for)s 220 fnt35 3743 12914(\207x)m 6(ed)k -240 fnt82 4244 12917(style)m 4745(is)s 220 fnt35 4950 12914(Cour)m -3(ier)k -240 fnt82 5671 12917(,)m 5772(b)s 4(ut)k 6129(for)s -6461(the)s 6804(other)s 7349(styles)s 7939(\(not)s 8378(sho)s 6(wn\))k -0 12629(it)m 188(is)s 393(empty)s 15(.)k 1135(This)s -1606(causes)s 2276(the)s 220 fnt35 2619 12626(\207x)m 6(ed)k -240 fnt82 3120 12629(style)m 3622(to)s 3856(al)s 2(w)k 2(ays)k -4563(switch)s 5239(to)s 5473(Courier)s 9(,)k 6296(and)s -6695(the)s 7038(other)s 7584(styles)s 8174(to)s 8408(use)s -8778(the)s 0 12341(same)m 547(font)s 992(f)s 2(amily)k -1667(as)s 1917(in)s 2160(the)s 2508(surrounding)s 3718(document.)s -480 11967(The)m 895(options)s 1637(from)s 220 fnt35 2147 11964(\207x)m 6(edidenti\207ers)k -240 fnt82 3582 11967(to)m 220 fnt35 3807 11964(\207x)m 6(edlinen)k 2(umbers)k -240 fnt82 5497 11967(allo)m 6(w)k 6062(you)s 6463(to)s -6688(set)s 6999(the)s 7334(font)s 7765(f)s 2(ace)k -8202(to)s 8427(use)s 8788(for)s 0 11679(each)m 481(of)s -738(these)s 1270(parts)s 1771(of)s 2027(your)s 2512(program.)s -3471(People)s 4164(who)s 4616(w)s 2(ant)k 5124(\207x)s 3(ed-width)k -6267(fonts)s 6781(do)s 7060(not)s 7411(usually)s 8142(w)s 2(ant)k -8650(v)s 3(ery)k 0 11391(e)m 3(xciting)k 813(font)s -1251(f)s 2(aces)k 1783(either)s 9(,)k 2417(so)s -2676(the)s 3017(def)s 2(ault)k 3731(v)s 6(alues)k -4380(abo)s 3(v)k 3(e)k 4995(are)s 5335(all)s -220 fnt35 5621 11388(Base)m 240 fnt82 6113 11391(,)m 6213(b)s 4(ut)k -6568(for)s 6899(the)s 220 fnt35 7240 11388(v)m 5(ar)k -6(ying)k -240 fnt82 7989 11391(and)m 220 fnt35 8385 11388(symbol)m 240 fnt82 -0 11103(styles,)m 657(the)s 1011(def)s 2(ault)k 1738(identi\207er)s -2667(f)s 2(ace)k 3124(is)s 220 fnt35 3340 11100(Slope)m -240 fnt82 3892 11103(,)m 4006(the)s 4360(def)s 2(ault)k -5087(k)s 2(e)k 3(yw)k 2(ord)k 5982(f)s 2(ace)k -6440(is)s 220 fnt35 6656 11100(Bold)m 240 fnt82 7082 11103(,)m -7195(and)s 7606(so)s 7878(on.)s 8288(Y)s 26(ou)k -8737(can)s 0 10815(actually)m 818(gi)s 6(v)k 3(e)k -1286(a)s 1460(f)s 2(amily)k 2144(name)s 2726(before)s -3401(the)s 3757(f)s 2(ace)k 4217(name)s 4800(in)s -5051(these)s 5607(options,)s 6427(allo)s 6(wing)k 7320(you)s -7743(to)s 7991(switch)s 8681(font)s 0 10527(f)m 2(amilies)k -817(for)s 1155(dif)s 6(ferent)k 2030(parts)s 2545(of)s -2816(the)s 3164(program)s 4034(if)s 4251(you)s 4666(wish.)s -480 10153(The)m 220 fnt35 900 10150(\207x)m 6(edidenti\207ersf)k 6(or)k -5(mat)k -240 fnt82 2964 10153(option)m 3624(allo)s 6(ws)k 4284(you)s -4690(to)s 4920(mak)s 2(e)k 5483(a)s 5641(more)s -6179(radical)s 6874(change)s 7599(to)s 7829(the)s 8168(format)s -8855(of)s 0 9865(identi\207ers)m 997(than)s 1456(just)s 1851(the)s -2190(font.)s 2729(W)s 9(ithin)k 3431(this)s 3817(option,)s -220 fnt35 4527 9862(@Body)m 240 fnt82 5298 9865(stands)m 5937(for)s -6266(the)s 6604(identi\207er)s 7516(being)s 8091(formatted,)s 0 9577(and)m -404(by)s 698(applying)s 1589(Lout)s 2101(symbols)s 2950(to)s -3189(it,)s 3428(you)s 3843(apply)s 4429(them)s 4967(to)s -5206(e)s 6(v)k 3(ery)k 5782(identi\207er)s 13(.)k -6795(F)s 3(or)k 7184(e)s 3(xample,)k 220 fnt35 -480 9076(\207x)m 6(edidenti\207ersf)k 6(or)k -5(mat { red @Colour @Body })k 240 fnt82 -0 8549(will)m 444(cause)s 1049(identi\207ers)s 2073(to)s 2330(be)s -2630(printed)s 3383(red.)s 153 fnt82 3732 8638(1)m 240 fnt82 -3930 8549(If)m 4178(you)s 4611(do)s 4922(use)s 5315(e)s 3(xotic)k -5967(formats,)s 6821(remember)s 7867(that)s 8303(in)s 8565(some)s -0 8261(programming)m 1347(languages,)s 2403(comments)s 3428(and)s 3824(e)s 6(v)k 3(en)k -4316(strings)s 4995(may)s 5453(occup)s 2(y)k 6188(more)s -6727(than)s 7188(one)s 7581(line:)s 220 fnt35 8097 8258(@Bo)m 6(x)k -240 fnt82 8690 8261(,)m 8788(for)s 0 7973(e)m 3(xample,)k -914(will)s 1340(gi)s 6(v)k 3(e)k 1799(a)s -1965(logical)s 2670(b)s 4(ut)k 3032(probably)s 3937(unw)s 2(anted)k -4924(result)s 5514(when)s 6090(formatting)s 7151(a)s 7317(multi-line)s -8314(string.)s 480 7599(As)m 795(al)s 2(w)k 2(ays)k -1504(with)s 1983(setup)s 2539(\207les,)s 3041(to)s 3278(change)s -4009(a)s 4173(def)s 2(ault)k 4892(v)s 6(alue,)k -5508(delete)s 6132(the)s 6477(preceding)s 220 fnt35 7471 7596(#)m -240 fnt82 7645 7599(and)m 8047(change)s 8778(the)s 0 7311(part)m -432(between)s 1288(braces.)s 2064(F)s 3(or)k 2455(e)s 3(xample,)k -3371(suppose)s 4200(you)s 4617(are)s 4966(happ)s 2(y)k -5606(with)s 220 fnt35 6090 7308(\207x)m 6(ed)k 240 fnt82 -6597 7311(e)m 3(xcept)k 7280(that)s 7700(you)s 8117(w)s 2(ant)k -8642(bold)s 0 7023(k)m 2(e)k 3(yw)k 2(ords.)k -1088(Then)s 1637(one)s 2039(line)s 2453(needs)s 3049(to)s -3288(be)s 3570(changed,)s 4475(to)s 220 fnt35 480 6524(\207x)m 6(edk)k 4(e)k 4(yw)k 2(ords { Bold })k -240 fnt82 0 6026(Or)m 307(suppose)s 1130(you)s 1540(lik)s 2(e)k -220 fnt35 1947 6023(v)m 5(ar)k -6(ying)k 240 fnt82 -2698 6026(as)m 2943(it)s 3130(stands,)s 3830(b)s 4(ut)k -4187(w)s 2(ould)k 4836(lik)s 2(e)k 5243(it)s -5430(to)s 5664(be)s 5941(the)s 6284(def)s 2(ault)k -7000(style)s 7502(rather)s 8113(than)s 220 fnt35 8576 6023(\207x)m 6(ed)k -240 fnt82 9022 6026(.)m 0 5738(Ag)m 1(ain,)k 691(only)s -1171(one)s 1573(line)s 1987(needs)s 2583(to)s 2822(be)s -3104(changed,)s 4009(to)s 220 fnt35 4248 5735(style { v)m 5(ar)k -6(ying })k -240 fnt82 5727 5738(.)m 480 5364(It)m 708(is)s 942(probably)s -1871(not)s 2261(a)s 2451(good)s 3013(idea)s 3495(to)s -3758(change)s 4516(the)s 4888(def)s 2(ault)k 5633(v)s 6(alue)k -6225(of)s 220 fnt35 6520 5361(n)m 2(umbered)k 240 fnt82 -7578 5364(to)m 220 fnt35 7841 5361(Y)m 30(es)k 240 fnt82 -8182 5364(,)m 8313(because)s 0 5076(small)m 572(fragments)s 1578(of)s -1848(code)s 2356(within)s 3024(paragraphs)s 4123(will)s 4549(then)s -5018(get)s 5369(line)s 5783(numbers)s 6658(as)s 6907(well)s -7373(as)s 7623(lar)s 4(ge)k 8151(displayed)s 0 4788(programs.)m -1078(If)s 1319(you)s 1746(do)s 2050(ha)s 4(v)k 3(e)k -2562(man)s 3(y)k 3157(lar)s 4(ge)k 3697(numbered)s -4723(programs)s 5689(as)s 5950(well)s 6427(as)s 6689(small)s -7272(fragments,)s 8345(a)s 8523(better)s 0 4500(approach)m 934(w)s 2(ould)k -1589(be)s 1871(to)s 2110(place)s 220 fnt35 480 3999(impor)m -8(t @CPSetup)k -480 3711(macro @NCP { @CP n)m 2(umbered { )k 19(Y)k 30(es } })k 240 fnt82 -0 3217(\(or)m 336(the)s 681(equi)s 6(v)k 6(alent)k -1723(for)s 2058(your)s 2555(language\))s 3544(in)s 3785(your)s -220 fnt35 4281 3214(m)m 3(ydefs)k 240 fnt82 5037 3217(\207le,)m -5446(so)s 5710(that)s 6125(you)s 6538(can)s 6924(type)s -220 fnt35 7390 3214(@NCP)m 240 fnt82 8123 3217(instead)m 8855(of)s -220 fnt35 0 2926(@CP n)m 2(umbered { )k 19(Y)k 30(es })k -240 fnt82 2223 2929(.)m 480 2555(The)m 905(setup)s 1460(\207les)s -1906(for)s 2241(the)s 2586(other)s 3134(languages)s 4139(are)s -4483(identical)s 5357(to)s 5593(this)s 5986(one,)s 6436(e)s 3(xcept)k -7114(that)s 7529(the)s 7874(symbol)s 8630(after)s 220 fnt35 -0 2264(@Use)m 240 fnt82 666 2267(is)m 878(dif)s 6(ferent,)k -1801(and)s 2207(some)s 2770(of)s 3042(the)s 3392(def)s 2(ault)k -4114(v)s 6(alues)k 4772(may)s 5240(be)s 5523(dif)s 6(ferent.)k -6504(Changing)s 7490(an)s 7775(option)s 8446(af)s 6(fects)k -0 1979(only)m 480(the)s 828(language)s 1749(of)s 2020(that)s -2438(setup)s 2997(\207le;)s 3414(if)s 3632(you)s 4047(ha)s 4(v)k 3(e)k -4548(multiple)s 5401(languages)s 6409(you)s 6824(can)s 7214(ha)s 4(v)k 3(e)k -7715(multiple)s 8568(setup)s 1134 0 0 0 240 288 60 0 1457 LoutGr2 -0 0 moveto xsize 0 lineto stroke -grestore - -grestore -122 fnt82 0 1262(1)m 172 fnt35 -56 1191(@Colour)m 192 fnt82 779 1192(is)m 945(not)s 1235(a)s -1365(Lout)s 1773(primiti)s 4(v)k 2(e)k 2510(lik)s 1(e,)k -2879(say)s 12(,)k 172 fnt35 3206 1191(@F)m 5(ont)k -192 fnt82 3714 1192(;)m 3801(it)s 3952(is)s 4118(de\207ned)s -4726(when)s 5184(you)s 5514(write)s 172 fnt35 5948 1191(@SysInclude { doc })m -192 fnt82 7528 1192(or)m 7733(the)s 8009(equi)s 4(v)k 4(alent)k -8844(for)s 0 962(the)m 279(other)s 720(document)s 1524(types.)s -2060(This)s 2441(is)s 2609(true)s 2952(of)s 3168(quite)s -3596(a)s 3729(fe)s 4(w)k 4055(generally)s 4811(useful)s -5322(symbols,)s 6047(including)s 172 fnt35 6814 961(@Bo)m 5(x)k -192 fnt82 7325 962(and)m 172 fnt35 7649 961(@I)m 192 fnt82 -7855 962(.)m 7987(If)s 8170(you)s 8502(w)s 1(ant)k -8922(to)s 0 732(use)m 300(these)s 738(symbols)s 1417(here,)s -1832(you)s 2164(must)s 2583(include)s 3192(your)s 3591(setup)s -4038(\207le)s 192 fnt83 4327 733(after)m 172 fnt35 4740 731(@SysInclude { doc })m -192 fnt82 6322 732(or)m 6529(whate)s 4(v)k 2(er)k 7(,)k -7303(the)s 7582(re)s 4(v)k 2(erse)k 8172(of)s -8388(the)s 8666(usual)s 0 502(arrangement,)m 1044(so)s 1260(that)s -1597(the)s 2(y)k 1972(are)s 2253(de\207ned)s 2866(before)s -3402(Lout)s 3814(reads)s 4261(your)s 4663(setup)s 5112(\207le.)s -5490(This)s 5873(re)s 4(v)k 2(ersal)k 6518(is)s -6689(carried)s 7268(out)s 7564(automatically)s 8653(when)s 0 272(formatting)m -841(programs)s 1594(independently)s 2715(of)s 2921(an)s 2(y)k -3230(document,)s 4063(so)s 4266(you)s 4588(can)s 4891(use)s -5181(these)s 5609(symbols)s 6279(in)s 6464(a)s 6587(setup)s -7025(\207le)s 7304(gi)s 4(v)k 2(en)k 7760(by)s -7987(a)s 172 fnt35 8110 271(-S)m 192 fnt82 8311 272(command)m -0 42(line)m 332(\210ag.)s -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 8 10 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Bold -%%+ font Times-Italic -%%+ font Helvetica -/pgsave save def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -0 LoutMargSet -grestore -240 fnt84 0 13840(8)m 240 fnt83 5981 13843(Chapter)m 6831(1.)s -7105(Computer)s 8128(Pr)s 10(o)k 2(gr)k 3(ams)k -240 fnt82 0 13205(\207les)m 449(and)s 853(change)s 1587(their)s -2084(options)s 2840(quite)s 3374(independently)s 4784(of)s 5055(each)s -5550(other)s 13(.)k 240 fnt84 0 12412(1.5.)m 471(Dealing)s -1311(with)s 1817(tab)s 2201(characters)s 3330(in)s 3585(pr)s 4(ograms)k -240 fnt82 480 11935(T)m 19(ab)k 896(characters)s 1924(pro)s 3(vide)k -2718(a)s 2894(con)s 9(v)k 3(enient)k 4002(w)s 2(ay)k -4463(to)s 4712(indent)s 5380(and)s 5794(align)s 6339(parts)s -6864(of)s 7145(computer)s 8119(programs.)s 0 11647(W)m 9(ith)k -526(care,)s 1030(this)s 1426(alignment)s 2442(can)s 2831(be)s -3113(preserv)s 3(ed)k 4097(in)s 4340(the)s 4688(\207nal)s -5168(print)s 5679(e)s 6(v)k 3(en)k 6179(with)s -6661(v)s 6(arying-width)k 8067(fonts.)s 480 11273(The)m 896(distance)s -1723(between)s 2565(tw)s 2(o)k 2962(tab)s 3295(stops)s -3826(in)s 4056(the)s 4392(program)s 5250(te)s 3(xt)k -5653(is)s 5850(by)s 6132(def)s 2(ault)k 6841(tak)s 2(en)k -7401(to)s 7628(be)s 7898(8)s 8052(characters,)s 0 10985(which)m -642(is)s 852(standard)s 1720(for)s 2058(Unix.)s 2701(This)s -3177(can)s 3566(be)s 3848(changed)s 4704(with)s 5186(the)s -220 fnt35 5534 10982(tabin)m 240 fnt82 6055 10985(option.)m 6831(F)s 3(or)k -7220(e)s 3(xample,)k 220 fnt35 480 10484(@CP tabin { 4 })m 240 fnt82 -0 9990(informs)m 789(Lout)s 1296(that)s 1709(tab)s 2049(stops)s -2587(occur)s 3173(e)s 6(v)k 3(ery)k 3744(4)s -3913(characters)s 4926(in)s 5164(the)s 5507(program)s 6372(te)s 3(xt.)k -6886(All)s 7241(the)s 7584(symbols)s 8428(\()s 220 fnt35 -8501 9987(@CP)m 240 fnt82 9019 9990(,)m 220 fnt35 0 9699(@Eiff)m 6(el)k -240 fnt82 689 9702(,)m 785(etc.\))s 1240(and)s 1633(their)s -2118(setup)s 2665(\207les)s 3103(ha)s 4(v)k 3(e)k -3593(this)s 3977(option)s 4635(and)s 5028(the)s 5364(ne)s 3(xt;)k -5874(b)s 4(ut)k 6225(to)s 6453(sa)s 4(v)k 3(e)k -6915(repetition)s 7876(we)s 8200(will)s 8614(stick)s 0 9414(with)m -482(C)s 694(for)s 1032(the)s 1380(rest)s 1784(of)s -2055(this)s 2451(section.)s 480 9040(The)m 916(distance)s 1764(between)s -2627(tw)s 2(o)k 3046(tab)s 3399(stops)s 3951(on)s -4257(the)s 4614(printed)s 5357(page)s 5874(is)s 6093(quite)s -6636(a)s 6810(dif)s 6(ferent)k 7694(thing,)s 8302(and)s -8715(it)s 8916(is)s 0 8752(determined)m 1133(by)s 1427(the)s -1775(v)s 6(alue)k 2343(of)s 2614(the)s 220 fnt35 -2962 8749(tabout)m 240 fnt82 3628 8752(option,)m 4347(which)s 4989(must)s -5514(be)s 5796(a)s 5962(Lout)s 6474(length.)s 7236(F)s 3(or)k -7625(e)s 3(xample,)k 220 fnt35 480 8251(@CP tabout { 0.5i })m 240 fnt82 -0 7757(requests)m 857(that)s 1298(tab)s 1666(stops)s 2232(be)s -2537(placed)s 3243(at)s 3498(half-inch)s 4440(interv)s 6(als.)k -5443(In)s 5722(other)s 6297(w)s 2(ords,)k 7010(a)s -7199(distance)s 8061(of)s 8355(one)s 8781(tab)s 0 7469(stop)m -474(in)s 739(the)s 1109(program)s 2001(te)s 3(xt)k -2439(will)s 2887(be)s 3191(equi)s 6(v)k 6(alent)k -4257(to)s 4519(a)s 4707(distance)s 5568(of)s 5861(half)s -6326(an)s 6632(inch)s 7123(on)s 7442(the)s 7812(printed)s -8570(page.)s 0 7181(F)m 3(or)k 389(e)s 3(xample,)k -220 fnt35 480 6680(@CP style { v)m 5(ar)k -6(ying } tabout { 3f } n)k 2(umbered { )k 19(Y)k 30(es })k -240 fnt82 0 6181(might)m 659(produce)s 1527(the)s 1916(follo)s 6(wing,)k -2989(where)s 3670(tab)s 4056(characters)s 5116(in)s 5400(the)s -5789(program)s 6700(te)s 3(xt)k 7157(ha)s 4(v)k 3(e)k -7699(been)s 8249(used)s 8788(for)s 0 5893(indenting)m 957(and)s -1361(also)s 1799(to)s 2038(align)s 2573(the)s 2921(comments:)s -480 5388(1)m 240 fnt84 1200 5387(struct)m 240 fnt83 1856 5390(tnode)m -240 fnt82 2441 5388({)m 4080(/*)s 4310(the)s 4658(basic)s -5202(node)s 5724(*/)s 480 5100(2)m 240 fnt84 1920 5099(char)m -240 fnt82 2443 5046(*)m 240 fnt83 2547 5102(wor)m 8(d)k -240 fnt82 3038 5100(;)m 4080(/*)s 4310(points)s 4946(to)s -5185(the)s 5533(te)s 3(xt)k 5948(*/)s 480 4812(3)m -240 fnt84 1920 4811(int)m 240 fnt83 2258 4814(count)m 240 fnt82 -2794 4812(;)m 4080(/*)s 4310(number)s 5101(of)s 5372(occurrences)s -6564(*/)s 480 4524(4)m 240 fnt84 1920 4523(struct)m 240 fnt83 -2576 4526(tnode)m 240 fnt82 3161 4470(*)m 240 fnt83 3265 4526(left)m -240 fnt82 3573 4524(;)m 4080(/*)s 4310(left)s 4687(child)s -5223(*/)s 480 4236(5)m 240 fnt84 1920 4235(struct)m 240 fnt83 -2576 4238(tnode)m 240 fnt82 3161 4182(*)m 240 fnt83 3265 4238(right)m -240 fnt82 3734 4236(;)m 4080(/*)s 4310(right)s 4821(child)s -5357(*/)s 480 3948(6)m 1200(};)s 0 3454(W)m 19(e')k 12(v)k 3(e)k -672(used)s 220 fnt35 1183 3451(n)m 2(umbered { )k 19(Y)k 30(es })k -240 fnt82 2891 3454(to)m 3144(demonstrate)s 4381(that)s 4813(the)s -5174(features)s 5994(for)s 6345(dealing)s 7116(with)s 7611(tabs)s -8061(w)s 2(ork)k 8626(e)s 6(v)k 3(en)k -0 3166(with)m 471(line)s 873(numbers.)s 1850(The)s 2266(v)s 6(alue)k -220 fnt35 2823 3163(3f)m 240 fnt82 3051 3166(means)m 3702(three)s -4223(times)s 4780(the)s 5116(current)s 5841(font)s 6274(size,)s -6741(and)s 7133(it)s 7314(is)s 7512(the)s 7849(def)s 2(ault)k -8558(v)s 6(alue)k 0 2878(of)m 220 fnt35 273 2875(tabout)m -240 fnt82 942 2878(for)m 1282(the)s 220 fnt35 1633 2875(v)m 5(ar)k -6(ying)k -240 fnt82 2391 2878(and)m 220 fnt35 2798 2875(symbol)m 240 fnt82 -3541 2878(styles)m 4139(\(Section)s 4994(1.4\).)s 5540(In)s 5798(a)s -5967(12)s 6263(point)s 6818(font)s 7265(this)s 7664(is)s -7876(36)s 8172(points,)s 8867(or)s 0 2590(half)m 443(an)s -726(inch.)s 480 2216(If)m 220 fnt35 710 2213(tabout)m 240 fnt82 -1376 2216(is)m 1586(too)s 1945(small,)s 2569(there)s 3102(is)s -3312(a)s 3478(danger)s 4189(that)s 4607(the)s 4955(alignment)s -5971(might)s 6589(f)s 2(ail.)k 7068(F)s 3(or)k -7457(e)s 3(xample,)k 220 fnt35 480 1715(@CP style { v)m 5(ar)k -6(ying } tabout { 0.2i })k -240 fnt82 0 1216(produces)m -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 9 11 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Italic -%%+ font Times-Bold -%%+ font Courier -%%+ font Helvetica -/pgsave save def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -%%IncludeResource: font Courier -/Courierfnt29 vec2 /Courier LoutRecode -/fnt29 { /Courierfnt29 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -1 LoutMargSet -grestore -240 fnt83 0 13843(1.5.)m 454(Dealing)s 1279(with)s 1746(tab)s -2106(c)s 3(har)k 3(acter)k 2(s)k 3176(in)s -3416(pr)s 10(o)k 2(gr)k 3(ams)k 240 fnt84 -8952 13840(9)m 480 13202(struct)m 240 fnt83 1136 13205(tnode)m 240 fnt82 -1721 13203({)m 1805(/*)s 2035(the)s 2383(basic)s 2927(node)s -3449(*/)s 240 fnt84 768 12914(char)m 240 fnt82 1291 12861(*)m -240 fnt83 1395 12917(wor)m 8(d)k 240 fnt82 1886 12915(;)m -1938(/*)s 2168(points)s 2804(to)s 3043(the)s 3391(te)s 3(xt)k -3806(*/)s 240 fnt84 768 12626(int)m 240 fnt83 1106 12629(count)m -240 fnt82 1642 12627(;)m 1694(/*)s 1924(number)s 2715(of)s -2986(occurrences)s 4178(*/)s 240 fnt84 768 12338(struct)m 240 fnt83 -1424 12341(tnode)m 240 fnt82 2009 12285(*)m 240 fnt83 2113 12341(left)m -240 fnt82 2421 12339(;)m 2473(/*)s 2703(left)s 3080(child)s -3616(*/)s 240 fnt84 768 12050(struct)m 240 fnt83 1424 12053(tnode)m -240 fnt82 2009 11997(*)m 240 fnt83 2113 12053(right)m 240 fnt82 -2582 12051(;)m 2634(/*)s 2864(right)s 3375(child)s 3911(*/)s -480 11763(};)m 0 11269(gi)m 6(v)k 3(en)k 590(the)s -948(same)s 1505(C)s 1727(te)s 3(xt)k 2153(as)s -2413(the)s 2771(pre)s 6(vious)k 3650(e)s 3(xample.)k -4632(The)s 5070(problem)s 5937(here)s 6414(is)s 6634(that)s -7063(we)s 7408(are)s 7765(asking)s 8453(for)s 220 fnt29 -8802 11277(/*)m 240 fnt82 71 10981(to)m 321(appear)s 1029(four)s -1498(tab)s 1854(stops)s 2408(or)s 2678(0.8)s 3036(inches)s -3709(from)s 4244(the)s 4603(left)s 4991(edge,)s 5561(and)s -5976(yet)s 6339(the)s 6698(material)s 7545(to)s 7795(its)s -8082(left)s 8470(on)s 8778(the)s 0 10693(line)m 419(is)s -634(wider)s 1244(than)s 1718(this.)s 2232(This)s 2714(causes)s -220 fnt29 3394 10701(/*)m 240 fnt82 3861 10693(to)m 4105(be)s -4393(shifted)s 5106(further)s 5820(to)s 6065(the)s 6418(right)s -6934(than)s 7409(e)s 3(xpected,)k 8368(and)s 8778(the)s -0 10405(alignment)m 1016(is)s 1226(lost.)s 1735(The)s 2163(only)s -2643(solution)s 3471(is)s 3681(to)s 3920(increase)s 220 fnt35 -4758 10402(tabout)m 240 fnt82 5364 10405(.)m 480 10031(When)m 1108(typesetting)s -2208(computer)s 3169(program)s 4038(te)s 3(xts)k 4535(independently)s -5943(of)s 6213(an)s 3(y)k 6608(document,)s 7657(there)s -8189(are)s 220 fnt35 8534 10028(-t)m 240 fnt82 8722 10031(and)m -220 fnt35 0 9740(-T)m 240 fnt82 289 9743(options)m 1070(to)s -1335(the)s 220 fnt35 1708 9740(prg2lout)m 240 fnt82 2581 9743(program)m -3477(equi)s 6(v)k 6(alent)k 4546(to)s 220 fnt35 -4811 9740(tabin)m 240 fnt82 5357 9743(and)m 220 fnt35 5786 9740(tabout)m -240 fnt82 6478 9743(respecti)m 6(v)k 3(ely)k 15(.)k -7797(F)s 3(or)k 8212(e)s 3(xample,)k 220 fnt35 -0 9452(-T0.5i)m 240 fnt82 606 9455(produces)m 1521(a)s 1687(half-inch)s -2606(tab)s 2951(width.)s 240 fnt84 0 8662(1.6.)m 471(Dealing)s -1311(with)s 1817(f)s 6(ormfeed)k 2794(characters)s 3923(in)s -4178(pr)s 4(ograms)k 240 fnt82 480 8185(The)m 900(formfeed)s -1824(\(Control-L\))s 2978(character)s 3904(is)s 4105(traditionally)s 5317(tak)s 2(en)k -5881(to)s 6112(be)s 6385(a)s 6542(request)s 7283(to)s -7514(start)s 7975(a)s 8132(ne)s 6(w)k 8570(page.)s -0 7897(This)m 476(is)s 686(e)s 3(xplicitly)k 1639(recognized)s -2746(by)s 3040(the)s 3388(formal)s 4079(de\207nition)s 5054(of)s -5325(the)s 5673(C)s 5885(language)s 6805(and)s 7209(man)s 3(y)k -7792(others,)s 8484(which)s 0 7609(treat)m 486(this)s 886(character)s -1823(as)s 2077(white)s 2667(space)s 3258(from)s 3785(a)s -3955(language)s 4878(point)s 5434(of)s 5708(vie)s 6(w)k 15(,)k -6263(with)s 6748(the)s 7100(understanding)s 8512(that)s 8934(it)s -0 7321(will)m 426(cause)s 1013(a)s 1179(page)s 1687(break)s -2279(when)s 2855(printed.)s 480 6947(There)m 1086(are)s 1426(no)s -220 fnt35 1712 6944(prg2lout)m 240 fnt82 2553 6947(options)m 3302(for)s -3633(dealing)s 4383(with)s 4858(formfeed)s 5784(characters.)s 6908(The)s 3(y)k -7444(will)s 7863(be)s 8137(con)s 9(v)k 3(erted)k -0 6659(into)m 220 fnt35 425 6656(@NP)m 240 fnt82 1003 6659(\(ne)m 6(w)k -1529(page\))s 2109(symbols,)s 3014(causing)s 3798(a)s 3964(ne)s 6(w)k -4411(page)s 4919(or)s 5178(column)s 5953(to)s 6192(be)s -6474(be)s 3(gun)k 7114(in)s 7357(the)s 7705(printing.)s -480 6285(Whether)m 1386(formfeed)s 2342(characters)s 3383(end)s 3810(their)s -4330(line)s 4767(or)s 5050(not)s 5439(is)s 5672(a)s -5861(problem.)s 6845(Consider)s 7792(this)s 8212(e)s 3(xample,)k -0 5997(where)m 220 fnt35 640 5994(^L)m 240 fnt82 921 5997(stands)m -1570(for)s 1908(one)s 2310(formfeed)s 3243(character:)s 220 fnt35 -480 5549(abc)m 480 5261(def^Lghi)m 480 4973(jhk)m 240 fnt82 0 4476(Ho)m 6(w)k -532(man)s 3(y)k 1134(lines)s 1654(does)s 2163(this)s -2577(e)s 3(xample)k 3459(contain?)s 4401(Y)s 26(our)k -4945(te)s 3(xt)k 5379(editor)s 6014(w)s 2(ould)k -6688(probably)s 7611(say)s 8003(`three',)s 8764(b)s 4(ut)k -0 4188(when)m 571(you)s 980(print)s 1486(it)s 1672(you)s -2081(will)s 2502(see)s 2857(four)s 13(.)k 3400(It)s -3600(is)s 3804(not)s 4164(desirable)s 5077(to)s 5310(ha)s 4(v)k 3(e)k -5805(printed)s 6535(programs)s 7483(\(especially)s 8565(those)s 0 3900(with)m -465(line)s 861(numbers)s 1718(attached\))s 2624(disagreeing)s 3761(with)s -4225(te)s 3(xt)k 4623(editors)s 5306(about)s 5880(line)s -6276(numbers.)s 7246(The)s 7656(solution)s 8466(adopt)s 8998(-)s -0 3612(ed)m 297(by)s 220 fnt35 604 3609(prg2lout)m 240 fnt82 -1466 3612(to)m 1718(this)s 2128(problem)s 2998(is)s 3222(to)s -3474(treat)s 3971(the)s 4332(formfeed)s 5279(character)s 6226(as)s -6490(including)s 7460(a)s 7640(ne)s 6(wline,)k 8511(b)s 4(ut)k -8887(to)s 0 3324(assign)m 647(the)s 987(same)s 1526(line)s -1932(number)s 2715(to)s 2946(both)s 3421(parts)s 3928(of)s -4191(the)s 4531(original)s 5321(line)s 5727(\(the)s 6146(parts)s -6653(before)s 7311(and)s 7707(after)s 8195(the)s 8534(form)s -8998(-)s 0 3036(feed\).)m 664(If)s 905(the)s 1264(part)s -1705(after)s 2212(the)s 2571(formfeed)s 3514(is)s 3735(empty)s -4398(\(that)s 4905(is,)s 5182(if)s 5410(the)s 5768(formfeed)s -6712(character)s 7657(is)s 7878(immediately)s 0 2748(follo)m 6(wed)k -913(by)s 1219(a)s 1397(ne)s 6(wline)k 2216(or)s -2487(another)s 3276(formfeed\),)s 4349(and)s 4765(if)s 4994(the)s -5354(formfeed)s 6299(is)s 6521(not)s 6899(inside)s 7538(an)s 3(y)k -7947(le)s 3(xical)k 8647(unit,)s 0 2460(then)m 469(the)s -817(empty)s 1469(line)s 1883(after)s 2379(the)s 2727(formfeed)s -3660(will)s 4086(not)s 4452(be)s 4734(printed)s 5469(at)s -5701(all.)s 480 2086(The)m 901(most)s 1419(common)s 2307(case)s -2767(is)s 2970(that)s 3381(of)s 3645(a)s 3804(formfeed)s -4729(character)s 9(,)k 5694(outside)s 6434(an)s 3(y)k -6824(le)s 3(xical)k 7505(unit,)s 7977(on)s 8267(a)s -8426(line)s 8832(by)s 0 1798(itself.)m 640(Let')s 13(s)k -1168(see)s 1529(what)s 2054(this)s 2450(rule)s 2877(produces)s -3792(in)s 4035(the)s 4383(follo)s 6(wing)k 5360(e)s 3(xample)k -6223(of)s 6494(this)s 6890(case:)s 220 fnt35 480 1301(abc)m -480 1013(def)m 480 725(^L)m 480 437(ghi)m -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 10 12 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Bold -%%+ font Times-Italic -%%+ font Helvetica -/pgsave save def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -0 LoutMargSet -grestore -240 fnt84 0 13840(10)m 240 fnt83 5981 13843(Chapter)m 6831(1.)s -7105(Computer)s 8128(Pr)s 10(o)k 2(gr)k 3(ams)k -240 fnt82 0 13205(There)m 615(will)s 1043(be)s 1328(one)s -1732(blank)s 2327(line)s 2744(numbered)s 3761(3)s 3927(at)s -4162(the)s 4512(end)s 4918(of)s 5192(the)s 5542(\207rst)s -5975(page,)s 6537(and)s 6943(a)s 7111(line)s 7528(numbered)s -8545(4)s 8722(and)s 0 12917(containing)m 220 fnt35 1065 12914(ghi)m -240 fnt82 1405 12917(at)m 1639(the)s 1989(start)s 2461(of)s -2734(the)s 3084(ne)s 3(xt)k 3555(page.)s 4173(The)s -4603(blank)s 5198(line)s 5614(is)s 5826(a)s 5994(necessity)s 15(,)k -6964(at)s 7198(least)s 7697(when)s 8275(lines)s 8779(are)s -0 12629(being)m 596(numbered,)s 1671(because)s 2496(we)s 2842(w)s 2(ant)k -3377(the)s 3736(last)s 4139(line)s 4564(in)s 4819(the)s -5178(e)s 3(xample)k 6053(to)s 6303(be)s 6597(numbered)s -7623(4)s 7809(to)s 8059(agree)s 8644(with)s 0 12341(te)m 3(xt)k -414(editors,)s 1169(b)s 4(ut)k 1529(we)s 1862(don')s 4(t)k -2422(w)s 2(ant)k 2943(the)s 3289(line)s 3701(numbers)s -4575(on)s 4870(our)s 5247(print)s 5756(to)s 5994(skip)s -6444(from)s 6966(2)s 7138(on)s 7434(the)s 7780(\207rst)s -8209(page)s 8715(to)s 8952(4)s 0 12053(on)m 297(the)s -644(second,)s 1415(because)s 2227(that)s 2644(w)s 2(ould)k -3298(mak)s 2(e)k 3869(readers)s 4609(anxious)s 5404(about)s -5995(the)s 6342(apparently)s 7404(missing)s 8200(line)s 8613(3.)s -8896(If)s 0 11765(you)m 415(don')s 4(t)k 976(w)s 2(ant)k -1499(that)s 1917(empty)s 2569(line,)s 3034(mo)s 3(v)k 3(e)k -3616(the)s 3964(formfeed)s 4897(character)s 5831(to)s 6070(the)s -6418(end)s 6822(of)s 7093(the)s 7441(preceding)s 8437(line.)s -240 fnt84 0 10972(1.7.)m 471(Embedding)s 1710(Lout)s 2262(commands)s -3419(within)s 4125(pr)s 4(ogram)k 5081(comments)s 240 fnt82 -480 10495(It)m 712(is)s 949(possible)s 1817(to)s 2083(embed)s -2806(Lout)s 3346(te)s 3(xt)k 3788(inside)s 4442(program)s -5340(comments.)s 6514(Ho)s 6(w)k 7055(this)s 7479(is)s -7716(done)s 8265(could)s 8883(in)s 0 10207(principle)m 916(v)s 6(ary)k -1401(from)s 1936(language)s 2868(to)s 3118(language,)s 4101(b)s 4(ut)k -4474(in)s 4729(e)s 6(v)k 3(ery)k 5317(language)s -6248(supported)s 7262(so)s 7539(f)s 2(ar)k 7873(it)s -8076(is)s 8298(done)s 8832(by)s 0 9919(starting)m 757(of)s 6(f)k -1089(the)s 1424(comment)s 2362(with)s 2831(an)s 220 fnt35 -3102 9916(@)m 240 fnt82 3341 9919(character)m 13(.)k 4353(If)s -4571(the)s 4906(language)s 5814(has)s 6172(se)s 6(v)k 3(eral)k -6881(w)s 2(ays)k 7410(to)s 7636(get)s 7976(a)s -8129(comment,)s 0 9631(this)m 408(will)s 847(w)s 2(ork)k -1411(e)s 6(v)k 3(ery)k 2000(w)s 2(ay)k 15(.)k -2559(The)s 3000(entire)s 3612(comment)s 4575(after)s 5083(the)s -220 fnt35 5444 9628(@)m 240 fnt82 5708 9631(character)m 6655(should)s -7365(then)s 7847(be)s 8142(Lout)s 8667(te)s 3(xt.)k -0 9343(F)m 3(or)k 389(e)s 3(xample,)k 1303(to)s -1542(force)s 2088(Lout)s 2600(to)s 2839(start)s 3309(a)s -3475(ne)s 6(w)k 3922(page)s 4430(at)s 4662(some)s -5223(point)s 5775(within)s 6443(a)s 6609(C)s 6821(program,)s -7738(place)s 220 fnt35 480 8842(/*@ @NP */)m 240 fnt82 0 8387(at)m -234(that)s 655(point.)s 1314(\(In)s 1652(this)s 2051(case)s -2521(you)s 2939(can)s 3331(also)s 3772(simply)s 4480(include)s -5243(a)s 5412(formfeed)s 6348(character)s 9(,)k 7323(control-L,)s -8335(without)s 0 8099(an)m 3(y)k 414(comment;)s 1433(see)s -1811(Section)s 2602(1.6)s 2972(for)s 3328(more)s 3892(on)s -4206(this.\))s 4816(Or)s 9(,)k 5183(to)s 5439(mak)s 2(e)k -6029(a)s 6212(heading)s 7040(in)s 7300(an)s 7600(Eif)s 6(fel)k -8209(program,)s 0 7811(do)m 293(this:)s 220 fnt35 480 7360(--@ @Displa)m 6(y @Heading { treepr)k -3(int })k -240 fnt82 0 6861(\(Eif)m 6(fel)k 658(comments)s 1680(be)s 3(gin)k -2254(with)s 220 fnt35 2724 6858(--)m 240 fnt82 2909 6861(and)m -3300(end)s 3692(at)s 3912(the)s 4248(end)s 4640(of)s -4899(the)s 5234(line.\))s 5828(Other)s 6420(possible)s 7248(uses)s -7699(for)s 8025(this)s 8408(feature)s 0 6573(include)m 760(inde)s 3(x)k -1344(entries)s 2031(and)s 2435(mar)s 4(gin)k 3165(notes.)s -3834(Incredible)s 4858(as)s 5108(it)s 5300(may)s 5766(seem,)s -6364(you)s 6779(can)s 7168(e)s 6(v)k 3(en)k -7668(write)s 220 fnt35 480 6072(/*@ @CD @Heading { Function @CP { treepr)m -3(int\(\) } } */)k 240 fnt82 -0 5573(with)m 500(a)s 220 fnt35 684 5570(@CP)m 240 fnt82 -1280 5573(symbol)m 2058(and)s 2481(some)s 3060(C)s 3290(code)s -3816(inside)s 4462(the)s 4828(Lout)s 5358(code)s 5884(inside)s -6530(the)s 6896(C)s 7126(code.)s 7760(Y)s 26(ou)k -8221(probably)s 0 5285(can')m 4(t)k 566(go)s 892(further)s 9(,)k -1673(ho)s 6(we)k 6(v)k 3(er)k 9(,)k -2613(at)s 2879(least)s 3409(not)s 3808(in)s 4085(C,)s -4385(since)s 4966(that)s 5417(w)s 2(ould)k 6105(require)s -6871(a)s 7070(C)s 7316(comment)s 8299(inside)s 8960(a)s -0 4997(C)m 212(comment.)s 240 fnt84 0 4253(1.8.)m 471(Embedding)s -1710(pr)s 4(ogram)k 2666(text)s 3110(within)s 3816(pr)s 4(ogram)k -4772(comments)s 240 fnt82 480 3776(The)m 902(standard)s 1763(reference)s -2699(for)s 3030(the)s 3371(Eif)s 6(fel)k 3955(language)s -4869([1)s 5043(])s 5154(speci\207es)s 6021(that)s 6432(identi\207ers)s -7431(within)s 8092(comments)s 0 3488(may)m 466(or)s 725(should)s -1422(be)s 1704(enclosed)s 2599(in)s 2842(`)s 2963(and)s -3367(')s 3479(so)s 3745(that)s 4163(the)s 3(y)k -4626(may)s 5092(be)s 5374(noticed)s 6136(and)s 6540(printed)s -7275(in)s 7518(an)s 7801(italic)s 8330(font:)s 220 fnt35 -480 2987(@ID @Eiff)m 6(el {)k 480 2699(deposit\(amount:)m 11( REAL\) is)k 480 2411( -- deposit )m 13(`amount')k 15( dollars)k -480 2123(})m 240 fnt82 0 1629(produces)m 240 fnt83 480 1126(deposit)m -240 fnt82 1175 1124(\()m 240 fnt83 1248 1126(amount)m 240 fnt82 -1971 1124(:)m 240 fnt83 2077 1126(REAL)m 240 fnt82 2648 1124(\))m -240 fnt84 2776 1123(is)m 240 fnt82 1200 836(--)m 1407(deposit)s -240 fnt83 2158 838(amount)m 240 fnt82 2941 836(dollars)m 0 333(This)m -463(has)s 819(been)s 1315(generalized)s 2460(in)s 2690(Lout:)s -3294(arbitrary)s 4156(te)s 3(xt)k 4557(within)s 5212(an)s -5481(Eif)s 6(fel)k 6059(comment)s 6995(between)s 7836(`)s -7943(and)s 8334(')s 8432(will)s 8844(be)s -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 11 13 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Italic -%%+ font Times-Bold -%%+ font Helvetica -/pgsave save def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -1 LoutMargSet -grestore -240 fnt83 0 13843(1.8.)m 454(Embedding)s 1599(pr)s 10(o)k 2(gr)k 3(am)k -2479(te)s 4(xt)k 2883(within)s 3535(pr)s 10(o)k 2(gr)k 3(am)k -4415(comments)s 240 fnt84 8839 13840(11)m 240 fnt82 0 13205(treated)m -707(as)s 957(Eif)s 6(fel)k 1548(te)s 3(xt)k -1963(and)s 2367(printed)s 3102(accordingly)s 15(.)k 4380(Some)s -4981(other)s 5532(languages)s 6540(may)s 7006(also)s 7444(of)s 6(fer)k -7961(this)s 8358(feature:)s 0 12917(see)m 377(the)s 742(\207fth)s -1214(column)s 2006(of)s 2294(the)s 2659(table)s 3195(at)s -3444(the)s 3809(start)s 4296(of)s 4584(this)s 4997(chapter)s 13(.)k -5867(In)s 6140(principle)s 7062(the)s 7427(precise)s 8176(means)s -8855(of)s 0 12629(getting)m 707(it)s 889(could)s 1469(v)s 6(ary)k -1932(from)s 2445(language)s 3355(to)s 3584(language,)s 4545(b)s 4(ut)k -4897(the)s 5234(languages)s 6232(a)s 4(v)k 6(ailable)k -7130(at)s 7352(the)s 7690(moment)s 8523(either)s 0 12341(do)m -293(not)s 659(ha)s 4(v)k 3(e)k 1160(it)s -1352(at)s 1584(all,)s 1929(or)s 2188(else)s 2615(the)s 3(y)k -3078(use)s 3453(`)s 3574(and)s 3978(')s 4090(lik)s 2(e)k -4502(Eif)s 6(fel.)k 480 11967(On)m 847(the)s 1213(subject)s -1967(of)s 2256(Eif)s 6(fel,)k 2917(the)s 3282(Eif)s 6(fel)k -3891(reference)s 4852([1)s 5026(])s 5161(has)s 5549(some)s -6128(quite)s 6679(detailed)s 7511(style)s 8036(guidelines,)s 0 11679(and)m -436(these)s 1016(ha)s 4(v)k 3(e)k 1550(been)s -2091(closely)s 2855(follo)s 6(wed)k 3790(in)s 4066(the)s -4446(implementation)s 6036(of)s 6340(the)s 220 fnt35 6720 11676(@Eiff)m 6(el)k -240 fnt82 7502 11679(symbol.)m 8404(In)s 8693(par)s 8998(-)s -0 11391(ticular)m 9(,)k 220 fnt35 744 11388(@Eiff)m 6(el)k -240 fnt82 1531 11391(prints)m 2164(dots)s 2651(lar)s 4(ger)k -3301(than)s 3808(usual)s 4406(when)s 5019(the)s 3(y)k -5520(denote)s 6252(feature)s 7007(calls,)s 7589(as)s 7877(the)s -8263(e)s 3(xample)k 240 fnt83 0 11105(account)m 336 fnt82 -762 11095(.)m 240 fnt83 835 11105(deposit)m 240 fnt82 1530 11103(\(20\))m -1977(sho)s 6(ws.)k 240 fnt84 0 10314(1.9.)m 471(Reading)s -1378(and)s 1819(selecting)s 2750(pr)s 4(ogram)k 3706(text)s -4150(fr)s 4(om)k 4706(separate)s 5625(\207les)s 240 fnt82 -480 9837(W)m 19(e)k 852(ha)s 4(v)k 3(e)k -1356(said)s 1802(that)s 2223(program)s 3096(te)s 3(xt)k -3514(within)s 220 fnt35 4186 9834(@CP { ...)m 13( })k 240 fnt82 -5266 9837(and)m 5673(the)s 6024(other)s 6578(symbols)s 7430(is)s -7643(passed)s 8343(directly)s 0 9549(to)m 220 fnt35 272 9546(prg2lout)m -240 fnt82 1153 9549(for)m 1525(analysis.)s 2492(Ho)s 6(we)k 6(v)k 3(er)k 9(,)k -3485(there)s 4052(is)s 4295(an)s 4611(e)s 3(xception.)k -5736(The)s 6197(program)s 7100(te)s 3(xt)k 7549(may)s -8048(contain)s 8843(an)s 220 fnt35 0 9258(@Include)m 240 fnt82 -985 9261(or)m 220 fnt35 1248 9258(@SysInclude)m 240 fnt82 2599 9261(command,)m -3654(which,)s 4349(as)s 4603(for)s 4945(the)s 220 fnt35 -5296 9258(@V)m 17(erbatim)k 240 fnt82 6429 9261(symbol)m 7192(\(Section)s -8049(??\),)s 8451(causes)s 0 8973(Lout)m 512(to)s 751(tak)s 2(e)k -1203(the)s 1551(program)s 2421(te)s 3(xt)k 2836(from)s -3360(a)s 3526(\207le:)s 220 fnt35 480 8472(@Eiff)m 6(el)k -480 8184({)m 480 7896( @Include { "/usr/staff/jeff/Eiff)m 6(el/hash.e" })k 480 7608(})m 240 fnt82 -0 7114(The)m 421(included)s 1296(\207le)s 1649(is)s 1852(not)s -2211(e)s 3(xamined)k 3188(for)s 3519(balanced)s 4419(braces)s -5073(or)s 220 fnt35 5325 7111(@End)m 240 fnt82 5978 7114(or)m -220 fnt35 6230 7111(@Include)m 240 fnt82 7152 7114(;)m 7257(it)s -7441(is)s 7644(treated)s 8343(entirely)s 0 6826(v)m 3(erbatim)k -895(and)s 1288(passed)s 1973(straight)s 2738(on)s 3024(to)s -220 fnt35 3252 6823(prg2lout)m 240 fnt82 4040 6826(.)m 4193(There)s -4795(may)s 5250(be)s 5521(se)s 6(v)k 3(eral)k -220 fnt35 6232 6823(@Include)m 240 fnt82 7203 6826(commands,)m 8336(and)s -8729(an)s 3(y)k 0 6538(amount)m 778(of)s 1049(program)s -1919(te)s 3(xt)k 2334(as)s 2584(well,)s 3102(within)s -220 fnt35 3770 6535(@CP { ...)m 13( })k 240 fnt82 4847 6538(and)m -5251(the)s 5599(rest.)s 480 6164(When)m 1109(including)s 2066(\207les)s -2515(in)s 2758(this)s 3153(w)s 2(ay)k 3604(it)s -3796(often)s 4344(happens)s 5179(that)s 5597(only)s 6077(part)s -6508(of)s 6778(an)s 7061(actual)s 7686(program)s 8556(\207le)s -8916(is)s 0 5876(w)m 2(anted)k 753(for)s 1098(display)s 15(.)k -1945(Rather)s 2649(than)s 3125(placing)s 3888(the)s 4243(w)s 2(anted)k -4997(part)s 5435(in)s 5685(a)s 5857(separate)s 6702(\207le,)s -7121(which)s 7770(is)s 7987(error)s 4(-prone)k 0 5588(and)m -404(tedious)s 1147(when)s 1724(the)s 2073(program)s 2944(is)s -3154(changing,)s 4140(Unix)s 4675(users)s 5218(can)s 5608(use)s -5984(the)s 220 fnt35 6332 5585(pipe)m 240 fnt82 6799 5588(option)m -7469(to)s 7709(pipe)s 8178(the)s 8527(entire)s 0 5300(\207le)m -369(through)s 1180(an)s 1472(arbitrary)s 2355(sequence)s 3297(of)s -3577(Unix)s 4119(commands,)s 5272(which)s 5923(may)s 6397(be)s -6688(used)s 7194(to)s 7441(mak)s 2(e)k 8022(the)s -8379(w)s 2(anted)k 0 5012(selection)m 906(before)s 1572(the)s -1920(program)s 2790(te)s 3(xt)k 3205(is)s 3415(passed)s -4111(to)s 220 fnt35 4350 5009(prg2lout)m 240 fnt82 5138 5012(.)m -480 4638(F)m 3(or)k 868(e)s 3(xample,)k 1780(suppose)s -2606(that)s 3022(all)s 3313(your)s 3810(Eif)s 6(fel)k -4399(routines)s 5218(be)s 3(gin)k 5802(with)s 6282(the)s -6628(routine)s 7359(name)s 7931(one)s 8331(tab)s 8674(stop)s -0 4350(from)m 524(the)s 872(left)s 1249(mar)s 4(gin)k -1979(and)s 2383(end)s 2787(at)s 3019(the)s 3367(\207rst)s -3798(follo)s 6(wing)k 240 fnt84 4775 4349(end)m 240 fnt82 -5202 4350(indented)m 6084(tw)s 2(o)k 6494(tab)s 6839(stops.)s -7495(Then)s 220 fnt35 480 3849(@Eiff)m 6(el)k 480 3561( pipe { "sed -n /^.inser)m -8(t/,/^..end/p" })k -480 3273({)m 480 2985( @Include { "/usr/staff/jeff/Eiff)m 6(el/hash.e" })k 480 2697(})m 240 fnt82 -0 2203(will)m 417(select)s 1010(just)s 1406(the)s 240 fnt83 -1744 2205(insert)m 240 fnt82 2342 2203(routine)m 3066(from)s 3580(the)s -220 fnt35 3918 2200(hash.e)m 240 fnt82 4620 2203(\207le.)m 5079(Assuming)s -6094(that)s 6502(your)s 6991(program)s 7852(te)s 3(xt)k -8257(has)s 8617(been)s 0 1915(laid)m 413(out)s 775(in)s -1014(a)s 1176(disciplined)s 2279(manner)s 9(,)k 3090(e)s 6(v)k 3(ery)k -3663(line)s 4073(of)s 4340(the)s 4684(selection)s 5586(will)s -6008(be)s 3(gin)k 6591(with)s 7069(a)s 7231(tab)s -7572(character)s 8502(that)s 8916(is)s 0 1627(not)m 366(w)s 2(anted)k -1113(in)s 1356(this)s 1752(display)s 15(,)k 2535(so)s -2801(an)s 3084(e)s 6(v)k 3(en)k 3584(better)s -4187(pipe)s 4655(is)s -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 12 14 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Bold -%%+ font Times-Italic -%%+ font Helvetica -/pgsave save def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -0 LoutMargSet -grestore -240 fnt84 0 13840(12)m 240 fnt83 5981 13843(Chapter)m 6831(1.)s -7105(Computer)s 8128(Pr)s 10(o)k 2(gr)k 3(ams)k -220 fnt35 480 13207(@Eiff)m 6(el)k 480 12919( pipe { "sed -n /^.inser)m -8(t/,/^..end/p | cut -c2-" })k -480 12631({)m 480 12343( @Include { "/usr/staff/jeff/Eiff)m 6(el/hash.e" })k 480 12055(})m 240 fnt82 -0 11561(since)m 584(it)s 813(cuts)s 1286(a)s 3(w)k 2(ay)k -1878(the)s 2263(unw)s 2(anted)k 3287(tab)s 3670(characters.)s -4838(Unfortunately)s 15(,)k 6308(we)s 6680(can')s 4(t)k -7251(sho)s 6(w)k 7842(the)s 8227(result)s 8855(of)s -0 11273(this)m 430(on)s 761(an)s 1078(actual)s 1737(e)s 3(xample,)k -2685(since)s 3266(that)s 3718(w)s 2(ould)k 4407(pre)s 6(v)k 3(ent)k -5209(this)s 5639(manual)s 6432(from)s 6990(being)s 7609(formatted)s -8629(on)s 8960(a)s 0 10985(non-Unix)m 973(system.)s 240 fnt84 -0 10193(1.10.)m 591(Err)s 4(or)k 1243(messages)s 240 fnt82 -480 9716(In)m 739(order)s 1307(to)s 1550(understand)s 2662(the)s -3013(error)s 3540(messages)s 4498(produced)s 5451(by)s 5749(program)s -6622(printing,)s 7490(it)s 7686(is)s 7900(necessary)s 8887(to)s -0 9428(understand)m 1113(that)s 1536(Lout')s 13(s)k 2203(\207rst)s -2639(step)s 3082(when)s 3663(gi)s 6(v)k 3(en)k -4248(a)s 4419(program)s 5294(te)s 3(xt)k 5714(is)s -5929(to)s 6173(pass)s 6641(it)s 6838(to)s 7082(the)s -7435(separate)s 220 fnt35 8278 9425(prg2lout)m 240 fnt82 0 9140(program)m -917(for)s 1303(analysis.)s 2285(This)s 2809(separate)s 3695(program)s -4613(is)s 4871(the)s 5266(source)s 5994(of)s 6313(most)s -6886(of)s 7205(the)s 7601(error)s 8172(messages)s 0 8852(associated)m -1040(with)s 1522(program)s 2392(printing.)s 480 8478(The)m 220 fnt35 -907 8475(prg2lout)m 240 fnt82 1753 8478(program)m 2622(is)s 2830(quite)s -3362(happ)s 2(y)k 3999(to)s 4236(format)s 4931(a)s -5095(fragment)s 6015(of)s 6285(a)s 6449(computer)s 7411(program:)s -8385(there)s 8916(is)s 0 8190(no)m 278(need)s 773(to)s -997(supply)s 1675(a)s 1826(complete)s 2743(routine,)s 3512(or)s -3756(a)s 3907(complete)s 4824(statement,)s 5831(or)s 6075(an)s 3(y)k -6457(such)s 6938(thing.)s 7579(Ho)s 6(we)k 6(v)k 3(er)k 9(,)k -8524(it)s 8700(will)s 0 7902(complain)m 944(if)s 1157(you)s -1568(supply)s 2258(only)s 2734(a)s 2896(fragment)s 3815(of)s -4082(one)s 4480(le)s 3(xical)k 5164(unit,)s 5640(such)s -6132(as)s 6378(a)s 6541(comment)s 7487(or)s 7742(string)s -8335(without)s 0 7614(its)m 276(terminating)s 1431(delimiter)s 13(.)k -2444(It)s 2650(will)s 3077(also)s 3515(complain)s 4463(if)s -4681(there)s 5215(is)s 5426(a)s 5592(character)s 6527(that)s -6946(cannot)s 7645(be)s 7928(classi\207ed)s 8876(as)s 0 7326(part)m -432(of)s 705(an)s 990(identi\207er)s 9(,)k 1952(number)s 9(,)k -2782(etc.)s 3166(according)s 4164(to)s 4405(the)s 4754(rules)s -5271(of)s 5544(the)s 5894(language)s 6815(as)s 7067(the)s 3(y)k -7532(ha)s 4(v)k 3(e)k 8035(been)s 8546(gi)s 6(v)k 3(en)k -0 7038(to)m 220 fnt35 259 7035(prg2lout)m 240 fnt82 1127 7038(by)m -1442(the)s 1810(implementer)s 13(.)k 3189(Irrespecti)s 6(v)k 3(e)k -4382(of)s 4673(the)s 5042(language)s 5982(rules,)s 220 fnt35 -6574 7035(prg2lout)m 240 fnt82 7442 7038(al)m 2(w)k 2(ays)k -8174(interprets)s 0 6750(spaces,)m 731(tabs,)s 1223(ne)s 6(wlines,)k -2174(and)s 2578(formfeed)s 3511(characters)s 4529(in)s 4772(the)s -5120(usual)s 5680(w)s 2(ay)k 15(.)k 480 6376(If)m -738(an)s 1050(error)s 1601(message)s 2496(is)s 2735(generated)s -3750(by)s 220 fnt35 4073 6373(prg2lout)m 240 fnt82 4861 6376(,)m -4996(it)s 5217(will)s 5672(contain)s 6461(a)s 6656(line)s -7098(and)s 7531(column)s 8335(number)s 0 6088(counting)m 891(from)s -1415(the)s 1763(start)s 2233(of)s 2504(the)s 2852(program)s -3722(te)s 3(xt)k 4137(in)s 9(v)k 4(olv)k 3(ed.)k -5123(Lout)s 5635(will)s 6061(precede)s 6860(this)s 7256(error)s -7779(message)s 8644(with)s 0 5800(a)m 175(\207le)s 545(name,)s -1179(line)s 1602(number)s 9(,)k 2441(and)s 2854(column)s -3638(number)s 4438(pointing)s 5298(to)s 5547(the)s 5904(Lout)s -6425(symbol)s 7194(\()s 220 fnt35 7267 5797(@CP)m 240 fnt82 -7785 5800(,)m 220 fnt35 7901 5797(@Eiff)m 6(el)k 240 fnt82 -8660 5800(etc.\))m 0 5512(whose)m 668(program)s 1538(te)s 3(xt)k -1953(caused)s 2662(the)s 3010(error)s 3533(message,)s 4450(lik)s 2(e)k -4862(this:)s 220 fnt35 480 5012(lout \207le "prg_tabs" \(from "prg" line 96, from "all" line 46\):)m 480 4724( 56,23:)m 11( prg2lout 2,1:)k 11( prog)k 2(r)k 2(am te)k 6(xt ended within comment)k -240 fnt82 0 4225(This)m 476(is)s 686(an)s 970(actual)s -1595(message)s 2462(produced)s 3411(when)s 3988(formatting)s 5049(this)s -5445(chapter)s 13(.)k 6300(The)s 6728(program)s 7599(te)s 3(xt)k -8014(in)s 8258(question)s 0 3937(has)m 369(only)s 848(one)s -1249(line,)s 1713(containing)s 2775(an)s 3057(incomplete)s 4174(comment,)s -5169(so)s 5434(when)s 220 fnt35 6009 3934(prg2lout)m 240 fnt82 -6856 3937(tried)m 7350(to)s 7588(start)s 8057(the)s 8403(second)s -0 3649(line)m 408(and)s 805(found)s 1416(nothing,)s 2248(it)s -2434(complained)s 3601(as)s 3845(sho)s 6(wn.)k 4622(In)s -4872(general,)s 5675(then,)s 6188(you)s 6596(ha)s 4(v)k 3(e)k -7091(to)s 7323(add)s 220 fnt35 7721 3646(prg2lout)m 240 fnt82 -8509 3649(')m 13(s)k 8712(line)s 0 3361(number)m 791(to)s -1030(Lout')s 13(s)k 1692(line)s 2106(number)s 9(,)k -2935(and)s 3339(use)s 3714(some)s 4275(initiati)s 6(v)k 3(e,)k -5221(to)s 5460(\207nd)s 5891(the)s 6239(precise)s 6971(point)s -7523(of)s 7794(the)s 8142(problem.)s 240 fnt84 0 2569(1.11.)m -591(Notes)s 1216(on)s 1525(P)s 4(erl)k 2000(and)s -2441(P)s 4(od)k 240 fnt82 480 2137(The)m 923(Perl)s -1378(programming)s 2749(language)s 153 fnt82 3609 2226(1)m 240 fnt82 -3744 2137(is)m 3970(quite)s 4520(a)s 4702(dif\207cult)s 5533(one)s -5951(for)s 6305(the)s 220 fnt35 6668 2134(prg2lout)m 240 fnt82 -7532 2137(program)m 8418(to)s 8673(deal)s 0 1849(with,)m 526(and)s -924(our)s 1297(boast)s 1855(that)s 2267(programs)s 3215(can)s -3598(be)s 3873(included)s 4749(with)s 5225(`absolutely)s 6335(no)s -6621(modi\207cations')s 8029(is)s 8233(not)s 8592(quite)s 0 1561(true)m -427(for)s 765(Perl.)s 480 1187(Here)m 992(is)s 1194(the)s -1534(complete)s 2458(list)s 2801(of)s 3064(problem)s 3913(areas.)s -4559(In)s 4807(most)s 5324(cases)s 5871(their)s 6360(ef)s 6(fect)k -6948(is)s 7150(to)s 7381(get)s 7725(the)s 8065(formatting)s -0 899(wrong)m 675(o)s 3(v)k 3(er)k 1164(a)s -1341(short)s 1889(re)s 3(gion,)k 2615(which)s 3267(is)s -3488(not)s 3864(perhaps)s 4670(so)s 4946(disastrous;)s 6025(and)s -6439(it)s 6642(should)s 7349(be)s 7642(easy)s 8131(to)s -8381(modify)s 1134 0 0 0 240 288 60 0 307 LoutGr2 -0 0 moveto xsize 0 lineto stroke -grestore - -grestore -122 fnt82 0 112(1)m 192 fnt82 58 42(My)m -368(thanks)s 909(to)s 1101(Mark)s 1563(Summer\207eld)s 2598(for)s -2868(help)s 3241(with)s 3627(Perl)s 3978(and)s 4302(Pod.)s - -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 13 15 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Italic -%%+ font Times-Bold -%%+ font Courier -%%+ font Helvetica -/pgsave save def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -%%IncludeResource: font Courier -/Courierfnt29 vec2 /Courier LoutRecode -/fnt29 { /Courierfnt29 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -1 LoutMargSet -grestore -240 fnt83 0 13843(1.11.)m 574(Notes)s 1174(on)s 1468(P)s 19(erl)k -1920(and)s 2346(P)s 19(od)k 240 fnt84 8833 13840(13)m -240 fnt82 0 13249(your)m 507(Perl)s 955(program)s 1834(without)s -2634(changing)s 3574(its)s 3859(meaning,)s 4799(to)s 5046(w)s 2(ork)k -5606(around)s 6338(these)s 6894(problems.)s 7957(After)s 8529(all,)s -8883(in)s 0 12961(Perl)m 439(there)s 972(is)s 1182(al)s 2(w)k 2(ays)k -1893(more)s 2440(than)s 2909(one)s 3311(w)s 2(ay)k -3762(to)s 4001(do)s 4294(it.)s 0 12456(1.)m 240 fnt83 -480 12458(Her)m 8(e-documents)k 240 fnt82 2108 12456(such)m 2604(as)s -960 12004(<<"EOF")m 960 11716(These lines will be read as though)m 960 11428(enclosed in double quotes)m 960 11140(EOF)m 480 10686(will)m -893(be)s 1162(handled)s 1964(correctly)s 2853(only)s 3320(if)s -3523(the)s 3858(string)s 4442(appearing)s 5424(immediately)s 6659(after)s -7142(the)s 220 fnt29 7476 10694(<<)m 240 fnt82 7787 10686(operator)m -8629(\(that)s 480 10398(is,)m 748(the)s 1098(string)s 1697(used)s -2197(to)s 2438(terminate)s 3397(the)s 3747(here-document\))s 5312(is)s -5524(one)s 5928(of)s 220 fnt29 6201 10406(EOF)m 240 fnt82 -6597 10398(,)m 220 fnt29 6707 10406(EOT)m 240 fnt82 7103 10398(,)m -220 fnt29 7212 10406(END)m 240 fnt82 7608 10398(,)m 7717(and)s -8123(the)s 8474(empty)s 480 10110(string,)m 1116(all)s 1393(optionally)s -2401(enclosed)s 3281(in)s 3508(quotes)s 4168(of)s 4424(an)s 3(y)k -4805(of)s 5060(the)s 5392(three)s 5910(kinds.)s 6577(If)s -6791(this)s 7172(condition)s 8117(is)s 8311(not)s 8661(met,)s -480 9822(then)m 942(the)s 1283(here-document)s 2770(will)s 3189(be)s -3464(treated)s 4163(as)s 4406(Perl)s 4838(program)s 5701(te)s 3(xt.)k -6213(If)s 6435(the)s 6776(condition)s 7730(is)s 7933(met,)s -8391(there)s 8916(is)s 480 9534(still)m 885(another)s 1655(problem:)s -2610(the)s 220 fnt29 2951 9542(<<)m 240 fnt82 3268 9534(symbol)m -4020(and)s 4417(e)s 6(v)k 3(erything)k 5476(after)s -5965(it)s 6150(on)s 6439(the)s 6780(same)s 7320(line)s -7726(will)s 8145(be)s 8419(treated)s 480 9246(\(incorrectly\))m 1715(as)s -1958(a)s 2117(string.)s 2819(The)s 3240(w)s 2(orst)k -3822(consequence)s 5095(of)s 5359(this)s 5748(is)s 5952(that)s -6363(stack)s 2(ed)k 7129(here-documents)s 8700(will)s 480 8958(not)m -846(be)s 1128(printed)s 1863(properly)s 15(.)k 0 8455(2.)m -480(When)s 220 fnt35 1118 8452(prg2lout)m 240 fnt82 1976 8455(is)m -2196(scanning)s 3110(the)s 3468(program)s 4347(te)s 3(xt)k -4772(looking)s 5567(for)s 5915(the)s 6273(be)s 3(ginning)k -7290(of)s 7571(a)s 7747(le)s 3(xical)k 8445(unit,)s -8934(it)s 480 8167(may)m 939(come)s 1505(upon)s 2034(a)s -220 fnt35 2192 8164(/)m 240 fnt82 2309 8167(character)m 9(,)k -3273(and)s 3669(this)s 240 fnt83 4057 8169(initial)m 220 fnt35 -4680 8164(/)m 240 fnt82 4796 8167(\(not)m 5233(subsequent)s 6349(ones)s -6832(in)s 7067(the)s 7407(same)s 7946(le)s 3(xical)k -8626(unit\))s 480 7879(it)m 691(\207nds)s 1227(dif\207cult)s 2062(to)s -2320(interpret,)s 3254(since)s 3820(it)s 4031(may)s 4517(be)s -4818(the)s 5185(be)s 3(ginning)k 6212(of)s 6502(a)s -6687(re)s 3(gular)k 7439(e)s 3(xpression,)k 8585(to)s -8844(be)s 480 7591(formatted)m 1460(lik)s 2(e)k 1865(a)s -2024(string,)s 2668(or)s 2920(it)s 3105(may)s 3564(be)s -3839(a)s 3998(complete)s 4923(le)s 3(xical)k 5604(unit)s -6029(denoting)s 6913(di)s 6(vision.)k 7835(The)s 8256(program)s -480 7303(chooses)m 1308(the)s 1675(re)s 3(gular)k 2427(e)s 3(xpression)k -3524(\(or)s 3881(equi)s 6(v)k 6(alently)k 15(,)k -5162(string\))s 5853(interpretation)s 7216(if)s 7452(the)s 220 fnt35 -7819 7300(/)m 240 fnt82 7962 7303(character)m 8916(is)s 480 7015(immediately)m -1714(preceded)s 2620(by)s 220 fnt35 2900 7012(q)m 240 fnt82 -3009 7015(,)m 220 fnt35 3101 7012(qq)m 240 fnt82 3332 7015(,)m -220 fnt35 3424 7012(qx)m 240 fnt82 3654 7015(,)m 220 fnt35 -3747 7012(qw)m 240 fnt82 4025 7015(,)m 220 fnt35 4117 7012(qr)m -240 fnt82 4312 7015(,)m 220 fnt35 4405 7012(m)m 240 fnt82 -4574 7015(,)m 220 fnt35 4666 7012(s)m 240 fnt82 4769 7015(,)m -220 fnt35 4861 7012(y)m 240 fnt82 4969 7015(,)m 5062(or)s -220 fnt35 5306 7012(tr)m 240 fnt82 5440 7015(.)m 5590(It)s -5780(also)s 6203(chooses)s 6998(the)s 7331(re)s 3(gular)k -8049(e)s 3(xpression)k 480 6727(interpretation)m 1818(if)s 2029(the)s -220 fnt35 2371 6724(/)m 240 fnt82 2489 6727(character)m 3417(appears)s -4192(at)s 4418(the)s 4760(start)s 5225(of)s 5490(a)s -5650(line,)s 6109(or)s 6362(if)s 6573(it)s 6759(is)s -6963(immediately)s 8205(preceded)s 480 6439(by)m 787(zero,)s 1319(one,)s -1786(or)s 2059(tw)s 2(o)k 2482(space)s 3083(or)s -3356(tab)s 3715(characters,)s 4802(which)s 5458(are)s 5819(themselv)s 3(es)k -6943(immediately)s 8205(preceded)s 480 6151(by)m 784(a)s 961(complete)s -1903(le)s 3(xical)k 2602(unit)s 3044(which)s 3697(is)s -3918(one)s 4330(of)s 220 fnt35 4612 6148(\()m 240 fnt82 -4678 6151(,)m 220 fnt35 4795 6148(=)m 240 fnt82 4915 6151(,)m -220 fnt35 5033 6148(=~)m 240 fnt82 5276 6151(,)m 220 fnt35 -5393 6148(!~)m 240 fnt82 5569 6151(,)m 220 fnt35 5687 6148(split)m -240 fnt82 6072 6151(,)m 220 fnt35 6190 6148(if)m 240 fnt82 -6296 6151(,)m 220 fnt35 6413 6148(and)m 240 fnt82 6767 6151(,)m -220 fnt35 6885 6148(&&)m 240 fnt82 7173 6151(,)m 220 fnt35 -7290 6148(or)m 240 fnt82 7485 6151(,)m 220 fnt35 7603 6148(||)m -240 fnt82 7697 6151(,)m 220 fnt35 7814 6148(not)m 240 fnt82 -8115 6151(,)m 220 fnt35 8233 6148(!)m 240 fnt82 8274 6151(,)m -220 fnt35 8392 6148(unless)m 240 fnt82 9019 6151(,)m 220 fnt35 -480 5860(f)m 6(or)k 240 fnt82 730 5863(,)m 220 fnt35 -849 5860(f)m 6(oreach)k 240 fnt82 1561 5863(,)m 1681(and)s -220 fnt35 2098 5860(while)m 240 fnt82 2588 5863(.)m 2765(Otherwise)s -3816(it)s 4021(chooses)s 4843(the)s 5204(di)s 6(vision)k -6039(interpretation.)s 7502(In)s 7771(the)s 8132(rare)s 8571(cases)s -480 5575(where)m 1120(this)s 1517(rule)s 1945(f)s 2(ails,)k -2460(you)s 2876(can)s 3266(force)s 220 fnt35 3812 5572(prg2lout)m -240 fnt82 4661 5575(to)m 4901(choose)s 5622(the)s 5971(re)s 3(gular)k -6705(e)s 3(xpression)k 7783(interpretation)s 480 5287(by)m 777(placing)s -1537(an)s 220 fnt35 1823 5284(m)m 240 fnt82 2055 5287(in)m -2301(front)s 2829(of)s 3103(the)s 3454(initial)s 220 fnt35 -4068 5284(/)m 240 fnt82 4195 5287(\(this)m 4673(does)s 5167(not)s -5536(change)s 6273(the)s 6624(meaning)s 7504(of)s 7778(the)s -8130(program\),)s 480 4999(and)m 910(you)s 1352(can)s 1768(force)s -2341(the)s 2716(di)s 6(vision)k 3565(interpretation)s 4935(by)s -5256(placing)s 6040(at)s 6299(least)s 6823(three)s 7383(spaces)s -8085(before)s 8778(the)s 220 fnt35 480 4708(/)m 240 fnt82 -604 4711(character)m 13(.)k 0 4253(3.)m 480(Substitution)s 1701(e)s 3(xpressions,)k -2930(e)s 6(v)k 3(en)k 3439(such)s 3943(le)s 3(xically)k -4825(comple)s 3(x)k 5710(ones)s 6208(as)s 220 fnt29 -6467 4261(s{{@D}}[{@I}])m 240 fnt82 8183 4253(,)m 8299(are)s 8655(han)s -8998(-)s 480 3965(dled)m 942(correctly)s 15(.)k 1931(Ho)s 6(we)k 6(v)k 3(er)k 9(,)k -220 fnt35 2883 3962(prg2lout)m 240 fnt82 3723 3965(does)m 4205(not)s -4563(understand)s 5663(that)s 6073(the)s 6413(letters)s 220 fnt35 -7038 3962(gimosx)m 240 fnt82 7783 3965(in)m 8018(an)s 3(y)k -8406(combi)s 8998(-)s 480 3677(nation)m 1135(appearing)s 2131(immediately)s -3378(after)s 3874(a)s 4040(substitution)s 5212(e)s 3(xpression)k -6289(are)s 6636(part)s 7066(of)s 7337(it;)s 7581(it)s -7772(treats)s 8339(them)s 8876(as)s 480 3389(the)m 825(start)s -1291(of)s 1558(a)s 1721(ne)s 6(w)k 2164(le)s 3(xical)k -2848(unit.)s 3380(This)s 3853(ne)s 6(w)k 4296(unit)s -4724(will)s 5147(usually)s 5888(be)s 6166(tak)s 2(en)k -6735(to)s 6971(be)s 7249(an)s 7528(identi\207er)s 9(,)k -8484(which)s 480 3101(is)m 690(harmless)s 1590(enough,)s 2403(b)s 4(ut)k -2765(occasionally)s 4014(it)s 4206(is)s 4416(tak)s 2(en)k -4989(to)s 5228(be)s 5510(something)s 6560(else.)s 7095(F)s 3(or)k -7484(e)s 3(xample,)k 8398(in)s 220 fnt35 960 2600(s///s;)m -240 fnt82 480 2117(the)m 838(trailing)s 220 fnt35 1591 2114(s)m -240 fnt82 1765 2117(will)m 2201(be)s 2494(mistak)s 2(en)k -3423(for)s 3771(the)s 4130(start)s 4611(of)s 4892(a)s -5069(ne)s 6(w)k 5527(substitution)s 6710(e)s 3(xpression,)k -7848(with)s 220 fnt35 8341 2114(;)m 240 fnt82 8454 2117(delim)m -8998(-)s 480 1829(iting)m 976(the)s 1329(\207rst)s 1766(pattern.)s -2598(This)s 3080(particular)s 4059(e)s 3(xample)k 4927(can)s -5322(be)s 5609(\207x)s 3(ed)k 6149(by)s 6448(inserting)s -7342(a)s 7514(space)s 8106(before)s 8778(the)s 480 1541(semicolon.)m -0 1088(Further)m 763(w)s 2(ork)k 1314(may)s 1780(eliminate)s -2724(some)s 3285(of)s 3556(these)s 4103(problems.)s 480 714(The)m -953(Pod)s 1429(language)s 2394(is)s 2650(used)s 3192(by)s -3531(Perl)s 4015(programmers)s 5386(for)s 5769(creating)s 6636(documentation,)s -8210(and)s 8660(may)s 0 426(be)m 313(found)s 961(within)s -1660(Perl)s 2131(programs)s 3116(or)s 3406(standing)s 4301(alone.)s -5015(Lout)s 5558(supports)s 6451(both)s 6965(arrangements)s 8335(without)s -0 138(an)m 3(y)k 418(special)s 1157(action)s 1819(by)s -2134(the)s 2503(user)s 13(.)k 3073(At)s 3393(the)s -3762(be)s 3(ginning)k 4792(of)s 5084(the)s 220 fnt35 -5453 135(per)m -3(l)k 240 fnt82 5888 138(setup)m 6467(line,)s -6953(the)s 7322(follo)s 6(wing)k 8320(line)s 8756(has)s - -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 14 16 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Bold -%%+ font Times-Italic -%%+ font Helvetica -/pgsave save def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -0 LoutMargSet -grestore -240 fnt84 0 13840(14)m 240 fnt83 5981 13843(Chapter)m 6831(1.)s -7105(Computer)s 8128(Pr)s 10(o)k 2(gr)k 3(ams)k -240 fnt82 0 13205(been)m 509(placed:)s 220 fnt35 480 12704(@SysInclude { pod })m -240 fnt82 0 12206(Thus,)m 576(asking)s 1244(for)s 1571(Perl)s -2000(al)s 2(w)k 2(ays)k 2700(gi)s 6(v)k 3(es)k -3237(you)s 3641(Pod)s 4062(as)s 4301(well.)s 4866(If)s -5085(you)s 5490(are)s 5826(using)s 6388(your)s 6876(o)s 6(wn)k -7330(setup)s 7877(\207les)s 8316(for)s 8643(both)s 0 11918(languages,)m -1068(it)s 1265(is)s 1480(probably)s 2390(better)s 2998(to)s -3242(break)s 3839(this)s 4240(connection)s 5352(by)s 5651(deleting)s -6479(this)s 6880(line)s 7299(from)s 7828(your)s 8332(cop)s 2(y)k -8855(of)s 0 11630(the)m 220 fnt35 348 11627(per)m -3(l)k -240 fnt82 762 11630(setup)m 1320(\207le)s 1681(and)s 2085(placing)s -220 fnt35 480 11129(@Include { m)m 3(ypod })k 480 10841(@Include { m)m 3(yper)k -3(l })k -240 fnt82 0 10343(at)m 232(the)s 580(start)s 1050(of)s -1321(your)s 1820(document)s 2824(in)s 3067(the)s 3415(usual)s -3975(w)s 2(ay)k 15(.)k 480 9969(Because)m 1341(Pod)s -1781(is)s 2000(a)s 2174(documentation)s 3662(language)s 4591(rather)s -5215(than)s 5693(a)s 5868(programming)s 7231(language,)s 8211(the)s -8568(setup)s 0 9681(\207le)m 363(options)s 1121(listed)s 1699(in)s -1944(Section)s 2720(1.4)s 3077(do)s 3372(not)s 3740(really)s -4340(apply)s 15(.)k 5023(So)s 5331(for)s 5672(Pod)s -6105(only)s 6587(these)s 7137(ha)s 4(v)k 3(e)k -7640(been)s 8152(discarded)s 0 9393(and)m 435(replaced)s 1333(by)s -1658(a)s 1855(completely)s 3002(dif)s 6(ferent)k 3908(set)s -4264(of)s 4566(options,)s 5409(controlling)s 6542(such)s 7069(things)s -7736(as)s 8017(the)s 8396(size)s 8855(of)s 0 9105(headings)m -902(and)s 1306(the)s 1654(g)s 1(aps)k 2143(between)s -2997(list)s 3348(items,)s 3972(which)s 4614(you)s 5029(can)s -5418(\207nd)s 5849(documented)s 7077(in)s 7320(the)s 220 fnt35 -7668 9102(pod)m 240 fnt82 8082 9105(setup)m 8640(\207le.)s 480 8731(If)m -710(you)s 1126(ask)s 1506(for)s 1845(line)s 2259(numbers)s -3135(on)s 3432(a)s 3599(Pod)s 4030(program,)s 4948(or)s -5207(on)s 5505(a)s 5671(Perl)s 6111(program)s 6981(that)s -7400(contains)s 8248(Pod,)s 8729(an)s 3(y)k 0 8443(te)m 3(xt)k -432(blocks)s 1126(in)s 1387(the)s 1753(Pod)s 2202(that)s -2638(w)s 2(ould)k 3311(otherwise)s 4313(ha)s 4(v)k 3(e)k -4832(appeared)s 5771(as)s 6039(\207lled)s 6606(paragraphs)s 7724(will)s -8168(come)s 8760(out)s 0 8155(with)m 484(the)s 834(line)s -1250(breaks)s 1927(in)s 2172(the)s 2522(source)s 3204(respected,)s -4215(and)s 4621(lines)s 5125(numbered)s 6142(accordingly)s 15(.)k -7422(Because)s 220 fnt35 8278 8152(prg2lout)m 240 fnt82 0 7867(attaches)m -814(line)s 1222(numbers)s 2090(before)s 2750(Lout)s 3255(breaks)s -3924(paragraphs,)s 5074(it)s 5259(is)s 5463(not)s 5822(possible)s -6656(to)s 6889(numnber)s 7793(the)s 8135(lines)s 8630(after)s -0 7579(paragraph)m 1013(breaking.)s 480 7205(Owing)m 1185(to)s 1423(problems)s -2363(behind)s 3072(the)s 3419(scenes,)s 4150(if)s 4366(a)s -4531(Pod)s 4961(inclusion)s 5894(in)s 6137(a)s 6302(Perl)s -6740(program)s 7609(has)s 7978(unbalanced)s 0 6917(braces,)m 220 fnt35 -714 6914(prg2lout)m 240 fnt82 1559 6917(is)m 1766(forced)s 2431(to)s -2667(insert)s 3254(braces)s 3912(into)s 4334(the)s 4678(Pod)s -5106(te)s 3(xt)k 5518(to)s 5754(mak)s 2(e)k -6323(them)s 6858(balance.)s 7749(It)s 7951(will)s 8374(insert)s -8960(a)s 0 6629(left)m 377(brace)s 950(directly)s 1734(before)s -2400(an)s 3(y)k 2798(unbalanced)s 3946(right)s 4458(brace,)s -5082(and)s 5487(it)s 5679(will)s 6106(insert)s 6696(right)s -7208(braces)s 7869(at)s 8102(the)s 8450(end)s 8855(of)s -0 6341(the)m 347(Pod)s 777(inclusion)s 1710(to)s 1948(balance)s -2733(an)s 3(y)k 3129(preceding)s 4124(unbalanced)s 5271(left)s -5646(braces.)s 6419(It)s 6623(will)s 7048(tell)s 7406(you)s -7820(if)s 8036(it)s 8227(has)s 8596(to)s 8833(do)s -0 6053(this.)m 509(This)s 985(problem)s 1842(does)s 2332(not)s -2698(af\210ict)s 3314(Pod)s 3745(when)s 4321(used)s 4818(as)s -5068(a)s 5234(separate)s 6072(language.)s -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 15 17 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Bold -%%+ font Times-Italic -/pgsave save def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -%%IncludeResource: font Times-Italic -/Times-Italicfnt83 vec2 /Times-Italic LoutRecode -/fnt83 { /Times-Italicfnt83 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -1 LoutMargSet -grestore -480 fnt84 0 12955(Refer)m 8(ences)k 240 fnt82 0 12358([1])m -480(Bertrand)s 1374(Me)s 3(yer)k 13(.)k 240 fnt83 -2146 12360(Eif)m 4(fel:)k 2840(The)s 3252(Langua)s 2(g)k 2(e)k -240 fnt82 4200 12358(.)m 4364(Prentice-Hall)s 5631(,)s 5738(1992)s -6212(.)s 192 fnt84 4439 1(15)m -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Page: 16 18 -%%BeginPageSetup -%%PageResources: font Times-Roman -%%+ font Times-Bold -%%+ font Helvetica -/pgsave save def -%%IncludeResource: font Times-Bold -/Times-Boldfnt84 vec2 /Times-Bold LoutRecode -/fnt84 { /Times-Boldfnt84 LoutFont } def -0.0500 dup scale 10 setlinewidth -%%EndPageSetup -gsave -0 0 translate -240 fnt82 0.0 0.0 0.0 setrgbcolor 11900 16840 0 16840 240 288 60 LoutGraphic -gsave -LoutPageSet -grestore -gsave -0 16840 translate -0.0000 rotate -9066 14006 0 14006 240 288 60 1417 -15423 LoutGr2 -0 LoutMargSet -grestore -480 fnt84 0 12962(Index)m 240 fnt82 0 12367(Blue)m 508(program)s -1378(printing)s 2135(,)s 2242(1)s 0 12079(C)m 212(and)s -616(C++)s 1099(program)s 1969(printing)s 2726(,)s 2833(1)s -220 fnt35 0 11788(@CPSetup)m 240 fnt82 1099 11791(,)m 1206(6)s -0 11503(Eif)m 6(fel)k 591(program)s 1461(printing)s 2218(,)s -2325(1)s 0 11215(Perl)m 439(program)s 1309(printing)s 2066(,)s -2173(1)s 0 10927(Pod)m 431(\(for)s 848(Perl\))s 1360(printing)s -2117(,)s 2224(1)s 220 fnt35 0 10636(prg2lout)m 240 fnt82 -848 10639(\207lter)m 1358(program)s 2175(,)s 2282(1)s 0 10351(tab)m -345(characters)s 1363(in)s 1606(programs)s 2507(,)s 2614(8)s -192 fnt84 4439 2(16)m -grestore - -grestore - -grestore - -pgsave restore -showpage - -%%Trailer -%%DocumentNeededResources: font Courier -%%+ font Helvetica -%%+ font Symbol -%%+ font Times-Roman -%%+ font Times-Italic -%%+ font Times-Bold -%%+ font Times-Italic -%%DocumentSuppliedResources: procset LoutStartUp -%%+ procset LoutTabPrependGraphic -%%+ procset LoutTblPrependGraphic -%%+ procset LoutFigPrependGraphic -%%+ procset LoutGraphPrependGraphic -%%+ procset LoutFigPrependGraphic -%%+ procset LoutBasicSetup -%%+ encoding vec2 -%%Pages: 18 -%%EOF |