home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume23 / lome / part08 < prev    next >
Encoding:
Internet Message Format  |  1991-01-08  |  48.1 KB

  1. Path: j.cc.purdue.edu!mentor.cc.purdue.edu!purdue!bu.edu!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!wuarchive!uunet!papaya.bbn.com!rsalz
  2. From: rsalz@bbn.com (Rich Salz)
  3. Newsgroups: comp.sources.unix
  4. Subject: v23i058:  Line oriented macro processor, Part08/09
  5. Message-ID: <3033@litchi.bbn.com>
  6. Date: 29 Nov 90 17:44:59 GMT
  7. Organization: BBN Systems and Technologies, Cambridge MA
  8. Lines: 1045
  9. Approved: rsalz@uunet.UU.NET
  10.  
  11. Submitted-by: Darren New <new@ee.udel.edu>
  12. Posting-number: Volume 23, Issue 58
  13. Archive-name: lome/part08
  14.  
  15. [ NOTES!  The archive-names don't match with the archive-parts listed in
  16.   the shar files.  Don't panic. :-)  --r$ ]
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 9 (of 9)."
  25. # Contents:  LOME/LOME.doc
  26. # Wrapped by new@estelle.ee.udel.edu on Tue Aug 14 16:10:04 1990
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'LOME/LOME.doc' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'LOME/LOME.doc'\"
  30. else
  31. echo shar: Extracting \"'LOME/LOME.doc'\" \(46006 characters\)
  32. sed "s/^X//" >'LOME/LOME.doc' <<'END_OF_FILE'
  33. X
  34. X
  35. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  36. X
  37. X
  38. X              This documentation and all accompanying files
  39. X                        Copyright 1990 Darren New.
  40. X                           All Rights Reserved.
  41. X                 See README for distribution conditions.
  42. X  
  43. X  
  44. X  LOME (Line Oriented Macro Expander) is a relatively sophiticated macro
  45. X  expander. It is designed to be compiled by Comp1 or interpreted by
  46. X  Interp, and as such is very portable. The syntax and semantics are
  47. X  described herein.
  48. X  
  49. X  A second version of LOME, for those with PPL, is available. This
  50. X  version is written in C but otherwise behaves like the version in SCM.
  51. X  This version is also somewhat more flexible internally, allowing
  52. X  expansion of the macro list during execution and so forth.
  53. X  
  54. X  A LOME program consists of two files. The first file is the macro
  55. X  definition file. This file defines the translation between lines in
  56. X  the source file(s) and lines in the output file(s). The source file
  57. X  contains text which is matched against the macros, with each matching
  58. X  line being replaced by the body of the macro with certain parameters
  59. X  begin replaced. Each so-expanded line is then matched again against
  60. X  the macros until no more matches can be performed, at which point the
  61. X  lines are output to the output file. Text in the bodies of the macros
  62. X  can redirect input from and output to various files, allowing multiple
  63. X  source or output files.
  64. X  
  65. X  The LOME macro definition file (MDF) consists of a sequence of
  66. X  arbitrary non-blank lines serving as comments, a single blank line, a
  67. X  parameter line, and then a sequence of macro definitions. Each macro
  68. X  definition consists of a header line to be matched against a source
  69. X  line, followed by a set of lines known as the macro body. Each macro
  70. X  definition (including the final one) is terminated by a line starting
  71. X  with two BEOL characters (see below). The overall sequence of macro
  72. X  definitions is termated by an end-of-file condition. Each macro header
  73. X  line may be preceeded by any number of empty lines (not even
  74. X  containing a HEOL). Each macro body contains mixtures of literal text
  75. X  and specially-flagged escape sequences. The escape sequences can be
  76. X  classified into one of three groups: parameter operations, which
  77. X  affect individual parameters matched in the macro header; file
  78. X  operations, which manipulate files; and control operations, which do
  79. X  things which would be difficult to specify as macro-expansion
  80. X  operations.
  81. X  
  82. X  The parameter line contains characters which serve two purposes. The
  83. X  initial portion allows LOME to be independant of the character set of
  84. X  the machine it is running on by specifying all characters which LOME
  85. X  must treat specially. The final portion contains a series of boolean
  86. X  flags, specifying which minor modifications in the operation of LOME
  87. X  should be made. The characters on the parameter line, along with the
  88. X  recommended setting (Rcmd), are specified below.
  89. X  
  90. X
  91. X
  92. X
  93. X
  94. X      Page 1                                Printed Tue Aug 14, 1990    
  95. X
  96. X
  97. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  98. X
  99. X
  100. X  Offset  Rcmd    Meaning
  101. X    0      \      The escape character (ESC), which negates the
  102. X                  speciality of the following character.
  103. X  
  104. X    1      @      The placeholder character (PHC), which indicates where
  105. X                  in a macro header line a parameter match should be
  106. X                  attempted.
  107. X  
  108. X    2      .      The header end-of-line (HEOL), which indicates the end
  109. X                  of a meaningful source line and which can be followed
  110. X                  by a comment on the same line.
  111. X  
  112. X    3      @      The substitution character (SUBS), which indicates in
  113. X                  the macro body that this and the following two
  114. X                  characters are to cause a special action such as
  115. X                  rewinding a file or substituting the value of a
  116. X                  parameter for this three-character sequence.
  117. X  
  118. X    4      $      Body end-of-line character (BEOL), which indicated the
  119. X                  end of a meaningful macro body line and which can be
  120. X                  followed by a comment on the same line.
  121. X  
  122. X    5      0      The digit zero (ZERO). Character inputted from or
  123. X                  outputted to the I/O routines are assumed to map the
  124. X                  numerals from zero through nine to ten contiguous
  125. X                  numbers with zero as the lowest-numbered numeral.
  126. X  
  127. X    6      A      First upper-case letter (UCA). See next entry.
  128. X  
  129. X    7      a      First lower-case letter (LCA). The I/O routines are
  130. X                  assumed to map upper- and lower-case letters such that
  131. X                  the difference between 'A' and any upper-case letter
  132. X                  is the same as the difference between 'a' and the
  133. X                  corresponding lower-case letter. In addition, 'A' must
  134. X                  map to the lowest-numbered upper-case letter and 'a'
  135. X                  must map to the lowest-numbered lower-case letter.
  136. X  
  137. X    8      Z      Last upper-case letter (UCZ). See above.
  138. X  
  139. X    9      F      File operation character (FILEOP). See below.
  140. X  
  141. X   10      C      Control operation character (CTRLOP). See below.
  142. X  
  143. X   11      `      Open quote (OQ). Used in "balanced" parameter
  144. X                  matching.
  145. X  
  146. X   12      '      Close quote (CQ). Used in "balanced" parameter
  147. X                  matching.
  148. X  
  149. X   13      (      Open parenthesis (OP). Used in mathematical evaluation
  150. X                  and in "balanced" parameter matching.
  151. X  
  152. X   14      )      Close parentheses (CP). Used in mathematical
  153. X                  evaluation and in "balanced" parameter matching.
  154. X
  155. X
  156. X      Page 2                                Printed Tue Aug 14, 1990    
  157. X
  158. X
  159. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  160. X
  161. X
  162. X  
  163. X   15      +      Plus sign (PLUS). Used in mathematical evaluation.
  164. X  
  165. X   16      -      Minus sign (MINUS). Used in mathematical evaluation.
  166. X  
  167. X   17      *      Multiplication sign (MULT). Used in mathematical
  168. X                  evaluation.
  169. X  
  170. X   18      /      Division sign (DIV). Used in mathematical evaluation.
  171. X  
  172. X   19      ?      The "fetch" character (FETCH). Used in mathematical
  173. X                  evaluation.
  174. X  
  175. X   20      !      The "radix" character (RADIX). Used in mathematical
  176. X                  evaluation.
  177. X  
  178. X   21      X      Reserved.
  179. X  
  180. X   22      X      Reserved.
  181. X  
  182. X   24      X      Reserved.
  183. X  
  184. X   25      X      Reserved.
  185. X  
  186. X   26             Space character (SPACE). Used in stripping lines and
  187. X                  so on.
  188. X  
  189. X   27      0      Case specific flag (FCASE): zero to match macro
  190. X                  headers and do skip comparisons regardless of case,
  191. X                  one for case-specific matching and comparing.
  192. X  
  193. X   28      1      Blank output line flag (FBLANK): one to allow blank
  194. X                  (empty) lines in the macro body to be matched and
  195. X                  outputted, zero to cause blank lines in the macro body
  196. X                  to be discarded.
  197. X  
  198. X   29      0      Leading space flag (FSPACE): zero to ignore leading
  199. X                  spaces while scanning input lines, one to require
  200. X                  matching of leading spaces. Does not affect skip
  201. X                  comparisons.
  202. X  
  203. X   30      1      Required match flag (FMATCH): zero to allow inputted
  204. X                  lines to be output without at least once matching a
  205. X                  macro header line, one to issue error messages for
  206. X                  lines read from a file which do not match any macro
  207. X                  header line, two to issue errors on lines which are
  208. X                  output becuase they fail to match even after
  209. X                  rescanning. If two, only file operations may output
  210. X                  lines.
  211. X  
  212. X   31      0      Symbol generator advance flag (FSYMGEN): zero to start
  213. X                  the symbol generator at zero, one to start the symbol
  214. X                  generator at 100, two to start the symbol generator at
  215. X                  1000 (for consistantly sized numbers).
  216. X
  217. X
  218. X      Page 3                                Printed Tue Aug 14, 1990    
  219. X
  220. X
  221. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  222. X
  223. X
  224. X  
  225. X   32      0      Stack underflow flag (FSTACKUNDER): zero if a
  226. X                  user-maintained stack underflow should cause an ESTK
  227. X                  error, one if it should not cause an error.
  228. X  
  229. X   33      0      Stack size flag (FSTACKSIZE): zero for default initial
  230. X                  user-maintained stack size.
  231. X  
  232. X   34      0      Echo flag (FECHO): one to echo all read lines as
  233. X                  PLStatus text as they are read, zero for quite operation.
  234. X  
  235. X   35      0      Reserved.
  236. X  
  237. X   36      0      Reserved.
  238. X  
  239. X   37      0      Reserved.
  240. X  
  241. X   38      0      Reserved.
  242. X  
  243. X  
  244. X  Each macro header line (MHL) contains a mixture of characters and
  245. X  placeholder characters (PCs), possibly terminated by a HEOL character.
  246. X  Any character may be immediately preceeded by an escape character to
  247. X  cause it to be treated as a regular character. The only characters in
  248. X  a MHL which need such treatment are PCs and HEOLs. "Scanning" is the
  249. X  processes of attempting to match a input line (IL) against a MHL.
  250. X  (Note: an input line is not necessarily read from a file; it may be
  251. X  the output of a previous macro expansion.) If a scan is successful,
  252. X  each PC in the MHL will correspond to zero or more contiguous
  253. X  characters in the IL and the macro whose header was matched is known
  254. X  as the matching macro (MM). Each PC will be the shortest "balanced
  255. X  string" (BS) of characters which is followed in the IL by the same
  256. X  character which follows this parameter's PC in the MHL being scanned.
  257. X  A BS is defined with the following BNF. <OQ> is the open quote
  258. X  character, <CQ> is the close quote character, <OP> is the open
  259. X  parenthesis character, and <CP> is the close parenthesis character.
  260. X  <ARB> is any sequence of zero or more characters not containing an
  261. X  unescaped <OP>, <CP>, <OQ>, or <CQ> character.
  262. X  
  263. X
  264. X
  265. X
  266. X
  267. X
  268. X
  269. X
  270. X
  271. X
  272. X
  273. X
  274. X
  275. X
  276. X
  277. X
  278. X
  279. X
  280. X      Page 4                                Printed Tue Aug 14, 1990    
  281. X
  282. X
  283. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  284. X
  285. X
  286. X          "a balanced string"
  287. X  <BS> ::= <ARB-C> |
  288. X           <ARB> <OQ> <ARB-Q> <CQ> <BS> |
  289. X           <ARB> <OP> <ARB-P> <CP> <BS>
  290. X  
  291. X  <ARB-C> ::= <ARB> | <CQ> | <CP>
  292. X  
  293. X          "an arbitrary string balanced with respect to quotes"
  294. X          " but disregarding parentheses"
  295. X  <ARB-Q> ::= <ARB> | <OP> | <CP> |
  296. X              <ARB-Q> <OQ> <ARB-Q> <CQ> <ARB-Q>
  297. X  
  298. X          "an arbitrary string balanced with respect to parens"
  299. X          " but disregarding quotes"
  300. X  <ARB-P> ::= <ARB> | <OQ> | <CQ> |
  301. X              <ARB-P> <OP> <ARB-P> <CP> <ARB-P>
  302. X  
  303. X  The following (including the empty string) are all balanced strings:
  304. X      XYZ
  305. X      (XYZ)
  306. X      `XYZ'
  307. X      (don't)
  308. X      (won`t)
  309. X      `wont)close'
  310. X      `can(t-close'
  311. X      don\'t
  312. X      `dont\'t'
  313. X      don't
  314. X      WX(Y'Z)AB`C(D'EF
  315. X      PDQ(BACH(WAS)HERE)
  316. X      LOTS`OF`NESTING'IN'HERE
  317. X      ``''
  318. X      (())
  319. X      )))
  320. X      spaces are OK anywhere
  321. X        even the beginning and end!
  322. X  
  323. X  The following are not balanced strings unless they appear at the end
  324. X  of a line being scanned:
  325. X      don`t
  326. X      (won't
  327. X      `unmatched)
  328. X      )toosoon
  329. X      toolate(
  330. X  
  331. X  
  332. X  In summary, the scanner starts with the next character of the input
  333. X  string to be matched. If this matches the character in the macro
  334. X  header line that follows the placeholder character, it stops. If the
  335. X  next input character is an open parenthesis or open quote, it advances
  336. X  to the matching close parenthesis or close quote or end-of-line,
  337. X  ignoring quotes or parentheses, repectively. Any character advanced
  338. X  past during the scan (which does not include the character causing the
  339. X  scan to stop nor the end-of-line) are considered part of the matching
  340. X
  341. X
  342. X      Page 5                                Printed Tue Aug 14, 1990    
  343. X
  344. X
  345. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  346. X
  347. X
  348. X  parameter. Non-placeholder characters in the macro header line must
  349. X  match the next character of the input line exactly (unless the next
  350. X  input line character is an escape, in which case the macro header
  351. X  character must match the character after the escape). Trailing spaces
  352. X  on the input line will match the HEOL in the macro header line; i.e.,
  353. X  trailing spaces are ignored in the input line unless escaped. Also,
  354. X  trailing spaces in the macro header line will match the BEOL in the
  355. X  input line. This allows a macro header line of the form "XXX @" to
  356. X  match an input line of the form "XXX" by setting the zero'th parameter
  357. X  to an empty string; the space between the "XXX" and the "@" matches
  358. X  the BEOL, as does the placeholder character.
  359. X  
  360. X  Each macro header line may have as few as zero or as many as ten
  361. X  unescaped placeholder characters. Once a matching macro (MM) has been
  362. X  found for an input line (IL), the substrings corresponding to the PCs
  363. X  are numbered zero through nine and referenced in the macro body by
  364. X  including the substitution character (SC) in a line of the body. Such
  365. X  a reference is known (natually enough) as a substitution, or as an
  366. X  operation. Each macro body line of the matching macro (MMBL) is
  367. X  expanded and then resubmitted for further scanning. Only when the
  368. X  submitted line is found to not match any macro header lines is the
  369. X  submitted line written to the output file (unless it causes an error
  370. X  because of the required match flag). Certain substitutions can alter
  371. X  the scanning, matching, and so on for individual lines; such
  372. X  operations are documented under the descriptions of the individual
  373. X  operations. As each line is submitted to be rescanned, the current
  374. X  parameters as well as the location in the "calling" macro body are
  375. X  saved on a stack, and then all of the parameters are cleared to empty.
  376. X  This allows new macros to match or modify the parameters without
  377. X  disturbing side-effects. There is also a user-managed stack of strings
  378. X  which can be moved to and from parameters, allowing global information
  379. X  to be passed from line to line. In addition, a "dictionary" of
  380. X  variables is globally maintained; certain substitutions use the text
  381. X  of a parameter as the name of variable to be set into or retreived
  382. X  from this dictionary. There is also a facility for generating symbols;
  383. X  one substitution allows a variable to be set to a number never before
  384. X  generated by this facility, allowing for unique references for label
  385. X  generation and so on.
  386. X  
  387. X  The result of expanding a macro body line is usually a "constructed
  388. X  line". This constructed line is cleared to zero length before the
  389. X  start of each macro body line expansion. Some substitutions cause the
  390. X  constructed line to be discarded. If no such substitution is
  391. X  encountered, then when the macro body line end-of-line is encountered,
  392. X  the parameters and current offset into the macro body are saved on the
  393. X  "traceback stack" and the constructed line is resubmitted for
  394. X  scanning. If a "skip" is in progress, lines in macro bodies are
  395. X  skipped; this conditional-expansion facility is descibed completely
  396. X  below. Upon encountering an error, the traceback stack is printed out,
  397. X  allowing the user to see the macro which caused the error as well as
  398. X  all calls that lead up to this line.
  399. X  
  400. X  Sometimes an error will be detected which cannot be corrected or which
  401. X  the parameter line has specified should not be corrected. Each of
  402. X
  403. X
  404. X      Page 6                                Printed Tue Aug 14, 1990    
  405. X
  406. X
  407. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  408. X
  409. X
  410. X  these errors results in a four character error message, possibly
  411. X  followed by a traceback dump possibly followed by an exit from the
  412. X  program. The possible error messages are these:
  413. X  
  414. X  FULL    - Memory is full. Macro definition file too large. Fatal.
  415. X  
  416. X  IOER    - An ILLEGAL was returned from MacroIO. Usually fatal.
  417. X  
  418. X  UEOF    - Unexpected EOF. Trailer left off last macro definition?
  419. X  Usually fatal.
  420. X  
  421. X  FORM    - Something is wrong in the format of the input. Parameter
  422. X  line wrong size, two consecutive placeholder characters in a macro
  423. X  header line, substitution character not followed by proper parameter
  424. X  flags, file operation could not parse constructed line to determine
  425. X  streams to be affected. Often fatal.
  426. X  
  427. X  FSTK    - User-managed stack overflowed. fatal.
  428. X  
  429. X  ESTK    - User-managed stack underflowed. Issued only if FSTACKUNDER
  430. X  is zero, but is fatal if issued.
  431. X  
  432. X  NYET    - Not yet implemented. Fatal.
  433. X  
  434. X  NONE    - Line was not matched but FMATCH said it needed to match. Not
  435. X  fatal.
  436. X  
  437. X  NEST    - Traceback stack overflow. Not fatal, but clears stack.
  438. X  
  439. X  SSTK    - Input stream stack overflow (see @F3). Fatal.
  440. X  
  441. X  VFUL    - Variable table full. May also appear as FULL error in some
  442. X  implementations. Fatal.
  443. X  
  444. X  The operations available in an individual macro body line are as
  445. X  follows. If a normal character is encountered in the macro body line,
  446. X  it is added to the end of the constructed line. If an escape character
  447. X  is found, the next character from the body line is added to the end of
  448. X  constructed line. An escaped BEOL character is added to the line, but
  449. X  an escaped end-of-line is ignored. That is, if an escape character is
  450. X  the last character of a macro body line (not followed by a BEOL
  451. X  character) then the final escape is ignored; therefore, a macro body
  452. X  line must reside on exactly one macro definition file input line. If
  453. X  an unescaped BEOL character is encountered, the constructed line is
  454. X  resubmitted for output or further expansion. Thus, a line containing
  455. X  no escape character and no substitution characters is copied to the
  456. X  constructed line as-is and resubmitted. If an unescaped substitution
  457. X  character is found, the next two characters are examined to determine
  458. X  the operation to be performed. None of these three characters are
  459. X  added to the constructed line. If the character after the substitution
  460. X  character is the file operation character (usually 'F') then the
  461. X  character after the file operation character is a digit specifying one
  462. X  of ten possible file operations. If the character after the
  463. X  substitution character is the control operation character (usually
  464. X
  465. X
  466. X      Page 7                                Printed Tue Aug 14, 1990    
  467. X
  468. X
  469. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  470. X
  471. X
  472. X  'C') then the character after the file operation character is a digit
  473. X  specifying one of ten possible control operations. If the character
  474. X  after the substitution character is a digit then the character after
  475. X  the first digit is another digit specifying one of ten possible
  476. X  parameter operations to be applied to the parameter indicated by the
  477. X  first digit. Each of these groups of operations are described below.
  478. X  In some operations described below, the phrase "discard constructed
  479. X  line" is used. This indicates that the line constructed so far is at
  480. X  that point discarded and cleared, never to be rescanned or output.
  481. X  Whenever this occurs, the next character of the input line (the third
  482. X  after the substitution character) is examined. If found to be a BEOL,
  483. X  expansion continues at the next body line without constructing or
  484. X  rescanning the blank line that an empty constructed line would
  485. X  normally cause. If the character is not found to be a BEOL, it is not
  486. X  skipped and will become the first character scanned and interpreted
  487. X  after the "discard constructed line" operation ends.
  488. X  
  489. X  A parameter substitution is specified by including in a macro body
  490. X  line the substitution character followed by a digit indicating to
  491. X  which parameter (0-9) the operation should be applied followed by a
  492. X  digit (0-9) indicating which operation should be applied. If the
  493. X  indicated parameter matched an empty string or fewer placeholder
  494. X  characters than the indicated parameter were specified in the macro
  495. X  header line, then the indicated parameter is "empty". In all cases, it
  496. X  is safe to change the text of the parameter with one of the parameter
  497. X  substitution operations described below (even if the parameter was not
  498. X  matched in the macro header line). When a mathematical (as opposed to
  499. X  textual) value is inserted in the line, then a leading minus sign is
  500. X  inserted if the number is negative, then the value of the number in
  501. X  radix-10 is inserted without leading zeros; a special case is the
  502. X  number zero, which is inserted as the single digit zero. The only
  503. X  changes to parameters made are the ones explicitly documented. The
  504. X  list of operation numbers and their effects follows:
  505. X  
  506. X  0 - Insert the text of the parameter into the constructed line without
  507. X  modification. An empty parameter or one which has no placeholder
  508. X  character causes no change in the constructed line.
  509. X  
  510. X  1 - Insert the text of a copy of the parameter, transformed as
  511. X  described, into the constructed line. First, remove leading and
  512. X  trailing spaces from the text. Then, if the first character of the
  513. X  text is the open parenthesis character and the last is the close
  514. X  parenthesis character or the first is the open quote character and the
  515. X  last is the close quote character, remove the first and last
  516. X  characters of the text. Finally, add the text to the constructed line.
  517. X  No change is made to the actual text of the parameter during this
  518. X  transformation. This is the most convenient mechanism for inserting
  519. X  text from a parameter, as it allows the user to quote expressions for
  520. X  unambiguous matching. If the transformed parameter is empty (or if the
  521. X  pre-transformation parameter is empty or unset) then the constructed
  522. X  line is not changed.
  523. X  
  524. X  2 - Interpret the text of the parameter as a mathematical expression.
  525. X  In each of the addition, subtraction, multiplication, and division
  526. X
  527. X
  528. X      Page 8                                Printed Tue Aug 14, 1990    
  529. X
  530. X
  531. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  532. X
  533. X
  534. X  operations, the two tokens immediately to the left of the operator
  535. X  character are used. Each must be interpretable as a radix-10 integer
  536. X  with a single optional sign. If not, a conversion error (CONV) is
  537. X  issued. All tokens and operators must be separated by at least one
  538. X  space. operator characters that are not followed by a space (or end of
  539. X  parameter) are considered to be part of the token. In all cases (even
  540. X  when there are no operator characters), excess spaces are compressed
  541. X  to one space. In the case of the `fetch' operator (normally `?'), the
  542. X  single token preceeding the fetch operator is treated as the name of a
  543. X  variable and is looked up in the variable dictionary. The text of the
  544. X  variable is substituted into the line in place of the name of the
  545. X  variable, unless the value is not found or is of zero length, in which
  546. X  case a conversion error (CONV) is issued. In the case of the radix
  547. X  operator (normally `!'), the three tokens before the operator
  548. X  represent (from left to right) the number to be converted (with
  549. X  optional sign), the radix in which the number is expressed, and the
  550. X  radix in which the number should be expressed. These three tokens plus
  551. X  the operator are replaced by the number with the same value in the new
  552. X  radix. The from-radix and to-radix tokens must each be one character
  553. X  long and must each represent the largest single-digit number available
  554. X  in that radix. Thus, to convert the number 365 from decimal to hex,
  555. X  use `365 9 F !' and to convert the number 0x1A7 from hex to binary use
  556. X  `1A7 F 1 !'.  Characters after nine run from UCA to UCZ, but upper and
  557. X  lower case are treated identically. In all operations except the radix
  558. X  conversion, numbers are expected to be in radix-10. If illegal
  559. X  characters for the given radix are found, a conversion error (CONV) is
  560. X  issued. Outputted numbers are not padded with leading zeros and will
  561. X  not have a plus sign if positive. The conversion stops where there are
  562. X  no longer any operator characters (+,-,*,/,?,!) in the parameter;
  563. X  hence, multiple expressions can be evaluated with one substitution and
  564. X  expressions with insufficient operator characters can generate
  565. X  multiple words of output.
  566. X  
  567. X  The range allowable is limited by the implementation underlying the
  568. X  LOME interpreter, but can safely be assumed to be at least -9999 to
  569. X  +9999. Only integer operations are performed; fractional results from
  570. X  divisions are discarded as they are in C. Once the value is evaluated,
  571. X  it is inserted into the constructed line as described above. This
  572. X  operation does not change the text of any parameters or variables. If
  573. X  the text of the parameter cannot be converted to a valid expression
  574. X  (undefined variables, division by zero, and so on) then a conversion
  575. X  error (CONV) is issued.
  576. X  
  577. X  
  578. X  3 - Interpret the text of the parameter as the name of a variable to
  579. X  be looked up in the dictionary. Insert the value of the so-named
  580. X  variable into the constructed line. If the parameter is empty or the
  581. X  variable is not set or is empty, insert nothing into the constructed
  582. X  line without issuing any error.
  583. X  
  584. X  4 - Interpret the text of the parameter as the name of a variable to
  585. X  be looked up in the dictionary. If parameter is empty or the variable
  586. X  is not set or is empty, insert the decimal equivalent of the value of
  587. X  the symbol generator into the constructed line (without leading sign
  588. X
  589. X
  590. X      Page 9                                Printed Tue Aug 14, 1990    
  591. X
  592. X
  593. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  594. X
  595. X
  596. X  or zeros) and then increment the symbol generator. If the parameter
  597. X  text is not empty but the variable is not set or is empty, set the
  598. X  value of the variable to be the just-inserted text. If the parameter
  599. X  text is not empty and the value of the so-named variable is not empty,
  600. X  insert the value of the variable without referencing or modifying the
  601. X  symbol generator. In this way, symbols (variables) can be given unique
  602. X  numbers which henceforth do not change. The text of the parameter does
  603. X  not change, although the text of the value of the variable might.
  604. X  
  605. X  5 - Substitute the decimal equivalent of the I/O mapping code (see
  606. X  MacroIO.doc) of the first character of the parameter into the
  607. X  constructed line. If the parameter is empty, substitute the single
  608. X  digit zero, which is the code for end-of-line. This mapping may change
  609. X  from machine to machine and from implementation to implementation.
  610. X  
  611. X  6 - Substitute the decimal equivalent of the number of characters in
  612. X  the parameter. That is, insert the length of the text of the
  613. X  parameter.
  614. X  
  615. X  7 - Assign the current constructed line to the parameter. The previous
  616. X  text of the parameter is lost. Discard the constructed line, possibly
  617. X  skipping the following end-of-line. This change lasts until the
  618. X  current macro expansion is complete.
  619. X  
  620. X  8 - Interpret the text of the parameter as the name of a variable in
  621. X  the dictionary. Assign to the value of the variable the text of the
  622. X  current constructed line. If the variable has never before been set,
  623. X  create the variable. If the variable already has a value, discard the
  624. X  old value. If the test of the parameter is empty or unset, ignore the
  625. X  setting of the variable. An any case, discard the constructed line,
  626. X  possibly skipping the following EOL. This change lasts until
  627. X  overridden or until execution terminates.
  628. X  
  629. X  9 - RESERVED FOR FUTURE EXPANSION.
  630. X  Possibility: a Word-Wrap substitution. Parameters give the left
  631. X  margin, the right margin, and one of ragged-right, ragged-left,
  632. X  centered, or justified. The contents of the parameter is then put into
  633. X  the constructed line as specified, with any that did not fit going
  634. X  back into the parameter (possibly for the next line).
  635. X  
  636. X  
  637. X  A control substitution is specified by including in a macro body line
  638. X  the substitution character followed by a control operation character
  639. X  (usually 'C') followed by a digit (0-9) indicating which operation
  640. X  should be applied. The only changes to parameters made are the ones
  641. X  explicitly documented. In ALL control substitutions, the constructed
  642. X  line is discarded and any immediately following BEOL is skipped. In
  643. X  many cases, the constructed line is referenced before it is discarded.
  644. X  In some cases, the values of parameters are referenced or changed.
  645. X  References to parameters are indicated by the notation P0 for
  646. X  parameter zero, P1 for parameter one, and P2 for parameter two. When a
  647. X  skip command ($C1, $C2, $C3, or $C4) is encountered whose condition is
  648. X  satisfied, the skip counter is set to the value of P0 interpreted as a
  649. X  signed decimal number (zero if it cannot be so interpreted). If the
  650. X
  651. X
  652. X      Page 10                               Printed Tue Aug 14, 1990    
  653. X
  654. X
  655. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  656. X
  657. X
  658. X  skip counter is zero, the remainder of the macro body line (after the
  659. X  skip operation) is skipped; if the skip operation is the last on the
  660. X  line, this has no effect. If the skip counter is negative, that many
  661. X  entire macro bodies are skipped. That is, minus one will skip to the
  662. X  end of the macro which contains the skip command, minus two will skip
  663. X  to the end of the macro which called the macro containing the skip
  664. X  command and so on. A skip of -999 can be used to skip to the next line
  665. X  of input, because negative skips only ever affect macros already in
  666. X  the process of being expanded. After a skip is complete (positive or
  667. X  negative), the skip counter is cleared. The list of control operation
  668. X  numbers and their effects follows:
  669. X  
  670. X  0 - Stop. If the constructed line is empty, stop normally. If the
  671. X  constructed line is not empty, output it as an error message and then
  672. X  exit with a debugging dump. The error message may go to the current
  673. X  output stream or it may go to wherever the debugging dump goes; this
  674. X  is implementation dependant.
  675. X  
  676. X  1 - Skip P0 lines if the value of P1 (interpreted as a signed decimal
  677. X  number) is less than the value of P2 (interpreted as a signed decimal
  678. X  number). If either P0 or P1 cannot be interpreted as a number, it is
  679. X  assumed to be the value zero.
  680. X  
  681. X  2 - Skip P0 lines if the text of P1 is equal to the text of P2.
  682. X  
  683. X  3 - Skip P0 lines if the text of P1 is not equal to the text of P2.
  684. X  
  685. X  4 - Skip P0 lines if the text of P1 is an initial portion of the text
  686. X  of P2.
  687. X  
  688. X  5 - Push the constructed line onto the user-managed string stack.
  689. X  Issue a FSTK (full stack) error and exit if too many entries are
  690. X  pushed.
  691. X  
  692. X  6 - Pop the user-managed string stack into the parameter whose number
  693. X  (0-9) is the first character of the constructed line, which must be a
  694. X  digit. If the constructed line is empty, discard the top entry of the
  695. X  user-managed string stack without storing into any parameter. If the
  696. X  stack is empty, either issue an ESTK (empty stack) error and exit or
  697. X  leave the parameter unchanged, depending on the stack underflow flag.
  698. X  
  699. X  7 - Decimal loop. P0 and P1 provide signed decimal values. If either
  700. X  cannot be interpreted as a signed decimal value, it is assumed to be
  701. X  zero. The constructed line is pseudo-replicated (P1-P0+1) times with
  702. X  the numbers from P1 through P2 represented in decimal and surrounded
  703. X  by parentheses appended. If P0 is greater than P1 then no
  704. X  pseudo-replication is performed. The pseudo-replication is
  705. X  distingushed from true replication in two ways. A skip within a macro
  706. X  matched by the constructed line that causes a skip out of the macro
  707. X  matched by the constructed line will terminate the skip immediately.
  708. X  For example, if P0 is one and P1 is five, then five lines are
  709. X  pseudo-replicated. If during the expansion of the macro matching the
  710. X  second constructed line a skip that leaves the macro with the skip
  711. X  counter set at one occurs, no further expansion will occur. Also, the
  712. X
  713. X
  714. X      Page 11                               Printed Tue Aug 14, 1990    
  715. X
  716. X
  717. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  718. X
  719. X
  720. X  value of P0 is changed by this control function to match either the
  721. X  last line expanded before a skip aborted the pseudo-replication (as
  722. X  described above) or to one larger than P1 if the pseudo-replication
  723. X  was not aborted by a skip. Both of these effects are artifacts of the
  724. X  way in which this control function is implemented. After constructing
  725. X  a line, the P0 parameter is modified to the value it will have at the
  726. X  next pseudo-replication and then the start of the current macro body
  727. X  line is pushed onto the traceback stack. When the constructed macro
  728. X  line is finished its expansion, the macro body line causing the
  729. X  decimal loop is rescanned, causing the next expansion. Once P0 exceeds
  730. X  P1, the constructed line is discarded without rescanning. Hence, a
  731. X  skip out of the constructed macro causes the decimal loop line to be
  732. X  skipped and the execution of the decimal loop corrupts the value of P0
  733. X  in order to keep track of where in the expansion the loop is. Note
  734. X  that since the start of the current macro body line is pushed onto the
  735. X  traceback stack, other operations (before the $C7 operation but on the
  736. X  same line) can be performed during each iteration, as the entire line
  737. X  will be rescanned. Anything on the line after the loop command is
  738. X  executed at the end of the loop unless the loop is skipped out of.
  739. X  
  740. X  8 - String loop. This is similar to the decimal loop except in the
  741. X  interpretation of P0 and P1 and the constructed line that gets
  742. X  rescanned. If P1 is empty, then the constructed line is rescanned once
  743. X  for each character in P0. Each rescanned line consists of the
  744. X  constructed line followed by the next character off the front of P0.
  745. X  The loop stops when P0 is empty. The constructed line is not rescanned
  746. X  at all when P0 is empty, whether it is empty at the start or empty due
  747. X  to prior expansions. If P1 is not empty then P1 is interpreted as a
  748. X  series of "break characters". In this case, P0 is broken into a series
  749. X  of balanced strings, each being the shortest initial balanced string
  750. X  of P0 which is immediately followed by any of the characters in P1 or
  751. X  by the end of P0. The constructed line is pseudo-replicated once for
  752. X  each such string in P0. The rescanned line consists of the constructed
  753. X  line followed by the character from P1 which immediately followed the
  754. X  balanced string case enclosed parenthesis (possibly escaped to prevent
  755. X  imbalance), followed by initial balanced substring of P0 that was
  756. X  terminated by the character from P1 or the end of P0. On the last
  757. X  replication, the first parameter (the single character from P1) is
  758. X  missing, resulting in empty parentheses. For example, if the
  759. X  constructed line is "EVAL" and P0 is "AB+(B*CD)*E+-FG" and P1 is
  760. X  "+-*/" then five lines will be generated: "EVAL(+)AB",
  761. X  "EVAL(*)(B*CD)", "EVAL(+)E", "EVAL(-)", and "EVAL()FG". The macro
  762. X  header which would match all of these is "EVAL(@)@". If the
  763. X  constructed line is "XX" and P0 is "AB(CD`" and P1 is "()`'" then the
  764. X  result will be two lines: "XX(\()AB", and "XX(`)CD"; "XX()" will not
  765. X  appear because P0 was empty at the start of that iteration. Regardless
  766. X  of the initial value of P1, P0 will become empty after this command
  767. X  terminates unless terminated by an embedded skip. Anything on the line
  768. X  after the loop command is executed after the loop unless the loop is
  769. X  skipped out of.
  770. X  
  771. X  9 - RESERVED FOR FUTURE EXPANSION.
  772. X  Possibility: A state control. Two ways of doing this are possible:
  773. X  Method one would have this control substitution take the constructed
  774. X
  775. X
  776. X      Page 12                               Printed Tue Aug 14, 1990    
  777. X
  778. X
  779. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  780. X
  781. X
  782. X  line and pseudo-prepend it to each inputted line just before it is
  783. X  matched against macro headers. This allows certain macros to match
  784. X  some times and not others. It has the disadvantage that each macro can
  785. X  only belong to one state. Method two would have this control
  786. X  substitution take a single state and have each macro header tagged
  787. X  with the set of states in which it may be matched. Both of these
  788. X  should require changes only to FindMatch() and LoadMacros().
  789. X  
  790. X  
  791. X  A file substitution is specified by including in a macro body line the
  792. X  substitution character followed by a file operation character (usually
  793. X  'F') followed by a digit (0-9) indicating which operation should be
  794. X  applied. The only changes to parameters made are the ones explicitly
  795. X  documented. In ALL file substitutions, the constructed line is
  796. X  discarded and any immediately following BEOL is skipped. In many
  797. X  cases, the constructed line is referenced before it is discarded. In
  798. X  some cases, the values of parameters are referenced or changed.
  799. X  References to parameters are indicated by the notation P0 for
  800. X  parameter zero, P1 for parameter one, and P2 for parameter two. All
  801. X  I/O performed by LOME is performed via calls on the MacroIO package.
  802. X  This package allows reference to up to nine different text-based
  803. X  streams, numbered one through nine, each (probably) associated with a
  804. X  named file on the host system. Stream zero is defined to always return
  805. X  end-of-file on read and to discard output on write. The association
  806. X  between the stream number and the name of the file is established at
  807. X  the time LOME is started and cannot (at this time) be changed by the
  808. X  LOME program. Streams which have no explicit name associated can be
  809. X  used temporarily but are deleted when the program completes. Each of
  810. X  these streams can be rewound. Normally, once writing to a stream has
  811. X  begun, a rewind of that stream must be performed before it can be
  812. X  read, and vica versa. LOME defines a "current input stream" and a
  813. X  "current output stream," which may be changed via file substitution
  814. X  operations. If an illegal operation is attempted, one of two events
  815. X  will occur. If an unexpected end-of-file condition is encountered (for
  816. X  example, while reading a macro body) then a UEOF error will be
  817. X  reported and operation will stop. If some other occurs or an illegal
  818. X  operation is reported during processing, an IOER (input/output error)
  819. X  will be reported. Stream numbers are indicated by giving either a
  820. X  digit (0-9) or an upper-case 'A' (UCA on parameter line) meaning the
  821. X  current input stream or an upper-case 'Z' (UCZ on the parameter line)
  822. X  meaning the current output stream. In all cases these parameters are
  823. X  allowed and passed to MacroIO; however, in many cases the calls may
  824. X  fail (for example, if output is attempted to current input stream).
  825. X  
  826. X  The list of file operation numbers and their effects follows:
  827. X  
  828. X  0 - Rewind the stream indicated by the first character of the
  829. X  constructed line, which may be a digit or UCA or UCZ. If the
  830. X  constructed line is more that one character long, use the rest of the
  831. X  constructed line as a new name for the file after it is rewound; in
  832. X  this case, any scratch data on the file is deleted and this file will
  833. X  remain after the execution.
  834. X  
  835. X  1 - Copy from the stream (S) indicated by the first character of the
  836. X
  837. X
  838. X      Page 13                               Printed Tue Aug 14, 1990    
  839. X
  840. X
  841. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  842. X
  843. X
  844. X  constructed line, which must be a digit or UCA or UCZ, to the stream
  845. X  (T) indicated by the second character of the constructed line, which
  846. X  must also be a digit or UCA or UCZ, until a line starting with the
  847. X  constructed line excluding the first two characters (R) is encountered
  848. X  or until end-of-file is detected on stream S. If R is empty (i.e., the
  849. X  constructed line is two characters long), append the entire stream S
  850. X  to the stream T. If R is not empty then the line that matches R is
  851. X  discarded and is not appended to T. Lines of a file can be skipped
  852. X  (read without parsing) by copying them to stream 0. If R is not empty
  853. X  and R is not found to start a line in the remainder of stream S, a
  854. X  UEOF error is issued and processing continues. Exausting a stream
  855. X  never causes the input stream stack (see 3, below) to be popped.
  856. X  
  857. X  2 - Direct future output to the stream indicated by the first
  858. X  character of the constructed line, which must be a digit or UCA or
  859. X  UCZ.
  860. X  
  861. X  3 - Read future input from the stream indicated by the first character
  862. X  of the constructed line, which must be a digit or UCA or UCZ. If the
  863. X  constructed line contains more than one character then when
  864. X  end-of-file is detected on this stream, revert to the previous input
  865. X  stream.
  866. X  
  867. X  4 - Output the constructed line except for the first character to the
  868. X  stream indicated by the first character of the constructed line, which
  869. X  must be a digit or UCA or UCZ. This outputs empty output lines for
  870. X  empty constructed lines even if the blank output line flag (FBLANK) is
  871. X  zero. This is one method of outputting lines without errors when the
  872. X  required match flag (FMATCH) is two.
  873. X  
  874. X  5 - Use the constructed line as a format pattern. Use the parameters
  875. X  as the values to substituted into the format pattern. Output without
  876. X  rescanning the formatted results to the stream indicated by the first
  877. X  character of the constructed line, which must be a digit or UCA or
  878. X  UCZ. This outputs empty output lines for empty constructed lines even
  879. X  if the blank output line flag (FBLANK) is zero. This is one method of
  880. X  outputting lines without errors when the required match flag (FMATCH)
  881. X  is two. The constructed line contains characters which are output
  882. X  exactly and strings of identical digits (fields) which are replaced
  883. X  with the leftmost portion of the parameter indicated by the digit and
  884. X  space-filled on the right. If a field (X) is separated from a field of
  885. X  the same digits (Y) by either other digits or non-digit characters,
  886. X  then the second field (Y) will start over at the beginning of the same
  887. X  parameter that the first field (X) used. For example, if the
  888. X  constructed line is "Zb000000b11111b000bHELP22ME" (where "b" is a
  889. X  space character) and P0 is "ZERO" and P1 is "23" and P2 is "" then the
  890. X  outputted line will be "bZERObbb23bbbbZERbHELPbbME".
  891. X  
  892. X  6 - Output a debugging dump to the stream indicated by the first
  893. X  character of the constructed line, which must be a digit or UCA or
  894. X  UCZ, with a heading containing the constructed line excluding the
  895. X  first character.
  896. X  
  897. X  7 - Output the constructed line except for the first character to the
  898. X
  899. X
  900. X      Page 14                               Printed Tue Aug 14, 1990    
  901. X
  902. X
  903. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  904. X
  905. X
  906. X  user as a status message. The first character must be a digit
  907. X  indicating the priority of this message with lower digits indicating
  908. X  more important messages. This may not cause any output under some
  909. X  implementations, as it is explicitly designed to bypass the MacroIO
  910. X  package.
  911. X  
  912. X  8 - Read one line from the stream indicated by the first character of
  913. X  the constructed line, which must be a digit or UCA or UCZ. Assign the
  914. X  text of that line, without parsing or rescanning in any way, to the
  915. X  parameter indicated by the second character of the constructed line,
  916. X  which must be a digit. If an error occurs while reading the file, the
  917. X  parameter remains unchanged if the file was specified by a digit or
  918. X  UCZ. If an error occurs while reading the stream indicated by UCA, the
  919. X  input stream stack (as created by $F3) is popped and the read is
  920. X  retried; only at EOF of the initial stream is the parameter left
  921. X  unchanged. If the second character of the constructed line is not a
  922. X  digit then the line is read and discarded.
  923. X  
  924. X  9 - RESERVED FOR FUTURE EXPANSION.
  925. X  Possibility: Binary output. Output to a stream is performed at a given
  926. X  offset and the number is output with a given size. For example, a
  927. X  two-byte integer whose value is 1000 is output to offset 93 in the
  928. X  file xyzzy.bin. This needs more thought and will probably be quite
  929. X  slow.
  930. X  
  931. X  SUMMARY OF SUBSTITUTION OPERATIONS:
  932. X  
  933. X  PARAMETER SUBSTITUTION OPERATIONS:
  934. X  
  935. X  0 - Insert parameter without change.
  936. X  
  937. X  1 - Insert the parameter, stripping spaces and outermost parens.
  938. X  
  939. X  2 - Insert value interpreted as mathematical expression.
  940. X  
  941. X  3 - Insert value of variable named by parameter.
  942. X  
  943. X  4 - Insert var, or insert new generated number and set variable.
  944. X  
  945. X  5 - Insert I/O code of first character of parameter.
  946. X  
  947. X  6 - Insert length of parameter.
  948. X  
  949. X  7 - Assign the current constructed line to the parameter.
  950. X  
  951. X  8 - Assign constructed line to variable named by parameter.
  952. X  
  953. X  9 - RESERVED FOR FUTURE EXPANSION.
  954. X  
  955. X
  956. X
  957. X
  958. X
  959. X
  960. X
  961. X
  962. X      Page 15                               Printed Tue Aug 14, 1990    
  963. X
  964. X
  965. X  LOME.Doc             Line Oriented Macro Expander           Darren New
  966. X
  967. X
  968. X  CONTROL OPERATIONS:
  969. X  
  970. X  0 - Stop. Error if constructed line contains characters.
  971. X  
  972. X  1 - Skip P0 if P1 less than P2 (numeric interpretation)
  973. X  
  974. X  2 - Skip P0 if "P1" equal "P2"
  975. X  
  976. X  3 - Skip P0 if "P1" not equal "P2"
  977. X  
  978. X  4 - Skip P0 if "P1" starts "P2"
  979. X  
  980. X  5 - Push the constructed line onto the user-managed string stack.
  981. X  
  982. X  6 - Pop the user-managed string stack into the parameter named by C0.
  983. X  
  984. X  7 - Decimal loop. P0 is start and P1 is end.
  985. X  
  986. X  8 - String loop. P0 gets scanned and P1 provides break characters.
  987. X  
  988. X  9 - RESERVED FOR FUTURE EXPANSION.
  989. X  
  990. X  FILE OPERATIONS:
  991. X  
  992. X  0 - Rewind the stream indicated by C0. Rename if line size > 1.
  993. X  
  994. X  1 - Copy C0 to C1 looking for constructed line.
  995. X  
  996. X  2 - Future output to C0.
  997. X  
  998. X  3 - Future input from C0. Revert on EOF if line size > 1.
  999. X  
  1000. X  4 - Output rest of line to C0 without rescanning.
  1001. X  
  1002. X  5 - Formatted output line to C0.
  1003. X  
  1004. X  6 - Debug dump to C0.
  1005. X  
  1006. X  7 - Status message to C0, priority is C1.
  1007. X  
  1008. X  8 - Read from C0, assign to parameter named by C1.
  1009. X  
  1010. X  9 - RESERVED FOR FUTURE EXPANSION.
  1011. X  
  1012. X  
  1013. X  
  1014. X
  1015. X
  1016. X
  1017. X
  1018. X
  1019. X
  1020. X
  1021. X
  1022. X
  1023. X
  1024. X      Page 16                               Printed Tue Aug 14, 1990    
  1025. X
  1026. END_OF_FILE
  1027. if test 46006 -ne `wc -c <'LOME/LOME.doc'`; then
  1028.     echo shar: \"'LOME/LOME.doc'\" unpacked with wrong size!
  1029. fi
  1030. # end of 'LOME/LOME.doc'
  1031. fi
  1032. echo shar: End of archive 9 \(of 9\).
  1033. cp /dev/null ark9isdone
  1034. MISSING=""
  1035. for I in 1 2 3 4 5 6 7 8 9 ; do
  1036.     if test ! -f ark${I}isdone ; then
  1037.     MISSING="${MISSING} ${I}"
  1038.     fi
  1039. done
  1040. if test "${MISSING}" = "" ; then
  1041.     echo You have unpacked all 9 archives.
  1042.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1043. else
  1044.     echo You still need to unpack the following archives:
  1045.     echo "        " ${MISSING}
  1046. fi
  1047. ##  End of shell archive.
  1048. exit 0
  1049. -- 
  1050. --- Darren New --- Grad Student --- CIS --- Univ. of Delaware ---
  1051.  
  1052. exit 0 # Just in case...
  1053. -- 
  1054. Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.
  1055. Use a domain-based address or give alternate paths, or you may lose out.
  1056.