home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / fweb140x.zip / demos / demo.web < prev    next >
Text File  |  1993-10-30  |  43KB  |  1,142 lines

  1. \Title{DEMO.WEB}
  2.  
  3. \def\FORTRAN{{\Csc FORTRAN}}
  4. \let\Fortran\FORTRAN
  5. \def\Ratfor{{\Csc RATFOR}}
  6. \def\C{{\Csc C}}
  7. \def\mf{{\Csc m4}}
  8. \def\Weave{{\tt FWEAVE}}\let\WEAVE\Weave
  9. \def\Tangle{{\tt FTANGLE}}\let\TANGLE\Tangle
  10. \def\f77{\FORTRAN--77}
  11. \def\FWEB{{\tt FWEB}}
  12.  
  13. @n/
  14. @* INTRODUCTION. This is a demo/test program (\It{not} the formal user's
  15. manual; for that, see \.{fwebman.tex})  for a
  16. \Fortran/\Ratfor/C version of Knuth's WEB documentation system. Weave or
  17. tangle this
  18. demo with, for example, the command-line
  19.  
  20. \.{FWEAVE demo demo -d -m4 -mCMD\_LN\_MACRO=25}
  21.  
  22. \noindent \It{Note that the tangled output consists of fragments of correct
  23. code mindlessly abutted together; this demo is not intended to be compiled
  24. into a workable program.} 
  25.  
  26. The fundamental idea is to automatically format source code, and to
  27. intermix comments and documentation typeset using the full, sophisticated
  28. powers of \TeX. The system facilitates and encourages writing short,
  29. one-page functions, and provides both a table of contents of the principal
  30. sections of documentation and a complete index of all variables used in the
  31. source code.
  32.  
  33. The system consists of two processors: \Weave, and \Tangle.  Both
  34. operate on a common source file which contains both the documentation
  35. and the code. (Actually, it is better to say that the documentation \It{is}
  36. the code, and vice versa.) The pieces of the source file are
  37. identified by various commands beginning with~`\.{@@}'.
  38. \Weave\ produces documentation like you are reading now; \Tangle\ strips
  39. off the documentation and produces  compilable files.
  40.  
  41. Here is a simple example, consisting of modules~2 through~7. You should
  42. look at the source file `\.{demo.web}' with an editor to see in detail how
  43. this documentation was produced.
  44.  
  45. @ Typically, the code is divided into various blocks or \It{modules},
  46. indicated, for example,  as
  47. \.{@@<Demo@@>}. These blocks can be defined in any order, and need not be
  48. defined all at once. They will be collected and organized by WEB.
  49. To get things started, there is also an \It{unnamed module}, introduced by
  50. the command~`\.{@@a}'.
  51. \It{Fundamentally, the output of \Tangle\ is the contents of the unnamed
  52. module}. This could just consist of straight code, which will be output
  53. essentially unchanged. However, if in the unnamed module there is a
  54. reference to a named module, then \Tangle\ will stop at that point to
  55. output the contents of that module.
  56.  
  57. Each module consists of three parts: (1)~a \TeX\ part, containing arbitrary
  58. \TeX\ material that explains what is happening in the module, (2)~a
  59. definition/format part, which contains macro definitions and certain format
  60. statements (see below), and (3)~a code part, which will eventually make its
  61. way to a compilable file. In the present example, the \TeX\ part is begun by
  62. the command~`\.{@@\ }',
  63. the definition part is empty, and the code part is begun either by~`\.{@@a}'
  64. (which signifies the unnamed module),
  65. or by a module name followed by an equals sign.
  66.  
  67. Here, for example, is a simple unnamed module which tells \Tangle\ to
  68. output the contents of all the pieces that are eventually accreted to the
  69. unnamed module, followed by the contents of the three named modules
  70. ``\.{Demo}'', ``\.{Ccode}'', and~``\.{R}''. The superscripts to the angle
  71. brackets denote the language in which the module is written. (When the
  72. modules are in the default language, which is \Fortran, the superscripts
  73. are suppressed.  Languages will be described in more detail later.)  The
  74. code section of this module is begun by the nonprinting command~`\.{@@a}',
  75. which signifies the start of the \It{unnamed} module. Remember: \It{The
  76. unnamed module must always be present, otherwise \Tangle\ will not output
  77. any code.}
  78.  
  79. @A
  80.         @<Demo@> /* Constructions such as `\.{@@<text@@>}' mean insert the
  81. contents of block with name |"text"| here. WEB filled in the module
  82. number~3 automatically, to tell you where to look to find the definition of
  83. the module `\.{Demo}'. There is actually an invisible semicolon after the
  84. module name which was inserted automatically by  \Fortran's |auto_semi|
  85. mode.  In \Fortran, the semicolons are not printed; however, they are in
  86. other languages. */
  87.  
  88. @c
  89. /* The next semicolons were inserted by the user,
  90. because~\C\ and \Ratfor\ have the semicolons as an intrinsic part of the
  91. language.  */
  92.         @<Ccode@>;  /* A module in the \C\ language. This will be tangled into
  93. the file ``\.{demo.c}''. */
  94.  
  95. @r
  96.         @<R@>; /* A \Ratfor\ module. This will be tangled into
  97. ``\.{demo.rat}'' (if \mf\ is turned off, which is the default), or
  98. ``\.{demo.m4}'' (if \mf\ is turned on with the command-line option
  99. `\.{-m4}'). */ 
  100.  
  101. @ Here, instead of starting the code section with~`\.{@@a}', we start with
  102. a module name followed by an equals sign---namely, we typed
  103. `\.{@@<Demo@@>=}'.  This means that you are defining (or accreting to, if
  104. there's a previous module with this name), this block of code.
  105.  
  106. @<Demo@>=@[
  107.         program main
  108.         integer itype
  109.         read *,itype
  110.  
  111.         if(itype .eq. 1) then
  112.                 @<Process type 1.@> /* Arbitrary sections of code can be
  113.  included like this. We actually typed ``\.{@@<Process type 1.@@>}''. WEB
  114.  filled in the module number~4 automatically to tell you where this module
  115.  was first defined. */
  116.         else if(itype.eq.2) then
  117.                 @<Process type 2.@> /* This facility makes each function
  118.  much more readable. */
  119.         else
  120.                 @<Process all other types.@> /* You don't need to define
  121.  this code before it is used in the function. */
  122.         end if
  123.  
  124.         end
  125.  
  126. @ In general, each code block would be much longer than this. (But,
  127. hopefully, still not longer than about 12~lines (Knuth's guideline). 
  128. If it is, then you should use
  129. the \.{@@<...@@>} facility again to highlight the logic better.
  130. @<Process type 1.@>=
  131.         call dotype(itype) /* Inside comments, one is in \TeX\ mode, so,
  132.  for example, one can have math:
  133.  $\sum_{i=0}^{100}$. One  can also have code fragments (delimited by
  134.  vertical bars), such as |call dotype(itype)|.  */
  135.  
  136. @ Here's a contrived example to show that you can nest inclusions of named
  137. modules. 
  138. @<Process type 2.@>=
  139.         call dotype(itype**3) /* $\iota^3$.*/
  140.         @<Process type 1.@> /* Nothing wrong with physically 
  141.  inserting the same  block twice. */
  142.  
  143. @ What we actually typed below was ``\.{@@<Process all...@@>}''. If the text
  144. before the dots uniquely identifies the module, WEB will fill in the
  145. rest for you.
  146.  
  147. @<Process all...@>=
  148.         call dotype((itype-3)**5) /* $(\iota-3)^5$. */
  149.  
  150. @ Here is an example of how to accrete to a block which has already been
  151. defined. What we typed was ``\.{@@<Process type 1.@@>=}''; \Weave\ inserts
  152. the plus sign automatically to tell you that you've already defined the
  153. block, and that you're now accreting to it.
  154.  
  155. @<Process type 1.@>=
  156.         write(6,100) itype
  157. 100     format('TYPE = ',i2) /* You don't have to type the colon after numeric
  158. statement labels. (You do for alphanumeric labels; see below.) */
  159.  
  160. @* FEATURE TEST. We shall first introduce the WEB features informally, by
  161. showing how various constructions look. This also serves as a test program
  162. for the code itself. The formal rules for writing a WEB program can be
  163. found in the user manual \.{fwebman.tex}. Again, until further notice we
  164. are discussing \Fortran\ code exclusively.
  165.  
  166. @ Before we examine the WEB output, we must get the source code in. This is
  167. annoying because of \FORTRAN's line-oriented syntax. However, WEB tries to
  168. make life somewhat easier for you. (Remember, in all cases, \Tangle\ will
  169. do the right thing and produce a compilable file.)
  170.  
  171. On input, lines are strings of up to 160~characters. On output, the line
  172. length is \f77's limit of 72~characters. If \TANGLE\ creates an output line
  173. of more than 72~characters, the line will be properly continued. (No
  174. attempt is made to break the line at ``pretty'' places.)
  175.  
  176. There are several kinds of comments, which we shall call  \FORTRAN-style
  177. and C-style.
  178. @^comments@>
  179. The standard \FORTRAN\ variety follows
  180. the VAX rule: a standard comment has a |'C'| (upper or lower case),
  181. or a~|'*'| in column~1. (See the user manual for a discussion of comments
  182. beginning with exclamation points.)
  183. These comments are turned automatically
  184. into the standard C~format |"/*...*/"|. At the moment, if several contiguous
  185. lines are comments, they are concatenated into one comment. You may wish to
  186. argue with this choice.
  187.  
  188. {\it The \FORTRAN-style comments are retained for compatibility with existing
  189. code. For new codes, it is recommended that one use the C-style format.}
  190.  
  191. The C-style comments actually come in two varieties:  the \It{long} kind,
  192. `{/*\dots*/}', which can be continued across newlines, and the \It{short}
  193. kind, begun by `\.{//}' and terminated by the next newline.  (The short
  194. comments must be turned on explicitly with the command-line
  195. option~`\.{-/}', as otherwise they would be understood as string
  196. concatenation.  When they are turned on, you can use~`\.{\\/}' for
  197. concatenation. 
  198.  
  199. Comments can also follow program text on a line (``trailing comments'').
  200. These must have the C~format. Thus, here are examples of comments. You
  201. should look in the source file to see exactly how these examples were done.
  202.  
  203. @a
  204.         program main    
  205. C This line began with a |'C'| in column~1.
  206.         x = y /* A trailing C~comment is delimited as shown. */
  207.         a = b
  208. C A trailing \FORTRAN\ comment; this was on the line following `|a=b;|'.
  209.  
  210. C An example of
  211. * several adjacent lines
  212. C starting with a \FORTRAN\ comment character in column~1.
  213.  
  214.         a(i,j) = 5 /* If you are writing a trailing comment and the editor
  215. breaks your line before you are done, this is what you get.  (The line is
  216. actually broken before ``breaks'' and before ``actually''.) */
  217.         end
  218.  
  219. @ In general, when in \Fortran\ mode the concept of column~6 as the
  220. continuation column is retained for compatibility with existing code. 
  221. @^continuation@>
  222. Thus, usually
  223. if any character other than~`\.{\ }' or~`\.{0} appears in column~6, the line is
  224. assumed to 
  225. be continued from the previous non-comment line. \It{Comments embedded
  226. between continuation lines will
  227. be eaten, never to be seen again!} 
  228.  
  229. An important exception is when you began a C-style trailing comment on
  230. the previous line, but it's broken by your editor and it runs over to
  231. the next line. In this case, WEB does its best to figure this out. See the
  232. example above. However, because the two styles of comments have
  233. fundamentally inconsistent syntaxes, you may someday run into trouble.
  234. If so, please report the difficulty.
  235.  
  236. Neither \Tangle\ nor \Weave\  attempts to preserve the line breaks during
  237. continuation. All adjacent continuation lines are put into one big buffer,
  238. then fed to the central processor. When \Tangle\ outputs the code, it
  239. writes it out character by character until column~72 is exceeded. Then it
  240. emits a continuation character and continues.
  241.  
  242. If tab characters are present in the input, they will be expanded into
  243. six spaces, thus ensuring that if you put a tab in column~1, your text will
  244. start in column~7. \It{At the moment, we do not support the VAX extension that
  245. one can follow a tab by a numerical continuation character.}
  246.  
  247. The following demonstrates one big bunch of continuations. 
  248.  
  249. @A
  250.         z =
  251.      *          1 +
  252. C Embedded \Fortran\ comment.
  253.      *          2 + 3 // Embedded short C~comment.
  254.      *          +4 + 5 /* Trailing long C comment. The construction was
  255. continued before~``\.{2}'' and before ``\.{+4}''. Some embedded
  256. comments were eaten. */
  257.  
  258. @ Of course, you have the full power of \TeX\ inside comments. In addition,
  259. you can also switch into code mode by enclosing (generally short) fragments
  260. of code within vertical bars. Here's an example comment. (Actually, we
  261. typed \.{"@@c zeta = alpha**beta"}. Why?)
  262.  
  263. @A
  264.  
  265. /* One can often use \TeX's math mode to advantage. For example: To compute
  266. $\zeta = \alpha^\beta$, you write in \Fortran\ |@c zeta = alpha**beta|. */
  267.  
  268. @ As usual, statement labels can be written in columns 1--5. In fact,
  269. however, you have much more freedom than that. 
  270.  
  271. First, you can optionally follow a label with a colon. \Weave\ retains that
  272. colon (if present), or puts it in for you. \Tangle\ strips it off.
  273.  
  274. Second, you can use \It{alphanumeric} labels. These \It{must} be followed
  275. by a colon. Such labels must be defined by a macro (see below) to be a
  276. standard \FORTRAN\ numeric label, or your code won't compile. However,
  277. neither \Weave\ nor \Tangle\ cares. \It{Beware: If your alphanumeric label
  278. start with a~``C'' and you start it in column~1, the line will be treated
  279. as a comment.}
  280.  
  281. Third, in fact, the label need not be in columns 1--5, because if the label
  282. follows the above rules WEB can figure out that you mean it to be a label.
  283.  
  284. Thus, here are some examples.
  285.  
  286. @M EXIT 9999 /* Alphanumeric labels must be macros that expand into numbers.
  287. Use of \FWEB's macro processor is explained later. */
  288. @M CONT #:0 /* Actually, you never have to assign a number explicitly. This
  289. construction does it for you. */
  290. @M BAD #:0
  291.  
  292. @A
  293. 1       x = y /* Numeric label in column~1. (Colon optional; wasn't typed.) */
  294. EXIT:   x = y /* Alphanumeric label in column~1. (Colon required.) */
  295.  
  296.         12345: continue /* Numeric label in the statement field. (Colon
  297.                 optional; was typed.)  */
  298.         CONT: continue /* Alphanumeric label in the statement field. (Colon
  299.                 required.) */
  300.  
  301. BAD     mess = made     /* Mistake: Alphanumeric label not followed by a colon.
  302. (But, amazingly enough, this only messes up the woven formatting; \Tangle\
  303. will do what you wanted!) */
  304.  
  305. @ In the previous examples you have already seen examples of simple
  306. statements. These statements are actually ended by a semicolon, although
  307. @^semicolons@>
  308. for the convenience of the \Fortran\ user these semicolons are not printed
  309. by default.
  310. The semicolons were not present in the source file; \Weave\ inserted then
  311. automatically. \Fortran\ always operates in this |auto_semi| mode.
  312. The semicolon is used internally by \Weave\ to indicate ends
  313. of statements, so it can do its automatic formatting. A bonus which arises
  314. from this convention is that one can now type several statements on one
  315. line, if they are separated by a semicolon. By default, they will be woven
  316. onto separate lines, although you can override this by the special
  317. command~\.{@@+}. (In all cases, \Tangle\ will write them out properly into
  318. separate  lines.) Thus, here are examples of simple expressions.
  319. @A
  320.         x = y   /* The input file contains the sequence |"\tx = y\n"|,
  321. where |'\t'| and |'\n'| stand for tab and newline, respectively. */
  322.  
  323.         a = b;  c = d /* The last two lines were created from 
  324. |"\ta = b;\n\tc = d\n"|. */ 
  325.  
  326.         a = b; @+ c = d /* Created from |"\ta = b; @@+ c = d\n"|. (The
  327. spaces before and after \.{@@+} are optional; \Weave\ inserts its own
  328. space.) */
  329.  
  330. @ The rules for recognizing identifiers are relaxed somewhat from
  331. \FORTRAN's rules, in order to expedite speedy parsing.
  332. @^identifiers@>
  333. Specifically, identifiers must start with either a letter,
  334. an underscore, a dollar sign, or (on the VAX), |'%'|; 
  335. they may also \It{contain} digits, and
  336.  they may be of arbitrary length. \It{Upper
  337. and lower case are significant.}
  338. This expedites parsing in languages other than \FORTRAN,
  339. but it means that code which weaves correctly need not compile. In general,
  340. WEB adopts the point of view that it should handle correct code correctly,
  341. but no guarantees are made about incorrect code. \It{WEB is not a compiler!}
  342.  
  343. \It{You cannot have spaces within identifiers}, with the exception of |go to|,
  344. |else if|, |end if|, and |end do|. \FORTRAN\ allows such spaces, but it
  345. doesn't seem like it's asking too much to give up this ``feature''.
  346.  
  347. Here are various identifiers. The \.{typewriter} type is used to identifier
  348. a \Fortran\ I/O~keyword, and
  349. the {\bfit boldface italic} font is used to
  350. identify intrinsic library functions.
  351. @A
  352.          num, under_score, UpPeR_and_LoWeR_case,dollar$sign,
  353.      *          a123456789, pi, %loc, NUMBER, cos, $1
  354.  
  355.         y = 5z /* Here's what happens when you forget a binary operator;
  356. the file contained |"5 z"|.
  357. The $5$~is a constant and the $z$~is an identifier. However, \Weave\ has the
  358. rule to just place two expressions side by side, so the space disappears
  359. and it looks like an invalid identifier. */
  360.  
  361. @ \Weave\ tries to make constants look more readable.
  362. @^constants@>
  363. Floating-point constants such as |"-1.23e-4"| are woven as |-1.23e-4|.
  364. Double- or quadruple-precision constants, such as |"+1.23d10"|, come out
  365. looking like |+1.23d10|. (Note that the unary plus is understood.)  If you
  366. don't like the appearance of the floating-point constants, you can change
  367. it with a \TeX\ macro; see \.{fwebmac.web}.  Complex numbers are understood
  368. perfectly well, as in |i = (0.0,1.0)|. Logical constants look like
  369. ``|.true.|'' or ``|.FALSE.|''.  Hollerith constants, such as |"4Hab;d"| are
  370. printed as |4Hab;d|. (Embedded semicolons are handled correctly.)
  371. Similarly, character constants such as |"'ab;d'"| print as |'ab;d'|. The
  372. VAX extensions of hex and octal constants are recognized properly: You type
  373. |"'123'O"| to get |'123'O|, or |"'abcde'X"| to get |'abcde'X|. However,
  374. \FWEB\ has its own way of denoting binary, octal, and hex numbers that is
  375. patterned after~C:  you can say `\.{0b10110}', `\.{077}', or `\.{0xFF}'.
  376. Again, if you don't like the formatting conventions, you can change a \TeX\
  377. macro. 
  378.  
  379. Here's  a combination of constants:
  380. @A
  381.         x = 0123 + 0xabcde + 5 + 3.14529q0 - 1.5 
  382.         l = .true. || .false. /* Here's how the logical expressions display
  383.  by default. */
  384.         c = 'abc' \/ 'def' \/ cfcn(8hargument) /* String concatenation. */
  385.  
  386. @ String constants are given special treatment by \WEAVE.
  387. On output, long strings will
  388. be broken in essentially the same way as \TeX\ hyphenates words (with the
  389. hyphen replaced by a backslash). Long strings will be broken after commas,
  390. or every so many characters.
  391. @A
  392.         xchr = "                                 !""#$%&'()*+,-./012345
  393.      #6789:;<=>?@@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]
  394.      #^_`abcdefghijklmnopqrstuvwxyz{|}~ "
  395.  
  396. @ WEB understands certain things about arrays. It can certainly understand
  397. simple array references such as |a(i,j)|. It understands the colon
  398. construction in dimension statements: |dimension a(0:100)|. Furthermore, it
  399. understands the  constructions associated with character
  400. substrings, such as |c(:5)| or |c(5:)| or |c(:)|. It also understands the
  401. |character| declaration with unspecified length. (However, it is not smart
  402. enough to replace parentheses in array references by square brackets.)
  403. @a
  404.         function f(c,d)
  405.         character*(*) c
  406.         character*10 d
  407.  
  408.         dimension a(0:1,-5:5),b(0:9)
  409.         equivalence (a(0,0),b(0))
  410.  
  411.         d(2:4) = c(:3)
  412.  
  413.         end
  414.  
  415.  
  416. @ \Weave\ attempts to pretty-up the output by converting anachronistic
  417. constructions such as `\.{.le.}' to more familiar mathematical expressions. It
  418. also allows you to type stuff in in a prettier way.
  419. @^beauty@>
  420. Thus, in the following list, you can type the stuff in the parentheses
  421. instead of the first item. \Weave\ will give you the stuff following~$\to$;
  422. \Tangle\ will convert the prettier input format into the standard \Fortran\
  423. construction in the first column.
  424. $$
  425. \def\i(#1,#2){{\tt #1} \def\temp{#2}\ifx\temp\empty\else({\tt #2})\fi}
  426. \vbox{\halign{#\hfil&$\to \hbox{#}$\hfil\cr
  427. \i(.lt.,<) & |.lt.|\cr
  428. \i(.le.,<=) & |.le.|\cr
  429. \i(.eq.,==) & |.eq.|\cr
  430. \i(.ne.,!=) & |.ne.|\cr
  431. \i(.gt.,>) & |.gt.|\cr
  432. \i(.ge.,>=) & |.ge.|\cr
  433. \i(.and.,\amp\amp) & |.and.|\cr
  434. \i(.or.,\vertbar\vertbar) & |.or.|\cr
  435. \i(.neqv.,) & |.neqv.|\cr
  436. \i(.xor.,) & |.xor.|\cr
  437. \i(.eqv.,) & |.eqv.|\cr
  438. \i(.not.,!) & |.not.|\cr
  439. \noalign{\smallskip}
  440. \i(**,\^) & \.{(a+b)\^(c+d)} $\to (a+b)^{c+d}$\cr
  441. \i(//,\BS/) & |\/|\cr
  442. }}$$
  443. As an example,
  444. @A
  445.         if( (x.le.y) && (!computing) ) z = x**y - y^x /* We typed 
  446.                                 `|@cx**y - y@t\^@>x|'. */
  447.         if( x < y || !(x >= y) .and. (c.eqv.d)) c = a\/b
  448.  
  449. @ You've already seen many examples of the standard assignment statement 
  450. |x = y|. Here are further examples from the VAX manual, which also demonstrate
  451. various stuff about strings and arrays. The very last statement also
  452. demonstrates just how ignorant \Weave\ really is.
  453. @A
  454.         file = 'prog2'
  455.         revol(1) = 'mar'\/'cia'
  456.         loca(3:8) = 'plant5'
  457.         text(i,j+1)(2:n-1) = name\/x
  458.  
  459.         assign 99999 to kstop
  460.         assign 88888 undivert kstop /* |undivert| is a built-in
  461. function in M4; |to| and |then| are also given |built_in| ilk. */
  462.  
  463. @ We have the various types of |goto|'s. (Note that WEB understands both
  464. |goto| and |go to|.) 
  465. @^goto@>
  466. @m MGOTO 1000
  467. @A
  468.         goto 10 /* Unconditional. */
  469.         go to (12,24,36), indx  /* Computed. */
  470.         goto ibeg, (300,340,MGOTO, 25) /* Assigned. */
  471.  
  472. @ The formatting powers of \Weave\ really come into play with block
  473. structure; it will automatically indent blocks for you. 
  474.  
  475. Since \Weave\ understands the block structure, it can help you out by
  476. telling you which ends go with which beginnings, by inserting numbered
  477. comments.  (This feature can be turned on with the command-line option
  478. \.{-b}.)
  479.  
  480. Here are the various |if| statements.  (Note that WEB understands both
  481. |elseif| and |else if|, and both |endif| and |end if|.) You may be annoyed
  482. or puzzled by the appearance of a semicolon after |then| and |else| in the
  483. |if|-|then|-|else| construction. The point is that \Fortran\ also marks
  484. those statements specially, namely by a newline. Since \Weave\ operates
  485. internally in a free-form syntax, it replaces the newlines by semicolons,
  486. consistent with~C and \Ratfor. On printout, it would be possible to strip
  487. them off, but that would be logically inconsistent with showing you what
  488. you would have to type if you were supplying the semicolons yourself.  Of
  489. course, \Tangle\ throws away the semicolons. (Actually, it uses them as
  490. sentinels to say when to emit a newline.)
  491.  
  492. @A
  493.         if(expr) 10,20,30       /* Forget this statement for modern codes. */
  494.         
  495.         if( j.gt.4 .or. j.lt.1) goto 250
  496.  
  497. /* An example from the VAX manual. */
  498.         if(a>b) then 
  499.         d = b
  500.         f = a - b
  501.         else if (a .gt. c) then
  502.         d = c
  503.         f = a - c
  504.         else
  505.         d = 0.0
  506.         f = a
  507.         end if
  508.  
  509. /* A further example demonstrating nesting. (The blank lines
  510. surrounding the inner block were put in by the user.) This C-style
  511.  comment started in column~1. */
  512.         if(a.lt.100) then
  513.                 inran = inran + 1
  514.  
  515.                 if(abs(a-avg) .le. 5.0) then
  516.                         inavg = inavg + 1
  517.                 else
  518.                         outavg = outavg + 1
  519.                 end if
  520.  
  521.         else
  522.                 outran = outran + 1
  523.         end if
  524.  
  525. @ Loops are easy when the |do|\dots|enddo| construction is followed. 
  526. Statement labels are also handled correctly.
  527. @^loops@>
  528. @^labels@>
  529.  
  530. Note the semicolons ending the |do|s. See the previous module for discussion.
  531.  
  532. Note that unlabeled \&{do}s are a VAX extension. \Tangle\ will
  533. convert them into conventional loops with statement labels if you use the
  534. `\.{-d}'~option.
  535. @A
  536.         do n = 5,40,4 
  537.                 a(n) = n
  538.  
  539.                 do m = -1,1
  540.                         a(m) = m
  541.                 enddo
  542.         enddo
  543.  
  544.         do 100 k = 1,50,2
  545.                 b(k) = k**5
  546.  
  547.                 do 101 j = 5,0
  548.                         dummy
  549. 101             continue /* Compare the source file with the output here,
  550. noting the position of the statement label. */
  551. 100     continue
  552.  
  553. /* Multiple loops ending on the same statement are indented correctly. */
  554.         do 10 i= 1,2
  555.         do 10 j = -5,5,2
  556. 10      c(i,j) = 0.0
  557.  
  558.         do while(line(i:i) .eq.' ')
  559.                 i = i + 1
  560.         end do
  561.  
  562. @ WEB has a rudimentary knowledge of program structure. 
  563. @^program structure@>
  564. It assumes that
  565. specification statements such as |dimension| come before executable
  566. statements. (|namelist| is treated as a specification statement; |data|
  567. and |@r include|
  568. statements can be interspersed with executable statements.)
  569. It will automatically separate the two sets of statements by a
  570. blank line. It also is able to use the |end| statement to figure out
  571. where the function ends, and attempts to highlight the function by
  572. backspacing the first and the last statements of the function. (This means
  573. that your main program will look funny unless you use the \&{program}
  574. statement, which is recommended anyway.
  575.  
  576. @a
  577.         program  main  /* Backspaced means that \WEAVE\ understood the
  578. syntax of a complete program unit. */
  579.         integer i,j
  580.         real a(0:100)
  581.         x = y /* No blank line was put in the file here, although it would
  582. be reasonable to do that to make your source more readable. */
  583.         data pi/-3.14159/ /* $\pi$?? */
  584.         pi = -pi        
  585.         end
  586.  
  587. @ Sometimes the first line of the function may not be backspaced as you
  588. expect. This means that there's something syntactically wrong within the
  589. function (or there's a bug in \Weave). You should look through the function
  590. for unusual formatting, such as unwanted spaces. Near there is where the
  591. error probably is. For example, the following example differs by only one
  592. character from the previous one. 
  593. @a
  594.         program  main /* Not backspaced means that \WEAVE\ got confused
  595. somewhere below. */
  596.         integer i,j
  597.         real a(0:100)
  598.         x = y+  /* Check out this line carefully. */
  599.         end
  600.  
  601. @ Of course, we also have the miscellany of |call|, |return|, etc.
  602. @a
  603.         program main
  604.         call graph(5.0,*10,*20) /* Statement label returns. */
  605.         stop 'We''re done'
  606.         end
  607.         subroutine s(x,*,*)
  608.         real x
  609.         call curve(-1.0)
  610.         pause 'Do you know what you''re doing?'
  611.         return 1
  612.         end
  613.  
  614. @ WEB understands the following fundamental data types: |integer|, |real|,
  615. |double precision|, |complex|, |double complex|, |logical|, and
  616. |character|.
  617. @^data types@>
  618. (Not being a compiler,
  619. it will also happily process more bizarre types such as
  620. |complex logical double|.)
  621. Any of these can be suffixed by a length specifier---for
  622. example, |real*8|. WEB doesn't care if you specify a crazy specifier, such
  623. as |real*77|.
  624.  
  625.  
  626. In detail, here's how all the specification statements look. 
  627. @^statements, specification@>
  628. Here, the
  629. blank lines are inserted explicitly to make the grouping more apparent. 
  630. @a
  631.         program main
  632.  
  633.         parameter(NN=100, M = 50)
  634.  
  635.         implicit real*8 (a-h,o-z) /* You might quibble with the
  636.                                         typesetting here. */
  637.         implicit none
  638.         implicit double precision(d), complex(x,y), character*32 (t-v)
  639.  
  640.         integer i,matrix(4,4),sum
  641.  
  642.         real a(0:100),b(-n:n,0:UPPER)
  643.         real*8 pi/3.14159/, array(10)/5*0.0,5*1.0/
  644.  
  645.         logical lswitch
  646.  
  647.         character*(4+LENGTH) last,letter(26)
  648.         character bubble*(*)
  649.         character*32 socsec(100)*9, namety*10/'abcdefghij'/
  650.  
  651.         dimension a1(n1:n2), a2(n3:*), mark(4,4,4,4)
  652.  
  653.         common heat,x /blk1/kilo,q
  654.  
  655.         equivalence (a,b(1)), (table(2,2),triple(1,2,2)), (name(10:13),kd(2:5))
  656.     
  657.         external f1,f2,f3
  658.         intrinsic sin,cos /* The names of intrinsic functions are
  659. understood. */
  660.  
  661.         data a,starts/10*0,'****'/, bell,tab,lf,ff /7,9,10,12/ /* |data|
  662. statements may be interspersed with executable statements. */
  663.         include "more.for" /* This VAX extension has now become a
  664. \Fortran-90 keyword. It can be put anywhere. */
  665.         save a,/blk1/
  666.         namelist/input/name,grade,stuff/output/total,name /* At the moment,
  667. |namelist| statements are considered to be type specification statements. */
  668.  
  669.         end
  670.  
  671.         block data blkdat /* An example from the VAX manual. */
  672.         integer s,x
  673.         logical t,w
  674.         double precision u
  675.         dimension r(3)
  676.         common/area1/r,s,t,u /area2/w,x,y
  677.         data r/1.0,2*2.0/,t/.false./,u/0.21453d-7/, w/.true./, y/3.5/
  678.  
  679.         end
  680.         
  681. @ Subroutines are fairly straightforward, except one must allow for passing
  682. of statement labels. One embellishment is that intrinsic library functions
  683. are displayed in {\bfit boldface italic}.
  684. @^functions, intrinsic@>
  685. (This is true only
  686. if they're in lower case. This allows one to use uppercase for macro names.
  687. The one exception to this is |Real|. Distinguish this intrinsic function
  688. from the type specification |real|.)
  689. @a
  690.  
  691.         subroutine sub(a,*,n,*)
  692.         sinh(x) = 0.5*(exp(x) - exp(-x)) /* A statement function which
  693. redefines an intrinsic function. */
  694.  
  695.         call sub(%val(i),*,Real(10),*) /* Note that we handle the VAX extension
  696.                                         |'%'|. */
  697.         end
  698.  
  699.         real function f()
  700.         return
  701.         end
  702.  
  703.         character*10 function char()
  704.         return
  705.         end
  706.  
  707.         subroutine s(y)
  708.  
  709.         x = y
  710.         entry s1(z) /* The |entry| statement is backspaced, with a blank
  711. line preceding it. */
  712.  
  713.         x = z
  714.  
  715.         return
  716.         end
  717.  
  718. @ The most annoying thing about input/output is the |format| statement. 
  719. @^format@>
  720. The
  721. innards really ought to be a character variable interpreted at run time. As
  722. it is, the innards must be treated specially so they will look sensible.
  723.  
  724. For the I/O statements, keywords such as |"UNIT"| are typeset specially if
  725. they're in upper case.
  726.  
  727. @f namelist common
  728.  
  729. @a
  730.         program test
  731.         namelist/control/ title,reset
  732.  
  733.         read(8,end=550) (matrix(k),k=1,100) /* Handles |end| as a keyword. */
  734.         write(6,50,err=390) var1,var2,var3
  735.  
  736.         read(1,1250) j,k,array(j,k)
  737. 1250    format(i1,1x,i1,1x,4e6.2) /* Note that it didn't write |@e4e6.2|. */
  738.  
  739. 2       format(' k =',f5.2,:,' x =',3e10.5) /* Note that the colon usage is
  740. handled correctly. */
  741. 3       FORMAT(' k =',f5.2,:,' x =',3e10.5) /* Reserved words must be in
  742. lower case; here's what you get when \Weave\ doesn't understand it's a 
  743. |format| statement. */
  744.  
  745.         write(1,*) a,b,'Hello'
  746.         write(4)
  747.  
  748.         read(UNIT=1,NML=control)
  749.  
  750.         accept a,b,c
  751.         type *,i,j,k
  752.         print 100 i,j,k /* It understands this format both with and without
  753. a comma following the format number. */
  754.  
  755.         call open(UNIT=1,STATUS='new',DISP='submit'\/qual) /*  It
  756. handles the case where |open| is treated as a subroutine rather than as a
  757. reserved word of the language. */
  758.         close(UNIT=j,STATUS='delete',ERR=99)
  759.         inquire(FILE=f,ACCESS=acc)
  760.         rewind 10
  761.         backspace(15,ERR=9999,IOSTAT=io)
  762.         endfile 2
  763.  
  764.         end
  765.  
  766. @ If you specify the ``\.{-m4}'' option on the command line, WEB will
  767. understand the built-in functions of the M4 macro preprocessor, and
  768. \Tangle\  will change the extension of the output file from ``\.{.for}'' to
  769. ``\.{.n4}. (The extension ``\.{.m4}'' is reserved for output from the
  770. \Ratfor\ language.)
  771. Here are samples of those words. Note that, for simplicity at
  772. this point, many of the arguments have just been interpreted as character
  773. strings. (Also note that \FWEB's built-in macro preprocessor supercedes
  774. \.{m4}.) 
  775. @<R@>=
  776.         changequote([,]); /* Only brackets are guaranteed to work correctly
  777. with \&{changequote}, as far as formatting with \WEAVE\ is concerned. */
  778.         define(ARGS,[a,b,c])dnl;
  779.         divert(5);
  780.         dumpdef([ARGS],[YES]);
  781.         errprint("help");
  782.         eval(2**n + 1);
  783.         ifdef([unix],[define(wordsize,16)]);
  784.         ifelse(divnum,5,z = 5.0,z = punt); /* It's too complicated
  785. to format this; we just treat everything as a string. */
  786.         include(filename);
  787.         define(n1,[incr(n)]);
  788.         index(string1,string2);
  789.         len((a,b));
  790.         maketemp(XXXXX);
  791.         sinclude(silent.file);
  792.         substr(abcdef,i,5);
  793.         syscmd(date);
  794.         translit(s,aeiou,12345);
  795.         undefine(TEST);
  796.         
  797.  
  798. @ WEB contains a powerful, \C-like macro processor. 
  799. @^macros@>
  800. If you are a \Fortran\ user not used to macros, the use of macros
  801. is somewhat analogous to the |parameter| statement, but is more
  802. flexible. Macros are expanded by \Tangle\ when it creates the \.{.for}
  803. file, and are global to the entire source; they may have arguments. The
  804. |parameter| statement, by contrast, 
  805. is local to a program unit, and arguments are not
  806. allowed. Macros can be defined from the command line. If you want to define
  807. a lower-case macro with no replacement text, just say
  808. `\hbox{\.{-mlower\_case\_macro}}'. Otherwise (if the macro has upper-case
  809. characters in it and/or if there is replacement text), say
  810. `\.{-m"CMD\_LN\_MACRO\ 25"}'. 
  811.  
  812. Here is an example of the use of WEB macros. (Note that macro definitions
  813. come \It{before} the code section.)
  814.  
  815. @M N 100
  816. @M MM(lower,upper) ((upper) - (lower) + 1)
  817. @M DONE #:0
  818.  
  819. @a
  820.         program main
  821.         integer n
  822.         real A(MM(-1,5)) /* \Tangle\ will expand this into ``\.{real
  823. A(((5)-(-1)+1));}'' */
  824.  
  825.         n = N /* Expands into ``\.{n = 100;}''. Note that case is
  826. significant for macros. */
  827.  
  828.         if(n > 1000) goto DONE /* You can make your code look more
  829. readable by using macros for statement labels. */
  830.  
  831.         DONE: stop
  832.         end
  833.  
  834. @ In fact, there are two kinds of macros: the \.{@@m} kind, which refer to
  835. internal WEB macros and which are used to expand identifiers during
  836. tangling; and the \.{@@d} kind (called ``outer'' macros).  @^macros@>
  837. \Tangle\ does not expand them; it merely copies the latter to the beginning
  838. of the output file, preceded by the identifier \&{define}. \It{(However, if
  839. the outer macro contains a WEB macro identifier, that will be expanded.)}
  840. For \Fortran, The intent is that you might wish to run the M4 preprocessor.
  841. Of course, the \.{@@d} macros should have the proper syntax for the
  842. preprocessor you intend to use. They are most useful for~C, which has its
  843. own built-in preprocessor.
  844.  
  845. @d (YES,1)
  846. @d (TEST,[$1+$2,$3]) /* An example of an M4 macro with arguments. */
  847. @d (OUTER_FLAG,MFLAG(1,2)) /* This contains a WEB macro. Look at the
  848. \TANGLE d output to see how |OUTER_FLAG| will be defined. */
  849.  
  850. @M MFLAG(arg1,arg2) ((arg2)-(arg1)) /* A WEB macro with arguments. */
  851.  
  852. @i macros.hweb /* The more complete macro demo. */
  853.  
  854. @ In addition to WEB macros, there is a useful preprocessing language,
  855. consisting of the commands `\.{@@\#ifdef}', `\.{@@\#ifndef}',
  856. `\.{@@\#undef}', `\.{@@\#if}', 
  857. `\.{@@\#elif}', `\.{@@\#else}', and \.{@@\#endif}'. 
  858. @^preprocessing@>
  859. These commands may
  860. appear either in the definition section or in code mode; they must begin in
  861. column~1. You can use them 
  862. to conditionally define macros or include text, to comment out code, etc.
  863. See the user manual for more discussion.
  864. Here's an simple example that does something only if you defined the macro
  865. |CMD_LN_MACRO| from the command line.
  866.  
  867. @A
  868. @#ifdef CMD_LN_MACRO /* Define this from command line. */
  869.         write(6,200) CMD_LN_MACRO
  870. @#endif
  871.  
  872. @ Sometimes you introduce a new identifier that ought to be formatted in
  873. the same way as identifiers which \Weave\ already knows. For example,
  874. although \Weave\ understands that |tanh| is an intrinsic function, it's
  875. never heard of \\{atanh}. You can use the \.{@@f}~command 
  876. to tell \Weave\ what to do. 
  877. @^formatting@>
  878.  
  879. Note that \Weave\ uses two passes to do its work; it does the
  880. cross-referencing and formatting on the first pass, then does the
  881. typesetting on the second pass. Thus, all occurences of an identifier in
  882. the code will be formatted the same way, and you don't need to format
  883. something before you use it.
  884.  
  885. @f atanh tanh
  886.  
  887. @A
  888.         z = atanh(z)
  889.  
  890. @ The formatting mechanism could be used to handle an annoying situation.
  891. \Fortran\ 
  892. uses |real| for two entirely different purposes: as a type specification,
  893. and as an intrinsic function. \Weave\ only understands it as a type
  894. specification, but you could use a macro to achieve your goal:
  895. @f areal aimag
  896. @M areal real
  897. @A
  898.         real x
  899.         x = areal(y)
  900.  
  901. @ Actually, the previous example need not be used in practice, because
  902. \Weave\ has been told to
  903. understand as a special case the intrinsic function |Real|. (This violates
  904. none of 
  905. \Fortran's rules, since \Fortran\ is case-insensitive.)
  906. Thus, you can say, with neither formatting nor macros,
  907. @A
  908.         real x
  909.         x = Real(y)
  910.  
  911. @ Module names may be formatted. This gets around the annoyance that named
  912. modules that are intended to play the role of type specifications won't be
  913. understood otherwise; by default, module names are expressions, not type
  914. specifications. Thus, you should say something like this:
  915.  
  916. @f @<Common blocks@> common
  917.  
  918. @a
  919.         subroutine dummy
  920.         @<Com...@>
  921.         integer k
  922.         executable = stuff
  923.         end
  924.  
  925.  /* If you don't format the module name, you get this: */
  926.         subroutine dummy
  927.         @<Other common blocks@>
  928.         integer k
  929.         executable = stuff
  930.         end
  931.  
  932. @ The next two modules are included to avoid warning messages about missing
  933. modules. 
  934. @<Com...@>=
  935.  
  936. @
  937. @<Other ...@>=
  938.  
  939. @ The following tests the metacomment feature. 
  940. @^metacomment@>
  941. Text which is to be
  942. commented out but included in the tangled output
  943. can be bracketed by \.{@@(} and \.{@@)};
  944. \Tangle\ will put comment characters in column~1 of the bracketed lines.
  945. (In the source file, the metacomment commands should begin in column~1.)
  946. This feature is no longer very useful with the advent of the preprocessor
  947. language. In general, you should use \.{@@\#if(0)...@@\#endif} to comment
  948. out code. The latter produces nothing in the tangled output, while
  949. metacomments do.
  950.  
  951. @A
  952. @(
  953.         a = b
  954.         c = d
  955. @)
  956. @#if(0)
  957.         y = z
  958. @#endif
  959.  
  960. @ WEB understands~\C, \Ratfor, and \Fortran\ syntax. There are several ways
  961. of switching languages. 
  962. @^languages@>
  963.  
  964. First, there is a global language. This is the language which is in effect
  965. at the beginning, \TeX\ part of each module and which is the initial
  966. language of the unnamed module. By default, the global language is
  967. |FORTRAN|. The global language may be set on the command line by the
  968. options \.{-c}, \.{-r}, or~\.{-n}. (Note that we use the \It{last} letter
  969. of the language name as the abbreviation.) It may also be set by any
  970. \.{@@c}, \.{@@r}, or \.{@@n} command (collectively called the language
  971. commands) 
  972. issued in limbo (before the start of
  973. the first module). Placing a command in limbo is the recommended way of
  974. setting the global language.
  975.  
  976. You can also change the language locally at any time by issuing a language
  977. command. If you issue such a command within vertical bars, the command is
  978. localized to the barred region. Thus, the global language for this demo is
  979. \Fortran. However, we can talk about the keyword |@c struct|, which is
  980. known only to~\C, by saying |"|@@c struct|"|.
  981.  
  982. Named modules inherit the language in effect at the time they were first
  983. referenced. The natural way to do this is to change languages in the
  984. unnamed module. Thus, just before the reference \.{@@<Ccode@@>} in the
  985. first unnamed module above, we have a (nonprinting) language \.{@@c}. You
  986. will note that the name of that module is properly superscripted with
  987. a~`C'. Without further ado (and without issuing any other language
  988. command), you can define the named module \.{@@<Ccode@@>} as always, and
  989. WEB will know that it is to be interpreted in the C~language. Furthermore,
  990. any named modules which are referenced by this module will also be assumed
  991. to be in~C. Here is an example of this, which also tests some features
  992. of~C.
  993.  
  994. @<Ccode@>=
  995.  
  996. #include <stdio.h>
  997.  
  998. main(int num_args,char *args[]) 
  999. {
  1000. typedef struct
  1001.         {
  1002.         int i;
  1003.         float f;
  1004.         } TEST;
  1005.  
  1006. TEST *p,*f(int i,struct s S,...); 
  1007. void g(void);
  1008.  
  1009. p = pp + &ppp; /* Address operator. */
  1010.  
  1011. if(hungry) @<Test C block@>@; /* Note that you must use a \It{pseudo-semi}
  1012. (`\.{@@;}') here, because the code that will be substituted for the block
  1013. is already a complete statement and you don't want an extra semicolon to
  1014. appear before the |else|. */
  1015. else have_dessert;
  1016. }
  1017.  
  1018. @ Test of a named C module.
  1019. @<Test C block@>=
  1020. p = (TEST *)malloc(1000);       /* Illustrates typesetting the cast
  1021. operation. */ 
  1022.  
  1023. /* Following is the toughest loop to get right.*/
  1024. if(x)
  1025.         if(y) z;
  1026.         else w;
  1027. else 
  1028.         if(w) {}
  1029.         else done;
  1030.  
  1031. for(i=0; i<5; i++)
  1032.         for(j *= 10; j<100; j/=5)
  1033.                 a(i,j) = i % j;
  1034.  
  1035. if(x|w) y; /* Bit-wise \.{or}. */
  1036.  
  1037. if(x&w) z; /* Bit-wise \.{and}. */
  1038. else if(x) y;
  1039. else if(x) z;
  1040. else z;
  1041.  
  1042. do
  1043.         {
  1044.         x = y;
  1045.         }
  1046. while(1);
  1047.  
  1048. @ There are separate input drivers for~C, \Fortran, and~\Ratfor. The
  1049. C~driver assumes completely free-form syntax. \Fortran\ assumes the
  1050. opposite extreme of column-oriented syntax. \Ratfor\ has two syntax modes.
  1051. By default, it is entirely free-form, just like~C. In this mode, the user
  1052. must insert semicolons to end statements. In the auto-semi mode, introduced
  1053. by the command-line option `\.{-;}', the syntax
  1054. is intermediate: it is
  1055. free-form syntax in that columns have no meaning; however, newlines end the
  1056. line except when the statement is ``obviously'' continued---when it ends in
  1057. things like plus or underscore (if the underscore isn't obviously part of
  1058. an identifier). For example, here is a \Ratfor\ module
  1059. which contains several continued lines.
  1060. @<R@>=
  1061. x =
  1062. a +
  1063. b _
  1064. - c; /* Continued after \.{+} and |b|. */
  1065.  
  1066. @ The form of a \Ratfor\ function is \C-like, with braces
  1067. enclosing the body of the function.
  1068. (\Ratfor\ just throws away the braces,
  1069. but they're useful for helping \Weave\ to typeset things in a pretty way.
  1070. However, you won't get garbage if you omit them.) It is conventional to
  1071. list declarations of function arguments before the braces, and other
  1072. declarations after them, just as one does in~C.
  1073. @<R@>=
  1074. function f(x)
  1075.         real x;
  1076. {
  1077. integer k;
  1078. real a(0:9);
  1079.  
  1080. do k=0,9;
  1081.         a(k) = Real(k); /* Use of intrinsic function. */
  1082.  
  1083. if(x)
  1084.         if(y)
  1085.                 {z;}
  1086.         else w;
  1087. else
  1088.         if(y) z;
  1089.         else if(z) w;
  1090.  
  1091. if(x) a;
  1092. else if(x) b;
  1093. else if(x) c;
  1094. else done;
  1095.  
  1096. while(j < k)
  1097.         {
  1098.         j = j + 1;
  1099.         }
  1100.  
  1101. for(i=1; i<5; i=i+1)
  1102. for(j=0; j>0; j=0)
  1103.         a(i,j) = pi;
  1104.  
  1105. repeat
  1106.         {
  1107.         if(i > 10) break;
  1108.         }
  1109.  
  1110. repeat
  1111.         {
  1112.         if(happy) next;
  1113.         }
  1114. until(tired);
  1115.                 
  1116.  
  1117. return;
  1118. }
  1119.  
  1120. @ In the previous examples, the user supplied the semicolons. This is the
  1121. preferred input mode, and using it may speed up the processing of your
  1122. file. \Ratfor\ just throws away the semicolons.
  1123. However, for compatibility with existing code, there is an automatic
  1124. semicolon mode, which supplies the semicolons for you. You turn this on by
  1125. saying \.{-s} on the command line. (Presently, the \Weave\ output from this
  1126. mode is not perfect, but it almost always will do what you want.)
  1127.  
  1128. As we stated previously, \Fortran\ is always in the automatic semi mode.
  1129.  
  1130. @ WEB supports the notion of a change file. 
  1131. @^change file@>
  1132. See the user manual for
  1133. complete details. Here we test the use of the change file `\.{demo.ch}'.
  1134. Any lines in the source file may be changed; they don't need to be code.
  1135. GARBAGE GARBAGE GARBAGE
  1136.  
  1137. @A
  1138.         aaa = bbb
  1139.         ccc = ddd
  1140.         
  1141. @* INDEX.
  1142.