home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / funnlweb / part02 < prev    next >
Encoding:
Text File  |  1993-04-10  |  131.3 KB  |  3,598 lines

  1. Newsgroups: comp.sources.unix
  2. From: ross@spam.adelaide.edu.au (Ross Williams)
  3. Subject: v26i122: funnelweb - a tool for literate programming in C, Part02/20
  4. Sender: unix-sources-moderator@vix.com
  5. Approved: paul@vix.com
  6.  
  7. Submitted-By: ross@spam.adelaide.edu.au (Ross Williams)
  8. Posting-Number: Volume 26, Issue 122
  9. Archive-Name: funnelweb/part02
  10.  
  11. [ several files in this archive will unpack with the wrong size, due to
  12.   length restrictions in NNTP.  --vix ]
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then unpack
  16. # it by saving it into a file and typing "sh file".  To overwrite existing
  17. # files, type "sh file -c".  You can also feed this as standard input via
  18. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  19. # will see the following message at the end:
  20. #        "End of archive 2 (of 20)."
  21. # Contents:  admin/vms_bld.com answers/an03.lis answers/sc02.lis
  22. #   answers/sc03.lis answers/sc04.lis answers/sc05.lis
  23. #   answers/sc06.lis answers/sc08.lis answers/sc12.lis
  24. #   answers/sc19.lis answers/sc20.lis answers/sc25.lis
  25. #   answers/sc26.lis hackman/h_manual.toc sources/analyse.h
  26. #   sources/as.c sources/clock.c sources/command.h sources/data.c
  27. #   sources/dump.h sources/help_gnu.h sources/lister.h sources/main.c
  28. #   sources/mapper.h sources/parser.h sources/scanner.h
  29. #   sources/section.c sources/tangle.h sources/weave.h tests/ex16.fw
  30. #   tests/generate.fw tests/hi09.fw tests/hi10.fw tests/pr08.fw
  31. #   tests/pr09.fw tests/sc10.fw tests/sc11.fw userman/u_manual.log
  32. # Wrapped by vixie@gw.home.vix.com on Sun Apr 11 11:00:09 1993
  33. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  34. if test -f 'admin/vms_bld.com' -a "${1}" != "-c" ; then 
  35.   echo shar: Will not clobber existing file \"'admin/vms_bld.com'\"
  36. else
  37. echo shar: Extracting \"'admin/vms_bld.com'\" \(3808 characters\)
  38. sed "s/^X//" >'admin/vms_bld.com' <<'END_OF_FILE'
  39. X$! VMSBUILD.COM         Build the Funnelweb program under VMS
  40. X$!
  41. X$!      J Begg  VSM Software Services   11-Feb-1992     jeremy@vsm.com.au
  42. X$!
  43. X$! set verify
  44. X$       set noon
  45. X$       say     = "write sys$output"
  46. X$       sts     = 1
  47. X$
  48. X$!
  49. X$! Make sure we are in the sources directory -- Assumes this procedure is in
  50. X$! the same directory as the sources.
  51. X$!
  52. X$       cur_def = f$env("DEFAULT")
  53. X$       proc    = f$env("PROCEDURE")
  54. X$       procnam = proc - f$parse(proc,,,"VERSION")
  55. X$       procdir = proc - f$parse(proc,,,"NAME")    -
  56. X                       - f$parse(proc,,,"TYPE")    -
  57. X                       - f$parse(proc,,,"VERSION")
  58. X$       sourcedir = procdir - "ADMIN]" + "SOURCES]"
  59. X$       if f$search(sourcedir+"WEAVE.C").eqs.""
  60. X$       then
  61. X$           say "It would appear that the FunnelWeb sources have not been"
  62. X$           say "loaded into the correct directory.  Please move them into"
  63. X$           say "       ", procdir
  64. X$           say "then re-execute this procedure."
  65. X$           goto Exit
  66. X$       endif
  67. X$
  68. X$       set default 'sourcedir'
  69. X
  70. X$       show default
  71. X$
  72. X$!
  73. X$! Check for VAX C, use GNU C if VAX C is not found
  74. X$!
  75. X$       if f$search("SYS$SYSTEM:VAXC.EXE").nes.""
  76. X$       then
  77. X$           say "   Using VAX C.  If you prefer to use GNU C, edit the file"
  78. X$           say "   ",procnam
  79. X$           say "   as instructed therein."
  80. X$           use_VAXC = "true"
  81. X$       else
  82. X$           say "   VAX C not found -- using GNU C."
  83. X$           use_VAXC = "false"
  84. X$       endif
  85. X$
  86. X$!*************************************************************************
  87. X$! UNCOMMENT the following line to force use of VAX C                    !*
  88. X$!      use_VAXC = "true"                                                !*
  89. X$! UNCOMMENT the following line to force use of GNU C                    !*
  90. X$!      use_VAXC = "false"                                               !*
  91. X$!*************************************************************************
  92. X$!
  93. X$! Set up the appropriate symbols
  94. X$!
  95. X$       if use_VAXC
  96. X$       then
  97. X$           cc = "CC"
  98. X$           cflags = "/DEBUG/WARN/NOOPT/LIST"
  99. X$       else
  100. X$           cc = "GCC"
  101. X$           cflags = " -g -Wall"
  102. X$       endif
  103. X$
  104. X$       link = "link"
  105. X$
  106. X$!
  107. X$! An object library is used to hold .OBJ files along the way.
  108. X$!
  109. X$       if f$search("FUNNELWEB.OLB").eqs."" then $ lib/cre/obj funnelweb.olb
  110. X$
  111. X$ if "''p1'" .eqs. "LINK" then $ goto Done_Compile
  112. X$!
  113. X$! Search for .C files, compiling same.
  114. X$!
  115. X$       old_src = ""
  116. X$       filecount = 0
  117. X$       skiptofile = ""
  118. X$       if "''p1'" .nes. ""
  119. X$       then
  120. X$          skiptofile = "$USERS:[ROSS.FWDIR.SOURCES]''p1'"
  121. X$       endif
  122. X$Compile:
  123. X$       src = f$search("*.C")
  124. X$       if src.eqs."" then $ goto Done_Compile
  125. X$       if src.eqs.old_src then $ goto Done_Compile
  126. X$       srcnam = src - f$parse(src,,,"TYPE") - f$parse(src,,,"VERSION")
  127. X$       if srcnam .lts. skiptofile
  128. X$       then
  129. X$          write sys$output "Skipping ''srcnam'"
  130. X$          goto Compile
  131. X$       endif
  132. X$       say "Compiling ",srcnam
  133. X$       'cc 'cflags 'srcnam
  134. X$       if .not.$status then $ goto Compile_Failed
  135. X$       lib/repl funnelweb 'srcnam
  136. X$       deletx 'srcnam'.obj;
  137. X$       goto Compile
  138. X$
  139. X$Compile_Failed:
  140. X$       sts = $status
  141. X$       say "Build of FunnelWeb aborted because compile failed for file:"
  142. X$       say src
  143. X$       goto Exit
  144. X$
  145. X$Done_Compile:
  146. X$       say "Linking..."
  147. X$       cur_exe = f$search("FUNNELWEB.EXE")
  148. X$       !Jeremy's link: link/debug/map/full funnelweb/opt
  149. X$       link funnelweb/library/include=main,sys$input:/opt/exe='procdir'fw.exe
  150. sys$share:vaxcrtl/share
  151. X$       if $status then $ goto Exit
  152. X$       sts = $status
  153. X$       say "Build of FunnelWeb aborted in Link phase"
  154. X$       if f$search("FUNNELWEB.EXE").nes.cur_exe then $ delete funnelweb.exe;
  155. X$
  156. X$Exit:
  157. X$       set default 'cur_def'
  158. X$       exit sts
  159. END_OF_FILE
  160. if test 3808 -ne `wc -c <'admin/vms_bld.com'`; then
  161.     echo shar: \"'admin/vms_bld.com'\" unpacked with wrong size!
  162. fi
  163. # end of 'admin/vms_bld.com'
  164. fi
  165. if test -f 'answers/an03.lis' -a "${1}" != "-c" ; then 
  166.   echo shar: Will not clobber existing file \"'answers/an03.lis'\"
  167. else
  168. echo shar: Extracting \"'answers/an03.lis'\" \(3720 characters\)
  169. sed "s/^X//" >'answers/an03.lis' <<'END_OF_FILE'
  170. XFUNNELWEB LISTING FILE
  171. X======================
  172. X
  173. X
  174. Global Local| Input File
  175. X------------+-------------------------------------------------------------------
  176. X     1     1| AN03: Test semantics checking of macros.
  177. X     2     2| 
  178. X     3     3| First define some macros to call.
  179. X     4     4| @$@<Zero@>@Z@M@{@}
  180. X     5     5| @$@<One@>@(@1@)@Z@M@{@}
  181. X     6     6| @$@<Two@>@(@2@)@Z@M@{@}
  182. X     7     7| 
  183. X     8     8| 1. Test call to undefined macro.
  184. X     9     9| @$@<Sloth1@>@Z==@{@<Walrus@>@}
  185. X       Error|...................^Call to undefined macro.
  186. X    10    10| 
  187. X    11    11| 2. Test calls with wrong number of parameters.
  188. X    12    12| @$@<Sloth2@>@Z==@{
  189. X    13    13| @<Zero@>
  190. X    14    14| @<Zero@>@(@)
  191. X       Error|.^Call has 1 parameter, but the macro
  192. X            |.^definition at line 4 specifies 0 parameters.
  193. X            |.^Note: If your call looks like this: @<Macro@>@(@) then you
  194. X            |.^should be aware that FunnelWeb treats this as a call with
  195. X            |.^a single parameter consisting of the empty string. This
  196. X            |.^is a consequence of parameter delimiters @"@" being optional.
  197. X    15    15| @<Zero@>@(@,@)
  198. X       Error|.^Call has 2 parameters, but the macro
  199. X            |.^definition at line 4 specifies 0 parameters.
  200. X    16    16| @<One@>
  201. X       Error|.^Call has 0 parameters, but the macro
  202. X            |.^definition at line 5 specifies 1 parameter.
  203. X    17    17| @<One@>@(@)
  204. X    18    18| @<One@>@(Walrus@,@)
  205. X       Error|.^Call has 2 parameters, but the macro
  206. X            |.^definition at line 5 specifies 1 parameter.
  207. X    19    19| @<Two@>@(Sloth@)
  208. X       Error|.^Call has 1 parameter, but the macro
  209. X            |.^definition at line 6 specifies 2 parameters.
  210. X    20    20| @}
  211. X    21    21| 
  212. X    22    22| 3. Test call to file macro.
  213. X    23    23| @O@<deleteme.txt@>@{@}
  214. X            |.^This file macro is called one or more times.
  215. X            |.^Each call has been flagged with an error message.
  216. X    24    24| @$@<Teapot@>@Z@{@<deleteme.txt@>@}
  217. X       Error|.................^Calls to file macros are not allowed.
  218. X            |.................^Reason: It should be possible to comment out a
  219. X            |.................^file macro without a big fuss. Calling a file macro
  220. X            |.................^just tangles it up in the macro structure,
  221. X            |.................^making it more difficult to comment out later.
  222. X    25    25| 
  223. X    26    26| 4. Test macro never used and has <special>Z.
  224. X    27    27| @$@<Elephant@>@Z@{@}
  225. X    28    28| 
  226. X    29    29| 5. Test macro often used and has <special>M.
  227. X    30    30| @$@<Giraffe@>@M@{@}
  228. X    31    31| @$@<Use Giraffe@>@Z@{@<Giraffe@>@<Giraffe@>@}
  229. X    32    32| 
  230. X    33    33| 6. Test macro never used and no <special>Z
  231. X    34    34| @$@<Zebra@>@{@}
  232. X       Error|.^This macro is never used (and has no @Z).
  233. X    35    35| 
  234. X    36    36| 7. Test multiply used and no <special>M.
  235. X    37    37| @$@<Monkey@>@{@}
  236. X       Error|.^This macro is used more than once (and has no @M).
  237. X    38    38| @$@<Use Monkey@>@Z@{@<Monkey@>@<Monkey@>@}
  238. X    39    39| 
  239. X    40    40| 8. Test directly recursive macro.
  240. X    41    41| @$@<Who do ya call?@>@{@<Who do ya call?@>@}
  241. X       Error|.^This macro has an infinite expansion.
  242. X    42    42| 
  243. X    43    43| 9. Test indirectly recursive macro.
  244. X    44    44| @$@<X@>@M@{@<Y@>@}
  245. X       Error|.^This macro has an infinite expansion.
  246. X    45    45| @$@<Y@>@{@<X@>@}
  247. X       Error|.^This macro has an infinite expansion.
  248. X    46    46| 
  249. X    47    47| 10. Test callers of recursive macros.
  250. X    48    48| @$@<Z@>@Z@{@<X@>@}
  251. X       Error|.^This macro has an infinite expansion.
  252. X            | <End-Of-File>
  253. X------------+-------------------------------------------------------------------
  254. X
  255. There were 13 Errors.
  256. END_OF_FILE
  257. if test 3720 -ne `wc -c <'answers/an03.lis'`; then
  258.     echo shar: \"'answers/an03.lis'\" unpacked with wrong size!
  259. fi
  260. # end of 'answers/an03.lis'
  261. fi
  262. if test -f 'answers/sc02.lis' -a "${1}" != "-c" ; then 
  263.   echo shar: Will not clobber existing file \"'answers/sc02.lis'\"
  264. else
  265. echo shar: Extracting \"'answers/sc02.lis'\" \(1817 characters\)
  266. sed "s/^X//" >'answers/sc02.lis' <<'END_OF_FILE'
  267. XFUNNELWEB LISTING FILE
  268. X======================
  269. X
  270. Dump of mapped file "<<Suppressed>>".
  271. X
  272. MEMORY DUMP OF MAPPED FILE
  273. X==========================
  274. X
  275. X+-------------------------------------------------+------------------+
  276. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  277. X+-------------------------------------------------+------------------+
  278. X+-------------------------------------------------+------------------+
  279. X
  280. X
  281. X=========================== Start of LINE LIST DUMP ============================
  282. X
  283. Globl Local| Text
  284. X-----------+--------------------------------------------------------------------
  285. X00001 00001| <End-Of-File><010>
  286. X-----------+--------------------------------------------------------------------
  287. Globl Local| Text
  288. X
  289. X============================ End of LINE LIST DUMP =============================
  290. X
  291. X
  292. X=========================== Start of TOKEN LIST DUMP ===========================
  293. X
  294. Summary: There are 1 tokens in the token list.
  295. X
  296. Line[Column]: Token Description
  297. X-------------------------------
  298. X
  299. X0001[01]: End Of File. 
  300. X============================ End of TOKEN LIST DUMP ============================
  301. X
  302. X
  303. X========================== Start of MACRO TABLE DUMP ===========================
  304. X
  305. X
  306. X=========================== End of MACRO TABLE DUMP ============================
  307. X
  308. X
  309. X========================= Start of DOCUMENT LIST DUMP ==========================
  310. X
  311. X
  312. X========================== End of DOCUMENT LIST DUMP ===========================
  313. X
  314. XE: No macros defined.
  315. XE: No output files specified.
  316. X
  317. Global Local| Input File
  318. X------------+-------------------------------------------------------------------
  319. X            | <End-Of-File>
  320. X     Warning|.^Input file is empty (not a byte in syte)!
  321. X------------+-------------------------------------------------------------------
  322. X
  323. There were 2 Errors and 1 Warning.
  324. END_OF_FILE
  325. if test 1817 -ne `wc -c <'answers/sc02.lis'`; then
  326.     echo shar: \"'answers/sc02.lis'\" unpacked with wrong size!
  327. fi
  328. # end of 'answers/sc02.lis'
  329. fi
  330. if test -f 'answers/sc03.lis' -a "${1}" != "-c" ; then 
  331.   echo shar: Will not clobber existing file \"'answers/sc03.lis'\"
  332. else
  333. echo shar: Extracting \"'answers/sc03.lis'\" \(1994 characters\)
  334. sed "s/^X//" >'answers/sc03.lis' <<'END_OF_FILE'
  335. XFUNNELWEB LISTING FILE
  336. X======================
  337. X
  338. Dump of mapped file "<<Suppressed>>".
  339. X
  340. MEMORY DUMP OF MAPPED FILE
  341. X==========================
  342. X
  343. X+-------------------------------------------------+------------------+
  344. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  345. X+-------------------------------------------------+------------------+
  346. X| 0A                                              | .                |
  347. X+-------------------------------------------------+------------------+
  348. X
  349. X
  350. X=========================== Start of LINE LIST DUMP ============================
  351. X
  352. Globl Local| Text
  353. X-----------+--------------------------------------------------------------------
  354. X00001 00001| <010>
  355. X00002 00002| <End-Of-File><010>
  356. X-----------+--------------------------------------------------------------------
  357. Globl Local| Text
  358. X
  359. X============================ End of LINE LIST DUMP =============================
  360. X
  361. X
  362. X=========================== Start of TOKEN LIST DUMP ===========================
  363. X
  364. Summary: There are 2 tokens in the token list.
  365. X
  366. Line[Column]: Token Description
  367. X-------------------------------
  368. X
  369. X0001[01]: Text. Text scrap[White]="<010>
  370. X"
  371. X0002[01]: End Of File. 
  372. X============================ End of TOKEN LIST DUMP ============================
  373. X
  374. X
  375. X========================== Start of MACRO TABLE DUMP ===========================
  376. X
  377. X
  378. X=========================== End of MACRO TABLE DUMP ============================
  379. X
  380. X
  381. X========================= Start of DOCUMENT LIST DUMP ==========================
  382. X
  383. X
  384. TEXT COMPONENT: Pos(L,C)=(1,1). 
  385. X
  386. X-- Start of Text Scrap List --
  387. Text scrap[White]="<010>
  388. X"
  389. X--- End of Text Scrap List ---
  390. X
  391. X
  392. X========================== End of DOCUMENT LIST DUMP ===========================
  393. X
  394. XE: No macros defined.
  395. XE: No output files specified.
  396. X
  397. Global Local| Input File
  398. X------------+-------------------------------------------------------------------
  399. X.................
  400. X------------+-------------------------------------------------------------------
  401. X
  402. There were 2 Errors.
  403. END_OF_FILE
  404. if test 1994 -ne `wc -c <'answers/sc03.lis'`; then
  405.     echo shar: \"'answers/sc03.lis'\" unpacked with wrong size!
  406. fi
  407. # end of 'answers/sc03.lis'
  408. fi
  409. if test -f 'answers/sc04.lis' -a "${1}" != "-c" ; then 
  410.   echo shar: Will not clobber existing file \"'answers/sc04.lis'\"
  411. else
  412. echo shar: Extracting \"'answers/sc04.lis'\" \(2025 characters\)
  413. sed "s/^X//" >'answers/sc04.lis' <<'END_OF_FILE'
  414. XFUNNELWEB LISTING FILE
  415. X======================
  416. X
  417. Dump of mapped file "<<Suppressed>>".
  418. X
  419. MEMORY DUMP OF MAPPED FILE
  420. X==========================
  421. X
  422. X+-------------------------------------------------+------------------+
  423. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  424. X+-------------------------------------------------+------------------+
  425. X| 0A 0A                                           | ..               |
  426. X+-------------------------------------------------+------------------+
  427. X
  428. X
  429. X=========================== Start of LINE LIST DUMP ============================
  430. X
  431. Globl Local| Text
  432. X-----------+--------------------------------------------------------------------
  433. X00001 00001| <010>
  434. X00002 00002| <010>
  435. X00003 00003| <End-Of-File><010>
  436. X-----------+--------------------------------------------------------------------
  437. Globl Local| Text
  438. X
  439. X============================ End of LINE LIST DUMP =============================
  440. X
  441. X
  442. X=========================== Start of TOKEN LIST DUMP ===========================
  443. X
  444. Summary: There are 2 tokens in the token list.
  445. X
  446. Line[Column]: Token Description
  447. X-------------------------------
  448. X
  449. X0001[01]: Text. Text scrap[White]="<010>
  450. X<010>
  451. X"
  452. X0003[01]: End Of File. 
  453. X============================ End of TOKEN LIST DUMP ============================
  454. X
  455. X
  456. X========================== Start of MACRO TABLE DUMP ===========================
  457. X
  458. X
  459. X=========================== End of MACRO TABLE DUMP ============================
  460. X
  461. X
  462. X========================= Start of DOCUMENT LIST DUMP ==========================
  463. X
  464. X
  465. TEXT COMPONENT: Pos(L,C)=(1,1). 
  466. X
  467. X-- Start of Text Scrap List --
  468. Text scrap[White]="<010>
  469. X<010>
  470. X"
  471. X--- End of Text Scrap List ---
  472. X
  473. X
  474. X========================== End of DOCUMENT LIST DUMP ===========================
  475. X
  476. XE: No macros defined.
  477. XE: No output files specified.
  478. X
  479. Global Local| Input File
  480. X------------+-------------------------------------------------------------------
  481. X.................
  482. X------------+-------------------------------------------------------------------
  483. X
  484. There were 2 Errors.
  485. END_OF_FILE
  486. if test 2025 -ne `wc -c <'answers/sc04.lis'`; then
  487.     echo shar: \"'answers/sc04.lis'\" unpacked with wrong size!
  488. fi
  489. # end of 'answers/sc04.lis'
  490. fi
  491. if test -f 'answers/sc05.lis' -a "${1}" != "-c" ; then 
  492.   echo shar: Will not clobber existing file \"'answers/sc05.lis'\"
  493. else
  494. echo shar: Extracting \"'answers/sc05.lis'\" \(2474 characters\)
  495. sed "s/^X//" >'answers/sc05.lis' <<'END_OF_FILE'
  496. XFUNNELWEB LISTING FILE
  497. X======================
  498. X
  499. Dump of mapped file "<<Suppressed>>".
  500. X
  501. MEMORY DUMP OF MAPPED FILE
  502. X==========================
  503. X
  504. X+-------------------------------------------------+------------------+
  505. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  506. X+-------------------------------------------------+------------------+
  507. X| 53 43 30 35 3A 20 54 68 69 73 20 69 6E 70 75 74 | SC05: This input |
  508. X| 20 66 69 6C 65 20 63 6F 6E 74 61 69 6E 73 20 61 |  file contains a |
  509. X| 20 73 69 6E 67 6C 65 20 6C 69 6E 65 20 63 6F 6E |  single line con |
  510. X| 74 61 69 6E 69 6E 67 20 74 68 69 73 20 74 65 78 | taining this tex |
  511. X| 74 21 0A                                        | t!.              |
  512. X+-------------------------------------------------+------------------+
  513. X
  514. X
  515. X=========================== Start of LINE LIST DUMP ============================
  516. X
  517. Globl Local| Text
  518. X-----------+--------------------------------------------------------------------
  519. X00001 00001| SC05: This input file contains a single line containing this text!<010>
  520. X00002 00002| <End-Of-File><010>
  521. X-----------+--------------------------------------------------------------------
  522. Globl Local| Text
  523. X
  524. X============================ End of LINE LIST DUMP =============================
  525. X
  526. X
  527. X=========================== Start of TOKEN LIST DUMP ===========================
  528. X
  529. Summary: There are 2 tokens in the token list.
  530. X
  531. Line[Column]: Token Description
  532. X-------------------------------
  533. X
  534. X0001[01]: Text. Text scrap[Grey]="SC05: This input file contains a single line containing this text!<010>
  535. X"
  536. X0002[01]: End Of File. 
  537. X============================ End of TOKEN LIST DUMP ============================
  538. X
  539. X
  540. X========================== Start of MACRO TABLE DUMP ===========================
  541. X
  542. X
  543. X=========================== End of MACRO TABLE DUMP ============================
  544. X
  545. X
  546. X========================= Start of DOCUMENT LIST DUMP ==========================
  547. X
  548. X
  549. TEXT COMPONENT: Pos(L,C)=(1,1). 
  550. X
  551. X-- Start of Text Scrap List --
  552. Text scrap[Grey]="SC05: This input file contains a single line containing this text!<010>
  553. X"
  554. X--- End of Text Scrap List ---
  555. X
  556. X
  557. X========================== End of DOCUMENT LIST DUMP ===========================
  558. X
  559. XE: No macros defined.
  560. XE: No output files specified.
  561. X
  562. Global Local| Input File
  563. X------------+-------------------------------------------------------------------
  564. X.................
  565. X------------+-------------------------------------------------------------------
  566. X
  567. There were 2 Errors.
  568. END_OF_FILE
  569. if test 2474 -ne `wc -c <'answers/sc05.lis'`; then
  570.     echo shar: \"'answers/sc05.lis'\" unpacked with wrong size!
  571. fi
  572. # end of 'answers/sc05.lis'
  573. fi
  574. if test -f 'answers/sc06.lis' -a "${1}" != "-c" ; then 
  575.   echo shar: Will not clobber existing file \"'answers/sc06.lis'\"
  576. else
  577. echo shar: Extracting \"'answers/sc06.lis'\" \(3423 characters\)
  578. sed "s/^X//" >'answers/sc06.lis' <<'END_OF_FILE'
  579. XFUNNELWEB LISTING FILE
  580. X======================
  581. X
  582. Dump of mapped file "<<Suppressed>>".
  583. X
  584. MEMORY DUMP OF MAPPED FILE
  585. X==========================
  586. X
  587. X+-------------------------------------------------+------------------+
  588. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  589. X+-------------------------------------------------+------------------+
  590. X| 53 43 30 36 3A 20 54 65 73 74 20 46 75 6E 6E 65 | SC06: Test Funne |
  591. X| 6C 57 65 62 20 6F 6E 20 61 20 66 69 6C 65 20 77 | lWeb on a file w |
  592. X| 68 6F 73 65 20 6C 61 73 74 20 6C 69 6E 65 20 69 | hose last line i |
  593. X| 73 20 6E 6F 74 20 74 65 72 6D 69 6E 61 74 65 64 | s not terminated |
  594. X| 20 70 72 6F 70 65 72 6C 79 0A 77 69 74 68 20 61 |  properly.with a |
  595. X| 6E 20 65 6E 64 20 6F 66 20 6C 69 6E 65 20 6D 61 | n end of line ma |
  596. X| 72 6B 65 72 2E 0A 0A 48 65 72 65 20 69 73 20 74 | rker...Here is t |
  597. X| 68 65 20 69 6D 70 72 6F 70 65 72 20 74 65 72 6D | he improper term |
  598. X| 69 6E 61 74 69 6F 6E 21 2D 2D 2D 2D 3E          | ination!---->    |
  599. X+-------------------------------------------------+------------------+
  600. X
  601. X
  602. X=========================== Start of LINE LIST DUMP ============================
  603. X
  604. Globl Local| Text
  605. X-----------+--------------------------------------------------------------------
  606. X00001 00001| SC06: Test FunnelWeb on a file whose last line is not terminated properly<010>
  607. X00002 00002| with an end of line marker.<010>
  608. X00003 00003| <010>
  609. X00004 00004| Here is the improper termination!----><010>
  610. X00005 00005| <End-Of-File><010>
  611. X-----------+--------------------------------------------------------------------
  612. Globl Local| Text
  613. X
  614. X============================ End of LINE LIST DUMP =============================
  615. X
  616. X
  617. X=========================== Start of TOKEN LIST DUMP ===========================
  618. X
  619. Summary: There are 2 tokens in the token list.
  620. X
  621. Line[Column]: Token Description
  622. X-------------------------------
  623. X
  624. X0001[01]: Text. Text scrap[Grey]="SC06: Test FunnelWeb on a file whose last line is not terminated properly<010>
  625. with an end of line marker.<010>
  626. X<010>
  627. Here is the improper termination!----><010>
  628. X"
  629. X0005[01]: End Of File. 
  630. X============================ End of TOKEN LIST DUMP ============================
  631. X
  632. X
  633. X========================== Start of MACRO TABLE DUMP ===========================
  634. X
  635. X
  636. X=========================== End of MACRO TABLE DUMP ============================
  637. X
  638. X
  639. X========================= Start of DOCUMENT LIST DUMP ==========================
  640. X
  641. X
  642. TEXT COMPONENT: Pos(L,C)=(1,1). 
  643. X
  644. X-- Start of Text Scrap List --
  645. Text scrap[Grey]="SC06: Test FunnelWeb on a file whose last line is not terminated properly<010>
  646. with an end of line marker.<010>
  647. X<010>
  648. Here is the improper termination!----><010>
  649. X"
  650. X--- End of Text Scrap List ---
  651. X
  652. X
  653. X========================== End of DOCUMENT LIST DUMP ===========================
  654. X
  655. XE: No macros defined.
  656. XE: No output files specified.
  657. X
  658. Global Local| Input File
  659. X------------+-------------------------------------------------------------------
  660. X     1     1| SC06: Test FunnelWeb on a file whose last line is not terminated properly
  661. X     2     2| with an end of line marker.
  662. X     3     3| 
  663. X     4     4| Here is the improper termination!---->
  664. X            | <End-Of-File>
  665. X     Warning|.^The last line of the input file was terminated by EOF.
  666. X            |.^An EOL was inserted at the end of the last line.
  667. X------------+-------------------------------------------------------------------
  668. X
  669. There were 2 Errors and 1 Warning.
  670. END_OF_FILE
  671. if test 3423 -ne `wc -c <'answers/sc06.lis'`; then
  672.     echo shar: \"'answers/sc06.lis'\" unpacked with wrong size!
  673. fi
  674. # end of 'answers/sc06.lis'
  675. fi
  676. if test -f 'answers/sc08.lis' -a "${1}" != "-c" ; then 
  677.   echo shar: Will not clobber existing file \"'answers/sc08.lis'\"
  678. else
  679. echo shar: Extracting \"'answers/sc08.lis'\" \(4200 characters\)
  680. sed "s/^X//" >'answers/sc08.lis' <<'END_OF_FILE'
  681. XFUNNELWEB LISTING FILE
  682. X======================
  683. X
  684. Dump of mapped file "<<Suppressed>>".
  685. X
  686. MEMORY DUMP OF MAPPED FILE
  687. X==========================
  688. X
  689. X+-------------------------------------------------+------------------+
  690. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  691. X+-------------------------------------------------+------------------+
  692. X| 53 43 30 38 3A 20 44 65 74 65 63 74 69 6F 6E 20 | SC08: Detection  |
  693. X| 6F 66 20 74 72 61 69 6C 69 6E 67 20 73 70 61 63 | of trailing spac |
  694. X| 65 73 2E 0A 0A 54 68 69 73 20 6C 69 6E 65 20 68 | es...This line h |
  695. X| 61 73 20 7A 65 72 6F 20 20 74 72 61 69 6C 69 6E | as zero  trailin |
  696. X| 67 20 73 70 61 63 65 73 20 7C 0A 54 68 69 73 20 | g spaces |.This  |
  697. X| 6C 69 6E 65 20 68 61 73 20 6F 6E 65 20 20 20 74 | line has one   t |
  698. X| 72 61 69 6C 69 6E 67 20 73 70 61 63 65 20 20 7C | railing space  | |
  699. X| 20 0A 54 68 69 73 20 6C 69 6E 65 20 68 61 73 20 |  .This line has  |
  700. X| 74 77 6F 20 20 20 74 72 61 69 6C 69 6E 67 20 73 | two   trailing s |
  701. X| 70 61 63 65 73 20 7C 20 20 0A 54 68 69 73 20 6C | paces |  .This l |
  702. X| 69 6E 65 20 68 61 73 20 74 68 72 65 65 20 74 72 | ine has three tr |
  703. X| 61 69 6C 69 6E 67 20 73 70 61 63 65 73 20 7C 20 | ailing spaces |  |
  704. X| 20 20 0A                                        |   .              |
  705. X+-------------------------------------------------+------------------+
  706. X
  707. X
  708. X=========================== Start of LINE LIST DUMP ============================
  709. X
  710. Globl Local| Text
  711. X-----------+--------------------------------------------------------------------
  712. X00001 00001| SC08: Detection of trailing spaces.<010>
  713. X00002 00002| <010>
  714. X00003 00003| This line has zero  trailing spaces |<010>
  715. X00004 00004| This line has one   trailing space  | <010>
  716. X00005 00005| This line has two   trailing spaces |  <010>
  717. X00006 00006| This line has three trailing spaces |   <010>
  718. X00007 00007| <End-Of-File><010>
  719. X-----------+--------------------------------------------------------------------
  720. Globl Local| Text
  721. X
  722. X============================ End of LINE LIST DUMP =============================
  723. X
  724. X
  725. X=========================== Start of TOKEN LIST DUMP ===========================
  726. X
  727. Summary: There are 2 tokens in the token list.
  728. X
  729. Line[Column]: Token Description
  730. X-------------------------------
  731. X
  732. X0001[01]: Text. Text scrap[Grey]="SC08: Detection of trailing spaces.<010>
  733. X<010>
  734. This line has zero  trailing spaces |<010>
  735. This line has one   trailing space  | <010>
  736. This line has two   trailing spaces |  <010>
  737. This line has three trailing spaces |   <010>
  738. X"
  739. X0007[01]: End Of File. 
  740. X============================ End of TOKEN LIST DUMP ============================
  741. X
  742. X
  743. X========================== Start of MACRO TABLE DUMP ===========================
  744. X
  745. X
  746. X=========================== End of MACRO TABLE DUMP ============================
  747. X
  748. X
  749. X========================= Start of DOCUMENT LIST DUMP ==========================
  750. X
  751. X
  752. TEXT COMPONENT: Pos(L,C)=(1,1). 
  753. X
  754. X-- Start of Text Scrap List --
  755. Text scrap[Grey]="SC08: Detection of trailing spaces.<010>
  756. X<010>
  757. This line has zero  trailing spaces |<010>
  758. This line has one   trailing space  | <010>
  759. This line has two   trailing spaces |  <010>
  760. This line has three trailing spaces |   <010>
  761. X"
  762. X--- End of Text Scrap List ---
  763. X
  764. X
  765. X========================== End of DOCUMENT LIST DUMP ===========================
  766. X
  767. XE: No macros defined.
  768. XE: No output files specified.
  769. X
  770. Global Local| Input File
  771. X------------+-------------------------------------------------------------------
  772. X     1     1| SC08: Detection of trailing spaces.
  773. X     2     2| 
  774. X     3     3| This line has zero  trailing spaces |
  775. X     4     4| This line has one   trailing space  | 
  776. X     Warning|......................................^Line has trailing spaces up to and including this space.
  777. X     5     5| This line has two   trailing spaces |  
  778. X     Warning|.......................................^Line has trailing spaces up to and including this space.
  779. X     6     6| This line has three trailing spaces |   
  780. X     Warning|........................................^Line has trailing spaces up to and including this space.
  781. X            | <End-Of-File>
  782. X------------+-------------------------------------------------------------------
  783. X
  784. There were 2 Errors and 3 Warnings.
  785. END_OF_FILE
  786. if test 4200 -ne `wc -c <'answers/sc08.lis'`; then
  787.     echo shar: \"'answers/sc08.lis'\" unpacked with wrong size!
  788. fi
  789. # end of 'answers/sc08.lis'
  790. fi
  791. if test -f 'answers/sc12.lis' -a "${1}" != "-c" ; then 
  792.   echo shar: Will not clobber existing file \"'answers/sc12.lis'\"
  793. else
  794. echo shar: Extracting \"'answers/sc12.lis'\" \(3243 characters\)
  795. sed "s/^X//" >'answers/sc12.lis' <<'END_OF_FILE'
  796. XFUNNELWEB LISTING FILE
  797. X======================
  798. X
  799. Dump of mapped file "<<Suppressed>>".
  800. X
  801. MEMORY DUMP OF MAPPED FILE
  802. X==========================
  803. X
  804. X+-------------------------------------------------+------------------+
  805. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  806. X+-------------------------------------------------+------------------+
  807. X| 53 43 31 32 3A 20 49 6E 63 6C 75 64 65 20 66 69 | SC12: Include fi |
  808. X| 6C 65 20 63 61 6E 6E 6F 74 20 62 65 20 66 6F 75 | le cannot be fou |
  809. X| 6E 64 2E 0A 54 65 73 74 20 70 65 72 73 6F 6E 3A | nd..Test person: |
  810. X| 20 44 4F 4E 54 20 63 72 65 61 74 65 20 73 63 31 |  DONT create sc1 |
  811. X| 32 61 2E 69 6E 63 2E 20 49 74 20 69 73 20 6E 6F | 2a.inc. It is no |
  812. X| 74 20 73 75 70 70 6F 73 65 64 20 74 6F 20 65 78 | t supposed to ex |
  813. X| 69 73 74 21 0A 54 68 65 20 66 6F 6C 6C 6F 77 69 | ist!.The followi |
  814. X| 6E 67 20 69 6E 63 6C 75 64 65 20 73 68 6F 75 6C | ng include shoul |
  815. X| 64 20 79 69 65 6C 64 20 61 20 22 66 69 6C 65 20 | d yield a "file  |
  816. X| 6E 6F 74 20 66 6F 75 6E 64 20 65 72 72 6F 72 2E | not found error. |
  817. X| 22 0A 0A 40 69 20 73 63 31 32 61 2E 69 6E 63 0A | "..@i sc12a.inc. |
  818. X| 0A                                              | .                |
  819. X+-------------------------------------------------+------------------+
  820. X
  821. X
  822. X=========================== Start of LINE LIST DUMP ============================
  823. X
  824. Globl Local| Text
  825. X-----------+--------------------------------------------------------------------
  826. X00001 00001| SC12: Include file cannot be found.<010>
  827. X00002 00002| Test person: DONT create sc12a.inc. It is not supposed to exist!<010>
  828. X00003 00003| The following include should yield a "file not found error."<010>
  829. X00004 00004| <010>
  830. X00005 00005| @i sc12a.inc<010>
  831. X00006 00006| <010>
  832. X00007 00007| <End-Of-File><010>
  833. X-----------+--------------------------------------------------------------------
  834. Globl Local| Text
  835. X
  836. X============================ End of LINE LIST DUMP =============================
  837. X
  838. X
  839. X=========================== Start of TOKEN LIST DUMP ===========================
  840. X
  841. Summary: There are 3 tokens in the token list.
  842. X
  843. Line[Column]: Token Description
  844. X-------------------------------
  845. X
  846. X0001[01]: Text. Text scrap[Grey]="SC12: Include file cannot be found.<010>
  847. Test person: DONT create sc12a.inc. It is not supposed to exist!<010>
  848. The following include should yield a "file not found error."<010>
  849. X<010>
  850. X"
  851. X0006[01]: Text. Text scrap[White]="<010>
  852. X"
  853. X0007[01]: End Of File. 
  854. X============================ End of TOKEN LIST DUMP ============================
  855. X
  856. Macro table dump skipped (Parser was not invoked).
  857. Document list dump skipped (Parser was not invoked).
  858. X
  859. Global Local| Input File
  860. X------------+-------------------------------------------------------------------
  861. X     1     1| SC12: Include file cannot be found.
  862. X     2     2| Test person: DONT create sc12a.inc. It is not supposed to exist!
  863. X     3     3| The following include should yield a "file not found error."
  864. X     4     4| 
  865. X     5     5| @i sc12a.inc
  866. X       Error|....^Error opening include file.
  867. X            |....^The include file's expanded name was "<<Suppressed>>".
  868. X     6     6| 
  869. X            | <End-Of-File>
  870. X------------+-------------------------------------------------------------------
  871. X
  872. There was 1 Error.
  873. END_OF_FILE
  874. if test 3243 -ne `wc -c <'answers/sc12.lis'`; then
  875.     echo shar: \"'answers/sc12.lis'\" unpacked with wrong size!
  876. fi
  877. # end of 'answers/sc12.lis'
  878. fi
  879. if test -f 'answers/sc19.lis' -a "${1}" != "-c" ; then 
  880.   echo shar: Will not clobber existing file \"'answers/sc19.lis'\"
  881. else
  882. echo shar: Extracting \"'answers/sc19.lis'\" \(3855 characters\)
  883. sed "s/^X//" >'answers/sc19.lis' <<'END_OF_FILE'
  884. XFUNNELWEB LISTING FILE
  885. X======================
  886. X
  887. Dump of mapped file "<<Suppressed>>".
  888. X
  889. MEMORY DUMP OF MAPPED FILE
  890. X==========================
  891. X
  892. X+-------------------------------------------------+------------------+
  893. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  894. X+-------------------------------------------------+------------------+
  895. X| 53 43 31 39 3A 20 54 65 73 74 20 3C 73 70 65 63 | SC19: Test <spec |
  896. X| 69 61 6C 3E 2D 0A 0A 31 2E 20 54 65 73 74 20 74 | ial>-..1. Test t |
  897. X| 68 61 74 20 65 72 72 6F 72 20 69 73 20 66 6C 61 | hat error is fla |
  898. X| 67 67 65 64 20 69 66 20 73 65 71 75 65 6E 63 65 | gged if sequence |
  899. X| 20 69 73 20 6E 6F 74 20 61 74 20 74 68 65 20 65 |  is not at the e |
  900. X| 6E 64 20 6F 66 20 61 20 6C 69 6E 65 2E 0A 0A 54 | nd of a line...T |
  901. X| 68 69 73 20 69 73 20 61 20 6C 69 6E 65 20 63 6F | his is a line co |
  902. X| 6E 74 61 69 6E 69 6E 67 20 40 2D 20 74 68 65 20 | ntaining @- the  |
  903. X| 65 6E 64 20 6F 66 20 6C 69 6E 65 20 73 75 70 70 | end of line supp |
  904. X| 72 65 73 73 6F 72 2E 0A 0A 32 2E 20 54 65 73 74 | ressor...2. Test |
  905. X| 20 74 68 65 20 73 65 71 75 65 6E 63 65 20 66 6F |  the sequence fo |
  906. X| 6C 6C 6F 77 65 64 20 62 79 20 74 72 61 69 6C 69 | llowed by traili |
  907. X| 6E 67 20 62 6C 61 6E 6B 73 2E 0A 0A 20 20 20 20 | ng blanks...     |
  908. X| 20 40 2D 20 20 20 0A 0A                         |  @-   ..         |
  909. X+-------------------------------------------------+------------------+
  910. X
  911. X
  912. X=========================== Start of LINE LIST DUMP ============================
  913. X
  914. Globl Local| Text
  915. X-----------+--------------------------------------------------------------------
  916. X00001 00001| SC19: Test <special>-<010>
  917. X00002 00002| <010>
  918. X00003 00003| 1. Test that error is flagged if sequence is not at the end of a line.<010>
  919. X00004 00004| <010>
  920. X00005 00005| This is a line containing @- the end of line suppressor.<010>
  921. X00006 00006| <010>
  922. X00007 00007| 2. Test the sequence followed by trailing blanks.<010>
  923. X00008 00008| <010>
  924. X00009 00009|      @-   <010>
  925. X00010 00010| <010>
  926. X00011 00011| <End-Of-File><010>
  927. X-----------+--------------------------------------------------------------------
  928. Globl Local| Text
  929. X
  930. X============================ End of LINE LIST DUMP =============================
  931. X
  932. X
  933. X=========================== Start of TOKEN LIST DUMP ===========================
  934. X
  935. Summary: There are 4 tokens in the token list.
  936. X
  937. Line[Column]: Token Description
  938. X-------------------------------
  939. X
  940. X0001[01]: Text. Text scrap[Grey]="SC19: Test <special>-<010>
  941. X<010>
  942. X1. Test that error is flagged if sequence is not at the end of a line.<010>
  943. X<010>
  944. This is a line containing "
  945. X0005[29]: Text. Text scrap[Grey]=" the end of line suppressor.<010>
  946. X<010>
  947. X2. Test the sequence followed by trailing blanks.<010>
  948. X<010>
  949. X     "
  950. X0009[08]: Text. Text scrap[White]="   <010>
  951. X<010>
  952. X"
  953. X0011[01]: End Of File. 
  954. X============================ End of TOKEN LIST DUMP ============================
  955. X
  956. Macro table dump skipped (Parser was not invoked).
  957. Document list dump skipped (Parser was not invoked).
  958. X
  959. Global Local| Input File
  960. X------------+-------------------------------------------------------------------
  961. X     1     1| SC19: Test <special>-
  962. X     2     2| 
  963. X     3     3| 1. Test that error is flagged if sequence is not at the end of a line.
  964. X     4     4| 
  965. X     5     5| This is a line containing @- the end of line suppressor.
  966. X       Error|...........................^Suppress EOL sequence is legal only at the end of a line.
  967. X     6     6| 
  968. X     7     7| 2. Test the sequence followed by trailing blanks.
  969. X     8     8| 
  970. X     9     9|      @-   
  971. X       Error|......^Suppress EOL sequence is legal only at the end of a line.
  972. X     Warning|..........^Line has trailing spaces up to and including this space.
  973. X    10    10| 
  974. X            | <End-Of-File>
  975. X------------+-------------------------------------------------------------------
  976. X
  977. There were 2 Errors and 1 Warning.
  978. END_OF_FILE
  979. if test 3855 -ne `wc -c <'answers/sc19.lis'`; then
  980.     echo shar: \"'answers/sc19.lis'\" unpacked with wrong size!
  981. fi
  982. # end of 'answers/sc19.lis'
  983. fi
  984. if test -f 'answers/sc20.lis' -a "${1}" != "-c" ; then 
  985.   echo shar: Will not clobber existing file \"'answers/sc20.lis'\"
  986. else
  987. echo shar: Extracting \"'answers/sc20.lis'\" \(3985 characters\)
  988. sed "s/^X//" >'answers/sc20.lis' <<'END_OF_FILE'
  989. XFUNNELWEB LISTING FILE
  990. X======================
  991. X
  992. Dump of mapped file "<<Suppressed>>".
  993. X
  994. MEMORY DUMP OF MAPPED FILE
  995. X==========================
  996. X
  997. X+-------------------------------------------------+------------------+
  998. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  999. X+-------------------------------------------------+------------------+
  1000. X| 53 43 32 30 3A 20 54 65 73 74 20 40 21 0A 0A 31 | SC20: Test @!..1 |
  1001. X| 2E 20 54 65 73 74 20 61 74 20 74 68 65 20 73 74 | . Test at the st |
  1002. X| 61 72 74 20 6F 66 20 61 20 6C 69 6E 65 2E 0A 0A | art of a line... |
  1003. X| 40 21 20 54 68 69 73 20 69 73 20 61 20 63 6F 6D | @! This is a com |
  1004. X| 6D 65 6E 74 20 61 6E 64 20 77 65 20 63 61 6E 20 | ment and we can  |
  1005. X| 73 74 69 63 6B 20 61 6E 79 20 73 6F 72 74 20 6F | stick any sort o |
  1006. X| 66 20 72 75 62 62 69 73 68 20 69 6E 20 69 74 2E | f rubbish in it. |
  1007. X| 0A 40 21 20 40 23 20 40 69 20 40 5E 64 73 3B 61 | .@! @# @i @^ds;a |
  1008. X| 66 3B 6C 73 64 6D 66 3B 6C 61 6E 64 20 6F 74 68 | f;lsdmf;land oth |
  1009. X| 65 72 20 40 20 72 75 62 62 69 73 68 2E 0A 0A 32 | er @ rubbish...2 |
  1010. X| 2E 20 54 65 73 74 20 68 61 6C 66 77 61 79 20 74 | . Test halfway t |
  1011. X| 68 72 6F 75 67 68 20 61 20 6C 69 6E 65 2E 0A 0A | hrough a line... |
  1012. X| 54 68 69 73 20 69 73 20 61 20 6C 69 6E 65 20 40 | This is a line @ |
  1013. X| 21 20 77 68 6F 73 65 20 73 65 63 6F 6E 64 20 68 | ! whose second h |
  1014. X| 61 6C 66 20 6E 65 76 65 72 20 73 65 65 73 20 74 | alf never sees t |
  1015. X| 68 65 20 64 61 79 6C 69 67 68 74 2E 20 40 69 20 | he daylight. @i  |
  1016. X| 40 3C 0A 0A                                     | @<..             |
  1017. X+-------------------------------------------------+------------------+
  1018. X
  1019. X
  1020. X=========================== Start of LINE LIST DUMP ============================
  1021. X
  1022. Globl Local| Text
  1023. X-----------+--------------------------------------------------------------------
  1024. X00001 00001| SC20: Test @!<010>
  1025. X00002 00002| <010>
  1026. X00003 00003| 1. Test at the start of a line.<010>
  1027. X00004 00004| <010>
  1028. X00005 00005| @! This is a comment and we can stick any sort of rubbish in it.<010>
  1029. X00006 00006| @! @# @i @^ds;af;lsdmf;land other @ rubbish.<010>
  1030. X00007 00007| <010>
  1031. X00008 00008| 2. Test halfway through a line.<010>
  1032. X00009 00009| <010>
  1033. X00010 00010| This is a line @! whose second half never sees the daylight. @i @<<010>
  1034. X00011 00011| <010>
  1035. X00012 00012| <End-Of-File><010>
  1036. X-----------+--------------------------------------------------------------------
  1037. Globl Local| Text
  1038. X
  1039. X============================ End of LINE LIST DUMP =============================
  1040. X
  1041. X
  1042. X=========================== Start of TOKEN LIST DUMP ===========================
  1043. X
  1044. Summary: There are 5 tokens in the token list.
  1045. X
  1046. Line[Column]: Token Description
  1047. X-------------------------------
  1048. X
  1049. X0001[01]: Text. Text scrap[Grey]="SC20: Test "
  1050. X0002[01]: Text. Text scrap[Grey]="<010>
  1051. X1. Test at the start of a line.<010>
  1052. X<010>
  1053. X"
  1054. X0007[01]: Text. Text scrap[Grey]="<010>
  1055. X2. Test halfway through a line.<010>
  1056. X<010>
  1057. This is a line "
  1058. X0011[01]: Text. Text scrap[White]="<010>
  1059. X"
  1060. X0012[01]: End Of File. 
  1061. X============================ End of TOKEN LIST DUMP ============================
  1062. X
  1063. X
  1064. X========================== Start of MACRO TABLE DUMP ===========================
  1065. X
  1066. X
  1067. X=========================== End of MACRO TABLE DUMP ============================
  1068. X
  1069. X
  1070. X========================= Start of DOCUMENT LIST DUMP ==========================
  1071. X
  1072. X
  1073. TEXT COMPONENT: Pos(L,C)=(1,1). 
  1074. X
  1075. X-- Start of Text Scrap List --
  1076. Text scrap[Grey]="SC20: Test "
  1077. Text scrap[Grey]="<010>
  1078. X1. Test at the start of a line.<010>
  1079. X<010>
  1080. X"
  1081. Text scrap[Grey]="<010>
  1082. X2. Test halfway through a line.<010>
  1083. X<010>
  1084. This is a line "
  1085. Text scrap[White]="<010>
  1086. X"
  1087. X--- End of Text Scrap List ---
  1088. X
  1089. X
  1090. X========================== End of DOCUMENT LIST DUMP ===========================
  1091. X
  1092. XE: No macros defined.
  1093. XE: No output files specified.
  1094. X
  1095. Global Local| Input File
  1096. X------------+-------------------------------------------------------------------
  1097. X.................
  1098. X------------+-------------------------------------------------------------------
  1099. X
  1100. There were 2 Errors.
  1101. END_OF_FILE
  1102. if test 3985 -ne `wc -c <'answers/sc20.lis'`; then
  1103.     echo shar: \"'answers/sc20.lis'\" unpacked with wrong size!
  1104. fi
  1105. # end of 'answers/sc20.lis'
  1106. fi
  1107. if test -f 'answers/sc25.lis' -a "${1}" != "-c" ; then 
  1108.   echo shar: Will not clobber existing file \"'answers/sc25.lis'\"
  1109. else
  1110. echo shar: Extracting \"'answers/sc25.lis'\" \(3489 characters\)
  1111. sed "s/^X//" >'answers/sc25.lis' <<'END_OF_FILE'
  1112. XFUNNELWEB LISTING FILE
  1113. X======================
  1114. X
  1115. Dump of mapped file "<<Suppressed>>".
  1116. X
  1117. MEMORY DUMP OF MAPPED FILE
  1118. X==========================
  1119. X
  1120. X+-------------------------------------------------+------------------+
  1121. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  1122. X+-------------------------------------------------+------------------+
  1123. X| 53 43 32 35 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC25: Test synta |
  1124. X| 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 6E 65 | x checking of ne |
  1125. X| 77 20 70 61 67 65 20 74 79 70 65 73 65 74 74 65 | w page typesette |
  1126. X| 72 20 64 69 72 65 63 74 69 76 65 2E 0A 0A 31 2E | r directive...1. |
  1127. X| 20 4D 61 6B 65 20 73 75 72 65 20 74 68 61 74 20 |  Make sure that  |
  1128. X| 61 20 6C 65 67 61 6C 20 6E 65 77 20 70 61 67 65 | a legal new page |
  1129. X| 20 64 69 72 65 63 74 69 76 65 20 69 73 20 4F 4B |  directive is OK |
  1130. X| 2E 0A 40 74 20 6E 65 77 5F 70 61 67 65 0A 0A 32 | ..@t new_page..2 |
  1131. X| 2E 20 43 68 65 63 6B 20 74 68 61 74 20 69 74 20 | . Check that it  |
  1132. X| 64 6F 65 73 6E 27 74 20 73 74 61 6E 64 20 66 6F | doesn't stand fo |
  1133. X| 72 20 61 6E 79 20 6E 6F 6E 73 65 6E 73 65 2E 0A | r any nonsense.. |
  1134. X| 40 74 20 6E 65 77 5F 70 61 67 65 20 6E 6F 6E 73 | @t new_page nons |
  1135. X| 65 6E 73 65 0A 0A                               | ense..           |
  1136. X+-------------------------------------------------+------------------+
  1137. X
  1138. X
  1139. X=========================== Start of LINE LIST DUMP ============================
  1140. X
  1141. Globl Local| Text
  1142. X-----------+--------------------------------------------------------------------
  1143. X00001 00001| SC25: Test syntax checking of new page typesetter directive.<010>
  1144. X00002 00002| <010>
  1145. X00003 00003| 1. Make sure that a legal new page directive is OK.<010>
  1146. X00004 00004| @t new_page<010>
  1147. X00005 00005| <010>
  1148. X00006 00006| 2. Check that it doesn't stand for any nonsense.<010>
  1149. X00007 00007| @t new_page nonsense<010>
  1150. X00008 00008| <010>
  1151. X00009 00009| <End-Of-File><010>
  1152. X-----------+--------------------------------------------------------------------
  1153. Globl Local| Text
  1154. X
  1155. X============================ End of LINE LIST DUMP =============================
  1156. X
  1157. X
  1158. X=========================== Start of TOKEN LIST DUMP ===========================
  1159. X
  1160. Summary: There are 5 tokens in the token list.
  1161. X
  1162. Line[Column]: Token Description
  1163. X-------------------------------
  1164. X
  1165. X0001[01]: Text. Text scrap[Grey]="SC25: Test syntax checking of new page typesetter directive.<010>
  1166. X<010>
  1167. X1. Make sure that a legal new page directive is OK.<010>
  1168. X"
  1169. X0004[01]: @t.. Newpage. 
  1170. X0005[01]: Text. Text scrap[Grey]="<010>
  1171. X2. Check that it doesn't stand for any nonsense.<010>
  1172. X"
  1173. X0008[01]: Text. Text scrap[White]="<010>
  1174. X"
  1175. X0009[01]: End Of File. 
  1176. X============================ End of TOKEN LIST DUMP ============================
  1177. X
  1178. Macro table dump skipped (Parser was not invoked).
  1179. Document list dump skipped (Parser was not invoked).
  1180. X
  1181. Global Local| Input File
  1182. X------------+-------------------------------------------------------------------
  1183. X     1     1| SC25: Test syntax checking of new page typesetter directive.
  1184. X     2     2| 
  1185. X     3     3| 1. Make sure that a legal new page directive is OK.
  1186. X     4     4| @t new_page
  1187. X     5     5| 
  1188. X     6     6| 2. Check that it doesn't stand for any nonsense.
  1189. X     7     7| @t new_page nonsense
  1190. X       Error|.............^The new_page directive does not take arguments.
  1191. X            |.............^Directive ignored.
  1192. X     8     8| 
  1193. X            | <End-Of-File>
  1194. X------------+-------------------------------------------------------------------
  1195. X
  1196. There was 1 Error.
  1197. END_OF_FILE
  1198. if test 3489 -ne `wc -c <'answers/sc25.lis'`; then
  1199.     echo shar: \"'answers/sc25.lis'\" unpacked with wrong size!
  1200. fi
  1201. # end of 'answers/sc25.lis'
  1202. fi
  1203. if test -f 'answers/sc26.lis' -a "${1}" != "-c" ; then 
  1204.   echo shar: Will not clobber existing file \"'answers/sc26.lis'\"
  1205. else
  1206. echo shar: Extracting \"'answers/sc26.lis'\" \(3738 characters\)
  1207. sed "s/^X//" >'answers/sc26.lis' <<'END_OF_FILE'
  1208. XFUNNELWEB LISTING FILE
  1209. X======================
  1210. X
  1211. Dump of mapped file "<<Suppressed>>".
  1212. X
  1213. MEMORY DUMP OF MAPPED FILE
  1214. X==========================
  1215. X
  1216. X+-------------------------------------------------+------------------+
  1217. X| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | 0123456789ABCDEF |
  1218. X+-------------------------------------------------+------------------+
  1219. X| 53 43 32 36 3A 20 54 65 73 74 20 73 79 6E 74 61 | SC26: Test synta |
  1220. X| 78 20 63 68 65 63 6B 69 6E 67 20 6F 66 20 74 61 | x checking of ta |
  1221. X| 62 6C 65 20 6F 66 20 63 6F 6E 74 65 6E 74 73 20 | ble of contents  |
  1222. X| 74 79 70 65 73 65 74 74 69 6E 67 20 70 72 61 67 | typesetting prag |
  1223. X| 6D 61 2E 0A 0A 31 2E 20 4D 61 6B 65 20 73 75 72 | ma...1. Make sur |
  1224. X| 65 20 74 68 61 74 20 61 20 6C 65 67 61 6C 20 74 | e that a legal t |
  1225. X| 61 62 6C 65 20 6F 66 20 63 6F 6E 74 65 6E 74 73 | able of contents |
  1226. X| 20 64 69 72 65 63 74 69 76 65 20 69 73 20 4F 4B |  directive is OK |
  1227. X| 2E 0A 40 74 20 74 61 62 6C 65 5F 6F 66 5F 63 6F | ..@t table_of_co |
  1228. X| 6E 74 65 6E 74 73 0A 0A 32 2E 20 43 68 65 63 6B | ntents..2. Check |
  1229. X| 20 74 68 61 74 20 69 74 20 64 6F 65 73 6E 27 74 |  that it doesn't |
  1230. X| 20 73 74 61 6E 64 20 66 6F 72 20 61 6E 79 20 6E |  stand for any n |
  1231. X| 6F 6E 73 65 6E 73 65 2E 0A 40 74 20 74 61 62 6C | onsense..@t tabl |
  1232. X| 65 5F 6F 66 5F 63 6F 6E 74 65 6E 74 73 20 6E 6F | e_of_contents no |
  1233. X| 6E 73 65 6E 73 65 0A 0A                         | nsense..         |
  1234. X+-------------------------------------------------+------------------+
  1235. X
  1236. X
  1237. X=========================== Start of LINE LIST DUMP ============================
  1238. X
  1239. Globl Local| Text
  1240. X-----------+--------------------------------------------------------------------
  1241. X00001 00001| SC26: Test syntax checking of table of contents typesetting pragma.<010>
  1242. X00002 00002| <010>
  1243. X00003 00003| 1. Make sure that a legal table of contents directive is OK.<010>
  1244. X00004 00004| @t table_of_contents<010>
  1245. X00005 00005| <010>
  1246. X00006 00006| 2. Check that it doesn't stand for any nonsense.<010>
  1247. X00007 00007| @t table_of_contents nonsense<010>
  1248. X00008 00008| <010>
  1249. X00009 00009| <End-Of-File><010>
  1250. X-----------+--------------------------------------------------------------------
  1251. Globl Local| Text
  1252. X
  1253. X============================ End of LINE LIST DUMP =============================
  1254. X
  1255. X
  1256. X=========================== Start of TOKEN LIST DUMP ===========================
  1257. X
  1258. Summary: There are 5 tokens in the token list.
  1259. X
  1260. Line[Column]: Token Description
  1261. X-------------------------------
  1262. X
  1263. X0001[01]: Text. Text scrap[Grey]="SC26: Test syntax checking of table of contents typesetting pragma.<010>
  1264. X<010>
  1265. X1. Make sure that a legal table of contents directive is OK.<010>
  1266. X"
  1267. X0004[01]: @t.. TOC. 
  1268. X0005[01]: Text. Text scrap[Grey]="<010>
  1269. X2. Check that it doesn't stand for any nonsense.<010>
  1270. X"
  1271. X0008[01]: Text. Text scrap[White]="<010>
  1272. X"
  1273. X0009[01]: End Of File. 
  1274. X============================ End of TOKEN LIST DUMP ============================
  1275. X
  1276. Macro table dump skipped (Parser was not invoked).
  1277. Document list dump skipped (Parser was not invoked).
  1278. X
  1279. Global Local| Input File
  1280. X------------+-------------------------------------------------------------------
  1281. X     1     1| SC26: Test syntax checking of table of contents typesetting pragma.
  1282. X     2     2| 
  1283. X     3     3| 1. Make sure that a legal table of contents directive is OK.
  1284. X     4     4| @t table_of_contents
  1285. X     5     5| 
  1286. X     6     6| 2. Check that it doesn't stand for any nonsense.
  1287. X     7     7| @t table_of_contents nonsense
  1288. X       Error|......................^The table_of_contents directive does not take arguments.
  1289. X            |......................^Directive ignored.
  1290. X     8     8| 
  1291. X            | <End-Of-File>
  1292. X------------+-------------------------------------------------------------------
  1293. X
  1294. There was 1 Error.
  1295. END_OF_FILE
  1296. if test 3738 -ne `wc -c <'answers/sc26.lis'`; then
  1297.     echo shar: \"'answers/sc26.lis'\" unpacked with wrong size!
  1298. fi
  1299. # end of 'answers/sc26.lis'
  1300. fi
  1301. if test -f 'hackman/h_manual.toc' -a "${1}" != "-c" ; then 
  1302.   echo shar: Will not clobber existing file \"'hackman/h_manual.toc'\"
  1303. else
  1304. echo shar: Extracting \"'hackman/h_manual.toc'\" \(4096 characters\)
  1305. sed "s/^X//" >'hackman/h_manual.toc' <<'END_OF_FILE'
  1306. X\contentsline {chapter}{Preface}{5}
  1307. X\contentsline {chapter}{Acknowledgements}{7}
  1308. X\contentsline {chapter}{Presentation Notes}{9}
  1309. X\contentsline {chapter}{\numberline {1}FunnelWeb Design}{11}
  1310. X\contentsline {section}{\numberline {1.1}Motivation for FunnelWeb}{11}
  1311. X\contentsline {section}{\numberline {1.2}Indentation}{12}
  1312. X\contentsline {section}{\numberline {1.3}Review of FunnelWeb Syntax}{14}
  1313. X\contentsline {subsection}{\numberline {1.3.1}Review of Macro Definition Syntax}{14}
  1314. X\contentsline {subsection}{\numberline {1.3.2}Review of Macro Call Syntax}{16}
  1315. X\contentsline {subsection}{\numberline {1.3.3}Review of Parameterized Macro Call Syntax}{16}
  1316. X\contentsline {section}{\numberline {1.4}Document Structuring}{16}
  1317. X\contentsline {section}{\numberline {1.5}Discussion of Some Miscellaneous Issues}{18}
  1318. X\contentsline {section}{\numberline {1.6}Automated Regression Testing}{18}
  1319. X\contentsline {section}{\numberline {1.7}Command Line Interface}{18}
  1320. X\contentsline {section}{\numberline {1.8}File Name Management}{19}
  1321. X\contentsline {subsection}{\numberline {1.8.1}Filename Extensions}{20}
  1322. X\contentsline {subsection}{\numberline {1.8.2}Filename Inheritance}{20}
  1323. X\contentsline {subsection}{\numberline {1.8.3}Portable Structure of File Names}{21}
  1324. X\contentsline {section}{\numberline {1.9}Specifying Constraints on the Number of Instantiations}{22}
  1325. X\contentsline {section}{\numberline {1.10}The Relationship Between Document Structure and Macro Structure}{23}
  1326. X\contentsline {section}{\numberline {1.11}Diagnostic Messages}{25}
  1327. X\contentsline {section}{\numberline {1.12}Summary}{25}
  1328. X\contentsline {chapter}{\numberline {2}FunnelWeb Implementation}{27}
  1329. X\contentsline {section}{\numberline {2.1}Introduction}{27}
  1330. X\contentsline {section}{\numberline {2.2}History of FunnelWeb Implementations}{27}
  1331. X\contentsline {section}{\numberline {2.3}Why FunnelWeb Wasn't Used to Write Itself}{28}
  1332. X\contentsline {section}{\numberline {2.4}Coding Style}{28}
  1333. X\contentsline {section}{\numberline {2.5}Use of Memory}{29}
  1334. X\contentsline {section}{\numberline {2.6}The Heap}{29}
  1335. X\contentsline {section}{\numberline {2.7}The Stack}{30}
  1336. X\contentsline {section}{\numberline {2.8}Static Variables}{30}
  1337. X\contentsline {section}{\numberline {2.9}Implementing Text Indentation}{30}
  1338. X\contentsline {chapter}{\numberline {3}FunnelWeb Modification}{35}
  1339. X\contentsline {section}{\numberline {3.1}Introduction}{35}
  1340. X\contentsline {section}{\numberline {3.2}The Danger of Modifying Languages}{35}
  1341. X\contentsline {section}{\numberline {3.3}Authority vs User Security}{36}
  1342. X\contentsline {section}{\numberline {3.4}What I Want to Protect}{37}
  1343. X\contentsline {section}{\numberline {3.5}Modifying the Manuals}{38}
  1344. X\contentsline {section}{\numberline {3.6}How Copyright Law Works}{38}
  1345. X\contentsline {section}{\numberline {3.7}Management of the Official FunnelWeb}{39}
  1346. X\contentsline {section}{\numberline {3.8}A GNU Version?}{41}
  1347. X\contentsline {section}{\numberline {3.9}Summary}{41}
  1348. X\contentsline {chapter}{\numberline {4}FunnelWeb Future}{43}
  1349. X\contentsline {section}{\numberline {4.1}Documentation}{43}
  1350. X\contentsline {section}{\numberline {4.2}Command Line Interface}{43}
  1351. X\contentsline {section}{\numberline {4.3}Shell Interpreter}{43}
  1352. X\contentsline {section}{\numberline {4.4}Language Design}{44}
  1353. X\contentsline {section}{\numberline {4.5}Scanner/Mapper}{44}
  1354. X\contentsline {section}{\numberline {4.6}Parser}{45}
  1355. X\contentsline {section}{\numberline {4.7}Analyser}{45}
  1356. X\contentsline {section}{\numberline {4.8}Tangle}{45}
  1357. X\contentsline {section}{\numberline {4.9}Weave}{45}
  1358. X\contentsline {section}{\numberline {4.10}Lister}{46}
  1359. X\contentsline {section}{\numberline {4.11}Diagnostics}{47}
  1360. X\contentsline {section}{\numberline {4.12}Speed}{47}
  1361. X\contentsline {section}{\numberline {4.13}Correctness}{47}
  1362. X\contentsline {section}{\numberline {4.14}Test Suite}{47}
  1363. X\contentsline {section}{\numberline {4.15}Machine-Specific Changes}{48}
  1364. X\contentsline {section}{\numberline {4.16}Summary}{48}
  1365. X\contentsline {chapter}{\numberline {A}GNU General Public License Version 2}{49}
  1366. X\contentsline {chapter}{\numberline {B}References}{57}
  1367. X\contentsline {chapter}{Index}{57}
  1368. END_OF_FILE
  1369. if test 4096 -ne `wc -c <'hackman/h_manual.toc'`; then
  1370.     echo shar: \"'hackman/h_manual.toc'\" unpacked with wrong size!
  1371. fi
  1372. # end of 'hackman/h_manual.toc'
  1373. fi
  1374. if test -f 'sources/analyse.h' -a "${1}" != "-c" ; then 
  1375.   echo shar: Will not clobber existing file \"'sources/analyse.h'\"
  1376. else
  1377. echo shar: Extracting \"'sources/analyse.h'\" \(2852 characters\)
  1378. sed "s/^X//" >'sources/analyse.h' <<'END_OF_FILE'
  1379. X/*##############################################################################
  1380. X
  1381. XFUNNNELWEB COPYRIGHT
  1382. X====================
  1383. XFunnelWeb is a literate-programming macro preprocessor.
  1384. X
  1385. Copyright (C) 1992 Ross N. Williams.
  1386. X
  1387. X   Ross N. Williams
  1388. X   ross@spam.adelaide.edu.au
  1389. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  1390. X
  1391. This program is free software; you can redistribute it and/or modify
  1392. it under the terms of Version 2 of the GNU General Public License as
  1393. published by the Free Software Foundation.
  1394. X
  1395. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  1396. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1397. See Version 2 of the GNU General Public License for more details.
  1398. X
  1399. You should have received a copy of Version 2 of the GNU General Public
  1400. License along with this program. If not, you can FTP the license from
  1401. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  1402. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1403. X
  1404. Section 2a of the license requires that all changes to this file be
  1405. recorded prominently in this file. Please record all changes here.
  1406. X
  1407. Programmers:
  1408. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  1409. X
  1410. Changes:
  1411. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  1412. X
  1413. X##############################################################################*/
  1414. X
  1415. X
  1416. X/******************************************************************************/
  1417. X/*                                   ANALYSE.H                                */
  1418. X/******************************************************************************/
  1419. X/*                                                                            */
  1420. X/* This package exports a single function called analyse() that should be     */
  1421. X/* invoked just after the parser has finished. The scanner and parser         */
  1422. X/* serve only to construct a structured representation of the input file in   */
  1423. X/* memory; they do not critique it beyond syntax. In contrast, analyse()      */
  1424. X/* analyses the representation, checking it for "semantic" errors.  Any       */
  1425. X/* problems that are found are sent to the lister package with appropriate    */
  1426. X/* positioning information so that the messages appear at exactly the right   */
  1427. X/* spot in the listing.                                                       */
  1428. X/*                                                                            */
  1429. X/******************************************************************************/
  1430. X
  1431. X#include "style.h"
  1432. X
  1433. X/******************************************************************************/
  1434. X
  1435. XEXPORT void analyse P_((void));
  1436. X
  1437. X/******************************************************************************/
  1438. X/*                               End of ANALYSE.H                             */
  1439. X/******************************************************************************/
  1440. END_OF_FILE
  1441. if test 2852 -ne `wc -c <'sources/analyse.h'`; then
  1442.     echo shar: \"'sources/analyse.h'\" unpacked with wrong size!
  1443. fi
  1444. # end of 'sources/analyse.h'
  1445. fi
  1446. if test -f 'sources/as.c' -a "${1}" != "-c" ; then 
  1447.   echo shar: Will not clobber existing file \"'sources/as.c'\"
  1448. else
  1449. echo shar: Extracting \"'sources/as.c'\" \(2208 characters\)
  1450. sed "s/^X//" >'sources/as.c' <<'END_OF_FILE'
  1451. X/*##############################################################################
  1452. X
  1453. XFUNNNELWEB COPYRIGHT
  1454. X====================
  1455. XFunnelWeb is a literate-programming macro preprocessor.
  1456. X
  1457. Copyright (C) 1992 Ross N. Williams.
  1458. X
  1459. X   Ross N. Williams
  1460. X   ross@spam.adelaide.edu.au
  1461. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  1462. X
  1463. This program is free software; you can redistribute it and/or modify
  1464. it under the terms of Version 2 of the GNU General Public License as
  1465. published by the Free Software Foundation.
  1466. X
  1467. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  1468. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1469. See Version 2 of the GNU General Public License for more details.
  1470. X
  1471. You should have received a copy of Version 2 of the GNU General Public
  1472. License along with this program. If not, you can FTP the license from
  1473. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  1474. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1475. X
  1476. Section 2a of the license requires that all changes to this file be
  1477. recorded prominently in this file. Please record all changes here.
  1478. X
  1479. Programmers:
  1480. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  1481. X
  1482. Changes:
  1483. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  1484. X
  1485. X##############################################################################*/
  1486. X
  1487. X
  1488. X/******************************************************************************/
  1489. X/*                                      AS.C                                  */
  1490. X/******************************************************************************/
  1491. X
  1492. X#include "style.h"
  1493. X
  1494. X#include "as.h"
  1495. X#include "machin.h"
  1496. X
  1497. X/******************************************************************************/
  1498. X
  1499. XEXPORT void as_bomb(message)
  1500. char *message;
  1501. X{
  1502. X fprintf(stderr,"%s\n",message);
  1503. X fprintf(stderr,"An assertion has failed! See the line above.\n");
  1504. X fprintf(stderr,"Press return to abort FunnelWeb>\n"); (void) getchar();
  1505. X exit(EXIT_FAILURE);
  1506. X}
  1507. X
  1508. X/******************************************************************************/
  1509. X/*                                     AS.C                                   */
  1510. X/******************************************************************************/
  1511. END_OF_FILE
  1512. if test 2208 -ne `wc -c <'sources/as.c'`; then
  1513.     echo shar: \"'sources/as.c'\" unpacked with wrong size!
  1514. fi
  1515. # end of 'sources/as.c'
  1516. fi
  1517. if test -f 'sources/clock.c' -a "${1}" != "-c" ; then 
  1518.   echo shar: Will not clobber existing file \"'sources/clock.c'\"
  1519. else
  1520. echo shar: Extracting \"'sources/clock.c'\" \(3834 characters\)
  1521. sed "s/^X//" >'sources/clock.c' <<'END_OF_FILE'
  1522. X/*##############################################################################
  1523. X
  1524. XFUNNNELWEB COPYRIGHT
  1525. X====================
  1526. XFunnelWeb is a literate-programming macro preprocessor.
  1527. X
  1528. Copyright (C) 1992 Ross N. Williams.
  1529. X
  1530. X   Ross N. Williams
  1531. X   ross@spam.adelaide.edu.au
  1532. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  1533. X
  1534. This program is free software; you can redistribute it and/or modify
  1535. it under the terms of Version 2 of the GNU General Public License as
  1536. published by the Free Software Foundation.
  1537. X
  1538. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  1539. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1540. See Version 2 of the GNU General Public License for more details.
  1541. X
  1542. You should have received a copy of Version 2 of the GNU General Public
  1543. License along with this program. If not, you can FTP the license from
  1544. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  1545. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1546. X
  1547. Section 2a of the license requires that all changes to this file be
  1548. recorded prominently in this file. Please record all changes here.
  1549. X
  1550. Programmers:
  1551. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  1552. X
  1553. Changes:
  1554. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  1555. X
  1556. X##############################################################################*/
  1557. X
  1558. X
  1559. X/******************************************************************************/
  1560. X/*                                  CLOCK.C                                   */
  1561. X/******************************************************************************/
  1562. X
  1563. X#include "style.h"
  1564. X
  1565. X#include "as.h"
  1566. X#include "clock.h"
  1567. X#include "machin.h"
  1568. X
  1569. X/******************************************************************************/
  1570. X
  1571. X#define MAGIC_HEAD (565854L)
  1572. X#define MAGIC_TAIL (256194L)
  1573. X
  1574. X/******************************************************************************/
  1575. X
  1576. LOCAL void ck_check P_((p_ck_t));
  1577. LOCAL void ck_check(p_ck)
  1578. p_ck_t p_ck;
  1579. X{
  1580. X as_cold(p_ck!=NULL,"ck_check: Clock pointer is NULL.");
  1581. X as_cold(p_ck->ck_mhead==MAGIC_HEAD,
  1582. X         "ck_check: Magic number at head of record is incorrect.");
  1583. X as_cold(p_ck->ck_mtail==MAGIC_TAIL,
  1584. X         "ck_check: Magic number at tail of record is incorrect.");
  1585. X}
  1586. X
  1587. X/******************************************************************************/
  1588. X
  1589. XEXPORT void ck_ini(p_ck)
  1590. p_ck_t p_ck;
  1591. X{
  1592. X p_ck->ck_mhead = MAGIC_HEAD;
  1593. X p_ck->ck_run   = FALSE;
  1594. X p_ck->ck_csum  = 0.0;
  1595. X p_ck->ck_rsum  = 0.0;
  1596. X /* ck_csta and ck_rsta are undefined in a stopped clock. */
  1597. X p_ck->ck_mtail = MAGIC_TAIL;
  1598. X}
  1599. X
  1600. X/******************************************************************************/
  1601. X
  1602. XEXPORT void ck_start(p_ck)
  1603. p_ck_t p_ck;
  1604. X{
  1605. X ck_check(p_ck);
  1606. X as_cold(!p_ck->ck_run,"ck_start: Clock is already running!");
  1607. X p_ck->ck_run  = TRUE;
  1608. X p_ck->ck_csta = tim_cpu();
  1609. X p_ck->ck_rsta = tim_real();
  1610. X}
  1611. X
  1612. X/******************************************************************************/
  1613. X
  1614. XEXPORT void ck_stop(p_ck)
  1615. p_ck_t p_ck;
  1616. X{
  1617. X ck_check(p_ck);
  1618. X as_cold(p_ck->ck_run,"ck_stop: Clock is already stopped!");
  1619. X p_ck->ck_run  = FALSE;
  1620. X p_ck->ck_csum += tim_cpu () - p_ck->ck_csta;
  1621. X p_ck->ck_rsum += tim_real() - p_ck->ck_rsta;
  1622. X}
  1623. X
  1624. X/******************************************************************************/
  1625. X
  1626. XEXPORT float ck_cpu(p_ck)
  1627. p_ck_t p_ck;
  1628. X{
  1629. X ck_check(p_ck);
  1630. X as_cold(!p_ck->ck_run,"ck_cpu: Clock is running.");
  1631. X return p_ck->ck_csum;
  1632. X}
  1633. X
  1634. X/******************************************************************************/
  1635. X
  1636. XEXPORT float ck_real(p_ck)
  1637. p_ck_t p_ck;
  1638. X{
  1639. X ck_check(p_ck);
  1640. X as_cold(!p_ck->ck_run,"ck_real: Clock is running.");
  1641. X return p_ck->ck_rsum;
  1642. X}
  1643. X
  1644. X/******************************************************************************/
  1645. X/*                              End of CLOCK.H                                */
  1646. X/******************************************************************************/
  1647. END_OF_FILE
  1648. if test 3834 -ne `wc -c <'sources/clock.c'`; then
  1649.     echo shar: \"'sources/clock.c'\" unpacked with wrong size!
  1650. fi
  1651. # end of 'sources/clock.c'
  1652. fi
  1653. if test -f 'sources/command.h' -a "${1}" != "-c" ; then 
  1654.   echo shar: Will not clobber existing file \"'sources/command.h'\"
  1655. else
  1656. echo shar: Extracting \"'sources/command.h'\" \(2770 characters\)
  1657. sed "s/^X//" >'sources/command.h' <<'END_OF_FILE'
  1658. X/*##############################################################################
  1659. X
  1660. XFUNNNELWEB COPYRIGHT
  1661. X====================
  1662. XFunnelWeb is a literate-programming macro preprocessor.
  1663. X
  1664. Copyright (C) 1992 Ross N. Williams.
  1665. X
  1666. X   Ross N. Williams
  1667. X   ross@spam.adelaide.edu.au
  1668. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  1669. X
  1670. This program is free software; you can redistribute it and/or modify
  1671. it under the terms of Version 2 of the GNU General Public License as
  1672. published by the Free Software Foundation.
  1673. X
  1674. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  1675. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1676. See Version 2 of the GNU General Public License for more details.
  1677. X
  1678. You should have received a copy of Version 2 of the GNU General Public
  1679. License along with this program. If not, you can FTP the license from
  1680. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  1681. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1682. X
  1683. Section 2a of the license requires that all changes to this file be
  1684. recorded prominently in this file. Please record all changes here.
  1685. X
  1686. Programmers:
  1687. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  1688. X
  1689. Changes:
  1690. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  1691. X
  1692. X##############################################################################*/
  1693. X
  1694. X
  1695. X/******************************************************************************/
  1696. X/*                                   COMMAND.H                                */
  1697. X/******************************************************************************/
  1698. X/*                                                                            */
  1699. X/* The command package is the mover and shaker of FunnelWeb. It exports a     */
  1700. X/* single function, whose argument is the command line given to FunnelWeb     */
  1701. X/* when it is invoked at the operating system level. The command package      */
  1702. X/* routine examines the command line and executes it, possibly invoking a     */
  1703. X/* mini-interpreter or calling the different component of FunnelWeb in turn   */
  1704. X/* (e.g. the parser).                                                         */
  1705. X/*                                                                            */
  1706. X/******************************************************************************/
  1707. X
  1708. X#include "style.h"
  1709. X#include "machin.h"
  1710. X
  1711. X/******************************************************************************/
  1712. X
  1713. void command P_((p_cl_t));
  1714. X/* Executes the command line which is passed as the argument. */
  1715. X
  1716. X/******************************************************************************/
  1717. X/*                               End of COMMAND.H                             */
  1718. X/******************************************************************************/
  1719. END_OF_FILE
  1720. if test 2770 -ne `wc -c <'sources/command.h'`; then
  1721.     echo shar: \"'sources/command.h'\" unpacked with wrong size!
  1722. fi
  1723. # end of 'sources/command.h'
  1724. fi
  1725. if test -f 'sources/data.c' -a "${1}" != "-c" ; then 
  1726.   echo shar: Will not clobber existing file \"'sources/data.c'\"
  1727. else
  1728. echo shar: Extracting \"'sources/data.c'\" \(2023 characters\)
  1729. sed "s/^X//" >'sources/data.c' <<'END_OF_FILE'
  1730. X/*##############################################################################
  1731. X
  1732. XFUNNNELWEB COPYRIGHT
  1733. X====================
  1734. XFunnelWeb is a literate-programming macro preprocessor.
  1735. X
  1736. Copyright (C) 1992 Ross N. Williams.
  1737. X
  1738. X   Ross N. Williams
  1739. X   ross@spam.adelaide.edu.au
  1740. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  1741. X
  1742. This program is free software; you can redistribute it and/or modify
  1743. it under the terms of Version 2 of the GNU General Public License as
  1744. published by the Free Software Foundation.
  1745. X
  1746. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  1747. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1748. See Version 2 of the GNU General Public License for more details.
  1749. X
  1750. You should have received a copy of Version 2 of the GNU General Public
  1751. License along with this program. If not, you can FTP the license from
  1752. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  1753. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1754. X
  1755. Section 2a of the license requires that all changes to this file be
  1756. recorded prominently in this file. Please record all changes here.
  1757. X
  1758. Programmers:
  1759. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  1760. X
  1761. Changes:
  1762. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  1763. X
  1764. X##############################################################################*/
  1765. X
  1766. X
  1767. X/******************************************************************************/
  1768. X/*                                    DATA.C                                  */
  1769. X/******************************************************************************/
  1770. X
  1771. X/* The following definition causes the definitions in data.h to be treated    */
  1772. X/* as real meaty declarations and not wimpy "external" ones.                  */
  1773. X#define EXTERN
  1774. X
  1775. X#include "data.h"
  1776. X
  1777. X/******************************************************************************/
  1778. X/*                                 End of DATA.C                              */
  1779. X/******************************************************************************/
  1780. END_OF_FILE
  1781. if test 2023 -ne `wc -c <'sources/data.c'`; then
  1782.     echo shar: \"'sources/data.c'\" unpacked with wrong size!
  1783. fi
  1784. # end of 'sources/data.c'
  1785. fi
  1786. if test -f 'sources/dump.h' -a "${1}" != "-c" ; then 
  1787.   echo shar: Will not clobber existing file \"'sources/dump.h'\"
  1788. else
  1789. echo shar: Extracting \"'sources/dump.h'\" \(3416 characters\)
  1790. sed "s/^X//" >'sources/dump.h' <<'END_OF_FILE'
  1791. X/*##############################################################################
  1792. X
  1793. XFUNNNELWEB COPYRIGHT
  1794. X====================
  1795. XFunnelWeb is a literate-programming macro preprocessor.
  1796. X
  1797. Copyright (C) 1992 Ross N. Williams.
  1798. X
  1799. X   Ross N. Williams
  1800. X   ross@spam.adelaide.edu.au
  1801. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  1802. X
  1803. This program is free software; you can redistribute it and/or modify
  1804. it under the terms of Version 2 of the GNU General Public License as
  1805. published by the Free Software Foundation.
  1806. X
  1807. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  1808. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1809. See Version 2 of the GNU General Public License for more details.
  1810. X
  1811. You should have received a copy of Version 2 of the GNU General Public
  1812. License along with this program. If not, you can FTP the license from
  1813. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  1814. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1815. X
  1816. Section 2a of the license requires that all changes to this file be
  1817. recorded prominently in this file. Please record all changes here.
  1818. X
  1819. Programmers:
  1820. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  1821. X
  1822. Changes:
  1823. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  1824. X
  1825. X##############################################################################*/
  1826. X
  1827. X
  1828. X/******************************************************************************/
  1829. X/*                                     DUMP.H                                 */
  1830. X/******************************************************************************/
  1831. X/*                                                                            */
  1832. X/* This package contains functions that dump text representations of          */
  1833. X/* FunnelWeb data structures. Each function accepts a wf stream on which it   */
  1834. X/* writes its text representation. These functions are used in testing and    */
  1835. X/* debugging only and are not used ordinarily in the program.                 */
  1836. X/*                                                                            */
  1837. X/******************************************************************************/
  1838. X
  1839. X#include "style.h"
  1840. X
  1841. X#include "clock.h"
  1842. X#include "writfile.h"
  1843. X
  1844. X/******************************************************************************/
  1845. X
  1846. XEXPORT void dm_mem P_((p_wf_t,char *,ulong));
  1847. X/* Writes a hex and ascii dump of the specified block of memory to the        */
  1848. X/* specified stream.                                                          */
  1849. X
  1850. XEXPORT void dm_lnls P_((p_wf_t));
  1851. X/* Dumps a text representation of the global line list to the given stream.   */
  1852. X
  1853. XEXPORT void dm_tkls P_((p_wf_t));
  1854. X/* Dumps a text representation of the global token list to the given stream.  */
  1855. X
  1856. XEXPORT void dm_matb P_((p_wf_t));
  1857. X/* Dumps a text representation of the macro table to the given stream.        */
  1858. X
  1859. XEXPORT void dm_dcls P_((p_wf_t));
  1860. X/* Dumps a text representation of the document list to the given stream.      */
  1861. X
  1862. XEXPORT void dm_times P_((p_wf_t,p_ck_t,p_ck_t,p_ck_t,p_ck_t,
  1863. X                         p_ck_t,p_ck_t,p_ck_t,p_ck_t,p_ck_t));
  1864. X/* Dumps a text representation of the execution times to the given stream.    */
  1865. X
  1866. X/******************************************************************************/
  1867. X/*                                 End of DUMP.H                              */
  1868. X/******************************************************************************/
  1869. END_OF_FILE
  1870. if test 3416 -ne `wc -c <'sources/dump.h'`; then
  1871.     echo shar: \"'sources/dump.h'\" unpacked with wrong size!
  1872. fi
  1873. # end of 'sources/dump.h'
  1874. fi
  1875. if test -f 'sources/help_gnu.h' -a "${1}" != "-c" ; then 
  1876.   echo shar: Will not clobber existing file \"'sources/help_gnu.h'\"
  1877. else
  1878. echo shar: Extracting \"'sources/help_gnu.h'\" \(2621 characters\)
  1879. sed "s/^X//" >'sources/help_gnu.h' <<'END_OF_FILE'
  1880. X/*##############################################################################
  1881. X
  1882. XFUNNNELWEB COPYRIGHT
  1883. X====================
  1884. XFunnelWeb is a literate-programming macro preprocessor.
  1885. X
  1886. Copyright (C) 1992 Ross N. Williams.
  1887. X
  1888. X   Ross N. Williams
  1889. X   ross@spam.adelaide.edu.au
  1890. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  1891. X
  1892. This program is free software; you can redistribute it and/or modify
  1893. it under the terms of Version 2 of the GNU General Public License as
  1894. published by the Free Software Foundation.
  1895. X
  1896. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  1897. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1898. See Version 2 of the GNU General Public License for more details.
  1899. X
  1900. You should have received a copy of Version 2 of the GNU General Public
  1901. License along with this program. If not, you can FTP the license from
  1902. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  1903. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1904. X
  1905. Section 2a of the license requires that all changes to this file be
  1906. recorded prominently in this file. Please record all changes here.
  1907. X
  1908. Programmers:
  1909. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  1910. X
  1911. Changes:
  1912. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  1913. X
  1914. X##############################################################################*/
  1915. X
  1916. X
  1917. X/******************************************************************************/
  1918. X/*                                 HELP_GNU.H                                 */
  1919. X/******************************************************************************/
  1920. X/*                                                                            */
  1921. X/* This module is used solely by the help module, and is really part of the   */
  1922. X/* help module, but has been separated out because THINK C on the Macintosh   */
  1923. X/* couldn't cope with more than 32K of code in one module.                    */
  1924. X/*                                                                            */
  1925. X/******************************************************************************/
  1926. X
  1927. X#include "style.h"
  1928. X
  1929. X/******************************************************************************/
  1930. X
  1931. XEXPORT void hel_gnu P_((void (*)(char *)));
  1932. X/* Writes out the GNU General Public License Version 2 using the specified    */
  1933. X/* output function.                                                           */
  1934. X
  1935. X/******************************************************************************/
  1936. X/*                             End of HELP_GNU.H                              */
  1937. X/******************************************************************************/
  1938. END_OF_FILE
  1939. if test 2621 -ne `wc -c <'sources/help_gnu.h'`; then
  1940.     echo shar: \"'sources/help_gnu.h'\" unpacked with wrong size!
  1941. fi
  1942. # end of 'sources/help_gnu.h'
  1943. fi
  1944. if test -f 'sources/lister.h' -a "${1}" != "-c" ; then 
  1945.   echo shar: Will not clobber existing file \"'sources/lister.h'\"
  1946. else
  1947. echo shar: Extracting \"'sources/lister.h'\" \(3396 characters\)
  1948. sed "s/^X//" >'sources/lister.h' <<'END_OF_FILE'
  1949. X/*##############################################################################
  1950. X
  1951. XFUNNNELWEB COPYRIGHT
  1952. X====================
  1953. XFunnelWeb is a literate-programming macro preprocessor.
  1954. X
  1955. Copyright (C) 1992 Ross N. Williams.
  1956. X
  1957. X   Ross N. Williams
  1958. X   ross@spam.adelaide.edu.au
  1959. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  1960. X
  1961. This program is free software; you can redistribute it and/or modify
  1962. it under the terms of Version 2 of the GNU General Public License as
  1963. published by the Free Software Foundation.
  1964. X
  1965. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  1966. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1967. See Version 2 of the GNU General Public License for more details.
  1968. X
  1969. You should have received a copy of Version 2 of the GNU General Public
  1970. License along with this program. If not, you can FTP the license from
  1971. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  1972. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1973. X
  1974. Section 2a of the license requires that all changes to this file be
  1975. recorded prominently in this file. Please record all changes here.
  1976. X
  1977. Programmers:
  1978. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  1979. X
  1980. Changes:
  1981. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  1982. X
  1983. X##############################################################################*/
  1984. X
  1985. X
  1986. X/******************************************************************************/
  1987. X/*                                   LISTER.H                                 */
  1988. X/******************************************************************************/
  1989. X
  1990. X#include "style.h"
  1991. X
  1992. X#include "data.h"
  1993. X
  1994. X/******************************************************************************/
  1995. X
  1996. XEXPORT void lr_ini P_((void));
  1997. X/* Initialize the lister. Calling this function destroys all the lister       */
  1998. X/* package's old internal data structures and sets them to a well-defined     */
  1999. X/* initial state (empty) and prepares the lister for the incoming messages.   */
  2000. X/* This function may be called at any time and many times.                    */
  2001. X
  2002. XEXPORT void lr_mes P_((ps_t *,char *));
  2003. XEXPORT void lr_war P_((ps_t *,char *));
  2004. XEXPORT void lr_err P_((ps_t *,char *));
  2005. XEXPORT void lr_sev P_((ps_t *,char *));
  2006. X/* The functions above allow the user to record four different kinds of       */
  2007. X/* messages and to specify exactly where in the listing each message is to    */
  2008. X/* appear.                                                                    */
  2009. X
  2010. XEXPORT void lr_gen P_((p_wf_t,uword));
  2011. X/* Merges the global structure line_list with the message table stored by the */
  2012. X/* lister package and writes the resultant listing to the p_wf_t stream.      */
  2013. X/* The second parameter is the number of lines of context around each         */
  2014. X/* diagnostic. The lister does not write the entire input file out. It only   */
  2015. X/* writes input lines near a diagnostic. The context argument specifies the   */
  2016. X/* number of lines that should be written around each diagnostic.             */
  2017. X/* Note: A context of 100 is special and means that no lines should be        */
  2018. X/*       omitted in between diagnostics.                                      */
  2019. X
  2020. X/******************************************************************************/
  2021. X/*                               End of LISTER.H                              */
  2022. X/******************************************************************************/
  2023. X
  2024. END_OF_FILE
  2025. if test 3396 -ne `wc -c <'sources/lister.h'`; then
  2026.     echo shar: \"'sources/lister.h'\" unpacked with wrong size!
  2027. fi
  2028. # end of 'sources/lister.h'
  2029. fi
  2030. if test -f 'sources/main.c' -a "${1}" != "-c" ; then 
  2031.   echo shar: Will not clobber existing file \"'sources/main.c'\"
  2032. else
  2033. echo shar: Extracting \"'sources/main.c'\" \(4072 characters\)
  2034. sed "s/^X//" >'sources/main.c' <<'END_OF_FILE'
  2035. X/*##############################################################################
  2036. X
  2037. XFUNNNELWEB COPYRIGHT
  2038. X====================
  2039. XFunnelWeb is a literate-programming macro preprocessor.
  2040. X
  2041. Copyright (C) 1992 Ross N. Williams.
  2042. X
  2043. X   Ross N. Williams
  2044. X   ross@spam.adelaide.edu.au
  2045. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  2046. X
  2047. This program is free software; you can redistribute it and/or modify
  2048. it under the terms of Version 2 of the GNU General Public License as
  2049. published by the Free Software Foundation.
  2050. X
  2051. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  2052. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  2053. See Version 2 of the GNU General Public License for more details.
  2054. X
  2055. You should have received a copy of Version 2 of the GNU General Public
  2056. License along with this program. If not, you can FTP the license from
  2057. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  2058. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2059. X
  2060. Section 2a of the license requires that all changes to this file be
  2061. recorded prominently in this file. Please record all changes here.
  2062. X
  2063. Programmers:
  2064. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  2065. X
  2066. Changes:
  2067. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  2068. X
  2069. X##############################################################################*/
  2070. X
  2071. X
  2072. X/******************************************************************************/
  2073. X/*                                     MAIN.C                                 */
  2074. X/******************************************************************************/
  2075. X
  2076. X#include "style.h"
  2077. X
  2078. X#include "as.h"
  2079. X#include "command.h"
  2080. X#include "data.h"
  2081. X#include "machin.h"
  2082. X#include "memory.h"
  2083. X
  2084. X/******************************************************************************/
  2085. X
  2086. X/* The following variables should really be local to main. However, some      */
  2087. X/* compilers have a problem with this and so it has been declared here.       */
  2088. LOCVAR char  *p_comline;
  2089. LOCVAR ulong sum_all;
  2090. X
  2091. X/******************************************************************************/
  2092. X
  2093. LOCAL void minimain P_((int,char **));
  2094. LOCAL void minimain(argc,argv)
  2095. X/* Some compilers generate buggy code for main() and so this minimain         */
  2096. X/* function has been created to take the heat off main().                     */
  2097. int    argc;
  2098. char **argv;
  2099. X{
  2100. X /* The principal concern of this main() function is to execute FunnelWeb and */
  2101. X /* to ensure that the correct return status is returned to the OS. So it     */
  2102. X /* seems appropriate to zero all the global diagnostic counters here.        */
  2103. X sum_fat=sum_sev=sum_err=sum_war=0;
  2104. X
  2105. X /* Some compilers place a low limit on the total amount of statics. So we    */
  2106. X /* have to allocate space for a command line.                                */
  2107. X p_comline=(char *) mm_perm((size_t) COMLINE_MAX+1);
  2108. X
  2109. X /* Obtaining the command line is highly machine specific and so it has been  */
  2110. X /* delegated to a function in the non-portable "machin". Just in case argc   */
  2111. X /* and argv are to be used, we hand them in too. The result of all this is a */
  2112. X /* standard FunnelWeb command line string in the variable 'comline'.         */
  2113. X getcline(argc,argv,p_comline);
  2114. X
  2115. X /* Execute the command line. */
  2116. X command(p_comline);
  2117. X
  2118. X /* Exit to the operating system with an appropriate status code. */
  2119. X sum_all=sum_war+sum_err+sum_sev+sum_fat;
  2120. X if (sum_all>0)
  2121. X    exit(EXIT_FAILURE);
  2122. X else
  2123. X    exit(EXIT_SUCCESS);
  2124. X}
  2125. X
  2126. X/******************************************************************************/
  2127. X
  2128. int main(argc,argv)
  2129. int   argc;
  2130. char *argv[];
  2131. X{
  2132. X /* We don't put anything into the function main() because some compilers     */
  2133. X /* generate incorrect code for main, especially with local variables.        */
  2134. X minimain(argc,argv);
  2135. X
  2136. X /* Keep GCC warnings happy. */
  2137. X as_bomb("Main program dropped through.");
  2138. X return 0;
  2139. X}
  2140. X
  2141. X/******************************************************************************/
  2142. X/*                                End of MAIN.C                               */
  2143. X/******************************************************************************/
  2144. END_OF_FILE
  2145. if test 4072 -ne `wc -c <'sources/main.c'`; then
  2146.     echo shar: \"'sources/main.c'\" unpacked with wrong size!
  2147. fi
  2148. # end of 'sources/main.c'
  2149. fi
  2150. if test -f 'sources/mapper.h' -a "${1}" != "-c" ; then 
  2151.   echo shar: Will not clobber existing file \"'sources/mapper.h'\"
  2152. else
  2153. echo shar: Extracting \"'sources/mapper.h'\" \(3520 characters\)
  2154. sed "s/^X//" >'sources/mapper.h' <<'END_OF_FILE'
  2155. X/*##############################################################################
  2156. X
  2157. XFUNNNELWEB COPYRIGHT
  2158. X====================
  2159. XFunnelWeb is a literate-programming macro preprocessor.
  2160. X
  2161. Copyright (C) 1992 Ross N. Williams.
  2162. X
  2163. X   Ross N. Williams
  2164. X   ross@spam.adelaide.edu.au
  2165. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  2166. X
  2167. This program is free software; you can redistribute it and/or modify
  2168. it under the terms of Version 2 of the GNU General Public License as
  2169. published by the Free Software Foundation.
  2170. X
  2171. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  2172. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  2173. See Version 2 of the GNU General Public License for more details.
  2174. X
  2175. You should have received a copy of Version 2 of the GNU General Public
  2176. License along with this program. If not, you can FTP the license from
  2177. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  2178. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2179. X
  2180. Section 2a of the license requires that all changes to this file be
  2181. recorded prominently in this file. Please record all changes here.
  2182. X
  2183. Programmers:
  2184. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  2185. X
  2186. Changes:
  2187. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  2188. X
  2189. X##############################################################################*/
  2190. X
  2191. X
  2192. X/******************************************************************************/
  2193. X/*                                  MAPPER.H                                  */
  2194. X/******************************************************************************/
  2195. X/*                                                                            */
  2196. X/* The mapper is the first of FunnelWeb's four front end processors: (mapper, */
  2197. X/* scanner, parser, analyser). The sole task of the mapper is, given the      */
  2198. X/* name of a file, to create an image of that file in memory. This approach   */
  2199. X/* is not wasteful of memory at all because FunnelWeb requires random access  */
  2200. X/* to each input file at all times anyway so it can scramble the text around. */
  2201. X/*                                                                            */
  2202. X/******************************************************************************/
  2203. X
  2204. X#include "style.h"
  2205. X
  2206. X/******************************************************************************/
  2207. X
  2208. XEXPORT char *map_file P_((char *,char **,ulong *));
  2209. X/* Allocates a block of memory and places a Unix text stream representation   */
  2210. X/* (with EOL marking end of line and no character marking end of file) of the */
  2211. X/* file 'p_name' in the block of memory. Returns a pointer to the address and */
  2212. X/* len of the file in the mem block in the parameters (pp_mem and p_length).  */
  2213. X/* Returns NULL upon success or a pointer to an error message string upon     */
  2214. X/* failure. Note: Parameters are: p_name, pp_mem, p_length.                   */
  2215. X/* Note: Allocates enough memory so that there is guaranteed to be at least   */
  2216. X/* two extra bytes of spare memory at the end of the mapped file. The         */
  2217. X/* scanner uses this space to put EOL and EOF characters.                     */
  2218. X/* Note: The mapper grabs its memory using mm_temp, so it can be recycled     */
  2219. X/* as part of a call to mm_zapt.                                              */
  2220. X
  2221. X/******************************************************************************/
  2222. X/*                               End of MAPPER.H                              */
  2223. X/******************************************************************************/
  2224. END_OF_FILE
  2225. if test 3520 -ne `wc -c <'sources/mapper.h'`; then
  2226.     echo shar: \"'sources/mapper.h'\" unpacked with wrong size!
  2227. fi
  2228. # end of 'sources/mapper.h'
  2229. fi
  2230. if test -f 'sources/parser.h' -a "${1}" != "-c" ; then 
  2231.   echo shar: Will not clobber existing file \"'sources/parser.h'\"
  2232. else
  2233. echo shar: Extracting \"'sources/parser.h'\" \(3175 characters\)
  2234. sed "s/^X//" >'sources/parser.h' <<'END_OF_FILE'
  2235. X/*##############################################################################
  2236. X
  2237. XFUNNNELWEB COPYRIGHT
  2238. X====================
  2239. XFunnelWeb is a literate-programming macro preprocessor.
  2240. X
  2241. Copyright (C) 1992 Ross N. Williams.
  2242. X
  2243. X   Ross N. Williams
  2244. X   ross@spam.adelaide.edu.au
  2245. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  2246. X
  2247. This program is free software; you can redistribute it and/or modify
  2248. it under the terms of Version 2 of the GNU General Public License as
  2249. published by the Free Software Foundation.
  2250. X
  2251. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  2252. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  2253. See Version 2 of the GNU General Public License for more details.
  2254. X
  2255. You should have received a copy of Version 2 of the GNU General Public
  2256. License along with this program. If not, you can FTP the license from
  2257. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  2258. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2259. X
  2260. Section 2a of the license requires that all changes to this file be
  2261. recorded prominently in this file. Please record all changes here.
  2262. X
  2263. Programmers:
  2264. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  2265. X
  2266. Changes:
  2267. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  2268. X
  2269. X##############################################################################*/
  2270. X
  2271. X
  2272. X/******************************************************************************/
  2273. X/*                                    PARSER.H                                */
  2274. X/******************************************************************************/
  2275. X/*                                                                            */
  2276. X/* The FunnelWeb parser parses the tokens in the global token list and        */
  2277. X/* constructs a macro table and a document list. These two data structures    */
  2278. X/* give structured views of the input document which are used later by tangle */
  2279. X/* and weave. If the parser detects any errors it sends them to the lister    */
  2280. X/* package. If any errors have occurred, the output of the parser should not  */
  2281. X/* be used.                                                                   */
  2282. X/*                                                                            */
  2283. X/* IN : token_list    - List of tokens to be parsed.                          */
  2284. X/* OUT: macro_table   - Table of macros parsed.                               */
  2285. X/*      file_table    - Table indicating which macros are attached to files.  */
  2286. X/*      document_list - List giving a structured view of the document.        */
  2287. X/*      Also sends diagnostic messages to the lister.                         */
  2288. X/*                                                                            */
  2289. X/******************************************************************************/
  2290. X
  2291. X#include "style.h"
  2292. X
  2293. X/******************************************************************************/
  2294. X
  2295. XEXPORT void parser P_((void));
  2296. X
  2297. X/******************************************************************************/
  2298. X/*                                End of PARSER.H                             */
  2299. X/******************************************************************************/
  2300. END_OF_FILE
  2301. if test 3175 -ne `wc -c <'sources/parser.h'`; then
  2302.     echo shar: \"'sources/parser.h'\" unpacked with wrong size!
  2303. fi
  2304. # end of 'sources/parser.h'
  2305. fi
  2306. if test -f 'sources/scanner.h' -a "${1}" != "-c" ; then 
  2307.   echo shar: Will not clobber existing file \"'sources/scanner.h'\"
  2308. else
  2309. echo shar: Extracting \"'sources/scanner.h'\" \(3205 characters\)
  2310. sed "s/^X//" >'sources/scanner.h' <<'END_OF_FILE'
  2311. X/*##############################################################################
  2312. X
  2313. XFUNNNELWEB COPYRIGHT
  2314. X====================
  2315. XFunnelWeb is a literate-programming macro preprocessor.
  2316. X
  2317. Copyright (C) 1992 Ross N. Williams.
  2318. X
  2319. X   Ross N. Williams
  2320. X   ross@spam.adelaide.edu.au
  2321. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  2322. X
  2323. This program is free software; you can redistribute it and/or modify
  2324. it under the terms of Version 2 of the GNU General Public License as
  2325. published by the Free Software Foundation.
  2326. X
  2327. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  2328. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  2329. See Version 2 of the GNU General Public License for more details.
  2330. X
  2331. You should have received a copy of Version 2 of the GNU General Public
  2332. License along with this program. If not, you can FTP the license from
  2333. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  2334. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2335. X
  2336. Section 2a of the license requires that all changes to this file be
  2337. recorded prominently in this file. Please record all changes here.
  2338. X
  2339. Programmers:
  2340. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  2341. X
  2342. Changes:
  2343. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  2344. X
  2345. X##############################################################################*/
  2346. X
  2347. X
  2348. X/******************************************************************************/
  2349. X/*                                  SCANNER.H                                 */
  2350. X/******************************************************************************/
  2351. X/*                                                                            */
  2352. X/* This package contains the scanner. When called (though the only exported   */
  2353. X/* routine below), the scanner maps in the file whose filename is given in    */
  2354. X/* the global option.op_f_s variable. The scanner scans the file, mapping in  */
  2355. X/* any included files, and builds two lists in the global list variables      */
  2356. X/* 'line_list' and 'token_list'. The line list contains a list of the lines   */
  2357. X/* of the input. The token list contains a tokenized form of the input, which */
  2358. X/* is used by the parser. The scanner also sends diagnostics to the lister    */
  2359. X/* package which has the effect of possibly incrementing the global error     */
  2360. X/* counters num_*. See data.h for more information on data structures.        */
  2361. X/*                                                                            */
  2362. X/******************************************************************************/
  2363. X
  2364. X#include "style.h"
  2365. X
  2366. X#include "clock.h"
  2367. X
  2368. X/******************************************************************************/
  2369. X
  2370. XEXPORT void scanner P_((p_ck_t,p_ck_t));
  2371. X/* The arguments are first a mapper clock, and second a scanner clock. The    */
  2372. X/* scanner should turn off the scanner clock and turn on the mapper clock     */
  2373. X/* when calling the mapper.                                                   */
  2374. X
  2375. X/******************************************************************************/
  2376. X/*                             End of SCANNER.H                               */
  2377. X/******************************************************************************/
  2378. END_OF_FILE
  2379. if test 3205 -ne `wc -c <'sources/scanner.h'`; then
  2380.     echo shar: \"'sources/scanner.h'\" unpacked with wrong size!
  2381. fi
  2382. # end of 'sources/scanner.h'
  2383. fi
  2384. if test -f 'sources/section.c' -a "${1}" != "-c" ; then 
  2385.   echo shar: Will not clobber existing file \"'sources/section.c'\"
  2386. else
  2387. echo shar: Extracting \"'sources/section.c'\" \(4315 characters\)
  2388. sed "s/^X//" >'sources/section.c' <<'END_OF_FILE'
  2389. X/*##############################################################################
  2390. X
  2391. XFUNNNELWEB COPYRIGHT
  2392. X====================
  2393. XFunnelWeb is a literate-programming macro preprocessor.
  2394. X
  2395. Copyright (C) 1992 Ross N. Williams.
  2396. X
  2397. X   Ross N. Williams
  2398. X   ross@spam.adelaide.edu.au
  2399. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  2400. X
  2401. This program is free software; you can redistribute it and/or modify
  2402. it under the terms of Version 2 of the GNU General Public License as
  2403. published by the Free Software Foundation.
  2404. X
  2405. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  2406. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  2407. See Version 2 of the GNU General Public License for more details.
  2408. X
  2409. You should have received a copy of Version 2 of the GNU General Public
  2410. License along with this program. If not, you can FTP the license from
  2411. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  2412. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2413. X
  2414. Section 2a of the license requires that all changes to this file be
  2415. recorded prominently in this file. Please record all changes here.
  2416. X
  2417. Programmers:
  2418. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  2419. X
  2420. Changes:
  2421. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  2422. X
  2423. X##############################################################################*/
  2424. X
  2425. X
  2426. X/******************************************************************************/
  2427. X/*                                   SECTION.C                                */
  2428. X/******************************************************************************/
  2429. X
  2430. X#include "style.h"
  2431. X
  2432. X#include "as.h"
  2433. X#include "section.h"
  2434. X
  2435. X/******************************************************************************/
  2436. X
  2437. X#define MAGIC  (89201129L) /* Magic number detects uninitialized sections.    */
  2438. X#define SECMAX    (30000L) /* Maximum value of a single level's section num.  */
  2439. X
  2440. X/******************************************************************************/
  2441. X
  2442. LOCAL void sn_chk P_((p_sn_t));
  2443. LOCAL void sn_chk(p_sn)
  2444. X/* Checks that the given section object has a legal internal state.           */
  2445. p_sn_t p_sn;
  2446. X{
  2447. X ubyte i;
  2448. X
  2449. X as_cold(p_sn->sn_magic==MAGIC,"sn_chk: Section has bad magic number.");
  2450. X as_cold(p_sn->sn_lev<=SECLEV_MAX,
  2451. X         "sn_chk: Section has bad level number.");
  2452. X for (i=1;i<=p_sn->sn_lev;i++)
  2453. X    as_cold(p_sn->sn_num[i]>0,
  2454. X            "sn_chk: Section has zero hierarchical number.");
  2455. X}
  2456. X
  2457. X/******************************************************************************/
  2458. X
  2459. XEXPORT void sn_ini(p_sn)
  2460. p_sn_t p_sn;
  2461. X{
  2462. X p_sn->sn_magic = MAGIC;
  2463. X p_sn->sn_lev   = 0;
  2464. X}
  2465. X
  2466. X/******************************************************************************/
  2467. X
  2468. XEXPORT void sn_set(p_sn,level)
  2469. p_sn_t p_sn;
  2470. ubyte  level;
  2471. X{
  2472. X ubyte i;
  2473. X sn_chk(p_sn);
  2474. X as_cold(level>0 && level<=SECLEV_MAX,
  2475. X         "sn_set: Specified level is too high.");
  2476. X p_sn->sn_lev=level;
  2477. X for(i=1;i<=level;i++)
  2478. X    p_sn->sn_num[i]=1;
  2479. X}
  2480. X
  2481. X/******************************************************************************/
  2482. X
  2483. XEXPORT void sn_inc (p_sn,lev)
  2484. p_sn_t p_sn;
  2485. ubyte  lev;
  2486. X{
  2487. X sn_chk(p_sn);
  2488. X
  2489. X /* Check the parameter level. */
  2490. X as_cold(1<=lev && lev<=SECLEV_MAX,"sn_inc: Bad level number specified.");
  2491. X
  2492. X /* Check that we are not skipping a hierarchical level. */
  2493. X as_cold(lev<=p_sn->sn_lev+1,"sn_inc: Discountinuous level increment.");
  2494. X
  2495. X /* Actually increment the section. */
  2496. X if (lev==p_sn->sn_lev+1) p_sn->sn_num[lev]=0;
  2497. X p_sn->sn_lev=lev;
  2498. X p_sn->sn_num[lev]++;
  2499. X
  2500. X /* Check that the section number hasn't got too big. */
  2501. X as_cold(p_sn->sn_num[lev]<=SECMAX,"sn_inc: Section number is too large.");
  2502. X}
  2503. X
  2504. X/******************************************************************************/
  2505. X
  2506. XEXPORT ubyte sn_lev(p_sn)
  2507. p_sn_t p_sn;
  2508. X{
  2509. X sn_chk(p_sn);
  2510. X return p_sn->sn_lev;
  2511. X}
  2512. X
  2513. X/******************************************************************************/
  2514. X
  2515. XEXPORT void sn_str(p_sn,s)
  2516. p_sn_t p_sn;
  2517. char   *s;
  2518. X{
  2519. X char   t[20];
  2520. X ubyte  i;
  2521. X
  2522. X sn_chk(p_sn);
  2523. X
  2524. X s[0]=EOS;
  2525. X for (i=1;i<=p_sn->sn_lev;i++)
  2526. X    {
  2527. X     if (i>1) strcat(s,".");
  2528. X     sprintf(t,"%u",(unsigned) p_sn->sn_num[i]);
  2529. X     strcat(s,t);
  2530. X    }
  2531. X}
  2532. X
  2533. X/******************************************************************************/
  2534. X/*                               End of SECTION.C                             */
  2535. X/******************************************************************************/
  2536. X
  2537. END_OF_FILE
  2538. if test 4315 -ne `wc -c <'sources/section.c'`; then
  2539.     echo shar: \"'sources/section.c'\" unpacked with wrong size!
  2540. fi
  2541. # end of 'sources/section.c'
  2542. fi
  2543. if test -f 'sources/tangle.h' -a "${1}" != "-c" ; then 
  2544.   echo shar: Will not clobber existing file \"'sources/tangle.h'\"
  2545. else
  2546. echo shar: Extracting \"'sources/tangle.h'\" \(2395 characters\)
  2547. sed "s/^X//" >'sources/tangle.h' <<'END_OF_FILE'
  2548. X/*##############################################################################
  2549. X
  2550. XFUNNNELWEB COPYRIGHT
  2551. X====================
  2552. XFunnelWeb is a literate-programming macro preprocessor.
  2553. X
  2554. Copyright (C) 1992 Ross N. Williams.
  2555. X
  2556. X   Ross N. Williams
  2557. X   ross@spam.adelaide.edu.au
  2558. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  2559. X
  2560. This program is free software; you can redistribute it and/or modify
  2561. it under the terms of Version 2 of the GNU General Public License as
  2562. published by the Free Software Foundation.
  2563. X
  2564. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  2565. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  2566. See Version 2 of the GNU General Public License for more details.
  2567. X
  2568. You should have received a copy of Version 2 of the GNU General Public
  2569. License along with this program. If not, you can FTP the license from
  2570. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  2571. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2572. X
  2573. Section 2a of the license requires that all changes to this file be
  2574. recorded prominently in this file. Please record all changes here.
  2575. X
  2576. Programmers:
  2577. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  2578. X
  2579. Changes:
  2580. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  2581. X
  2582. X##############################################################################*/
  2583. X
  2584. X
  2585. X/******************************************************************************/
  2586. X/*                                   TANGLE.H                                 */
  2587. X/******************************************************************************/
  2588. X/*                                                                            */
  2589. X/* This package exports a single function "tangle" that generates all the     */
  2590. X/* product files for FunnelWeb.                                               */
  2591. X/*                                                                            */
  2592. X/******************************************************************************/
  2593. X
  2594. X#include "style.h"
  2595. X
  2596. X/******************************************************************************/
  2597. X
  2598. XEXPORT void tangle P_((void));
  2599. X/* Generate product files. */
  2600. X
  2601. X/******************************************************************************/
  2602. X/*                                End of TANGLE.H                             */
  2603. X/******************************************************************************/
  2604. END_OF_FILE
  2605. if test 2395 -ne `wc -c <'sources/tangle.h'`; then
  2606.     echo shar: \"'sources/tangle.h'\" unpacked with wrong size!
  2607. fi
  2608. # end of 'sources/tangle.h'
  2609. fi
  2610. if test -f 'sources/weave.h' -a "${1}" != "-c" ; then 
  2611.   echo shar: Will not clobber existing file \"'sources/weave.h'\"
  2612. else
  2613. echo shar: Extracting \"'sources/weave.h'\" \(2364 characters\)
  2614. sed "s/^X//" >'sources/weave.h' <<'END_OF_FILE'
  2615. X/*##############################################################################
  2616. X
  2617. XFUNNNELWEB COPYRIGHT
  2618. X====================
  2619. XFunnelWeb is a literate-programming macro preprocessor.
  2620. X
  2621. Copyright (C) 1992 Ross N. Williams.
  2622. X
  2623. X   Ross N. Williams
  2624. X   ross@spam.adelaide.edu.au
  2625. X   16 Lerwick Avenue, Hazelwood Park 5066, Australia.
  2626. X
  2627. This program is free software; you can redistribute it and/or modify
  2628. it under the terms of Version 2 of the GNU General Public License as
  2629. published by the Free Software Foundation.
  2630. X
  2631. This program is distributed WITHOUT ANY WARRANTY; without even the implied
  2632. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  2633. See Version 2 of the GNU General Public License for more details.
  2634. X
  2635. You should have received a copy of Version 2 of the GNU General Public
  2636. License along with this program. If not, you can FTP the license from
  2637. prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
  2638. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2639. X
  2640. Section 2a of the license requires that all changes to this file be
  2641. recorded prominently in this file. Please record all changes here.
  2642. X
  2643. Programmers:
  2644. X   RNW  Ross N. Williams  ross@spam.adelaide.edu.au
  2645. X
  2646. Changes:
  2647. X   07-May-1992  RNW  Program prepared for release under GNU GPL V2.
  2648. X
  2649. X##############################################################################*/
  2650. X
  2651. X
  2652. X/******************************************************************************/
  2653. X/*                                    WEAVE.H                                 */
  2654. X/******************************************************************************/
  2655. X/*                                                                            */
  2656. X/* This package exports a single function "weave" that generates the typeset  */
  2657. X/* output file.                                                               */
  2658. X/*                                                                            */
  2659. X/******************************************************************************/
  2660. X
  2661. X#include "style.h"
  2662. X
  2663. X/******************************************************************************/
  2664. X
  2665. XEXPORT void weave P_((void));
  2666. X
  2667. X/******************************************************************************/
  2668. X/*                                End of WEAVE.H                              */
  2669. X/******************************************************************************/
  2670. END_OF_FILE
  2671. if test 2364 -ne `wc -c <'sources/weave.h'`; then
  2672.     echo shar: \"'sources/weave.h'\" unpacked with wrong size!
  2673. fi
  2674. # end of 'sources/weave.h'
  2675. fi
  2676. if test -f 'tests/ex16.fw' -a "${1}" != "-c" ; then 
  2677.   echo shar: Will not clobber existing file \"'tests/ex16.fw'\"
  2678. else
  2679. echo shar: Extracting \"'tests/ex16.fw'\" \(2150 characters\)
  2680. sed "s/^X//" >'tests/ex16.fw' <<'END_OF_FILE'
  2681. X@!---------------------------------------!
  2682. X@!  Start of FunnelWeb Example .fw File  !
  2683. X@!---------------------------------------!
  2684. X
  2685. X@t vskip 40 mm
  2686. X@t title titlefont centre "Powers:"
  2687. X@t title titlefont centre "An Example of"
  2688. X@t title titlefont centre "A Short"
  2689. X@t title titlefont centre "FunnelWeb .fw File"
  2690. X@t vskip 10 mm
  2691. X@t title smalltitlefont centre "by Ross Williams"
  2692. X@t title smalltitlefont centre "26 January 1992"
  2693. X@t vskip 20 mm
  2694. X@t table_of_contents
  2695. X
  2696. X@A@<FunnelWeb Example Program@>
  2697. X
  2698. This  program writes  out each  of the  first @{p@}  powers of  the first  @{n@}
  2699. integers. These  constant parameters are located  here so that they  are easy to
  2700. change.
  2701. X
  2702. X@$@<Constants@>==@{@-
  2703. n : constant natural := 10;     -- How many numbers? (Ans: [1,n]).
  2704. p : constant natural :=  5;     -- How many powers?  (Ans: [1,p]).@}
  2705. X
  2706. X@B Here is  the outline of the  program. This FunnelWeb file  generates a single
  2707. Ada output file  called @{Power.ada@}. The main program consists  of a loop that
  2708. iterates once for each number to be written out.
  2709. X
  2710. X@O@<ex16.out@>==@{@-
  2711. X@<Pull in packages@>
  2712. X
  2713. procedure example is
  2714. X   @<Constants@>
  2715. begin -- example
  2716. X   for i in 1..n loop
  2717. X      @<Write out the first p powers of i on a single line@>
  2718. X   end loop;
  2719. end example;
  2720. X@}
  2721. X
  2722. X@B In this section,  we pull in the packages that this program  needs to run. In
  2723. fact, all we need is the IO package so that we can write out the results. To use
  2724. the IO package, we first of all need  to haul it in (@{with text_io@}) and then
  2725. we need to make all its identifiers visible at the top level (@{use text_io@}).
  2726. X
  2727. X@$@<Pull in packages@>==@{with text_io; use text_io;@}
  2728. X
  2729. X@B Here is  the bit that writes out  the first @{p@} powers of  @{i@}. The power
  2730. values  are  calculated  incrementally  in  @{ip@}  to  avoid  the  use  of  the
  2731. exponentiation operator.
  2732. X
  2733. X@$@<Write out the first p powers of i on a single line@>==@{@-
  2734. declare
  2735. X   ip : natural := 1;
  2736. begin
  2737. X   for power in 1..p loop
  2738. X      ip:=ip*i;
  2739. X      put(natural'image(ip) & " ");
  2740. X   end loop;
  2741. X   new_line;
  2742. end;@}
  2743. X
  2744. X@!---------------------------------------!
  2745. X@!   End of FunnelWeb Example .fw File   !
  2746. X@!---------------------------------------!
  2747. END_OF_FILE
  2748. if test 2150 -ne `wc -c <'tests/ex16.fw'`; then
  2749.     echo shar: \"'tests/ex16.fw'\" unpacked with wrong size!
  2750. fi
  2751. # end of 'tests/ex16.fw'
  2752. fi
  2753. if test -f 'tests/generate.fw' -a "${1}" != "-c" ; then 
  2754.   echo shar: Will not clobber existing file \"'tests/generate.fw'\"
  2755. else
  2756. echo shar: Extracting \"'tests/generate.fw'\" \(2192 characters\)
  2757. sed "s/^X//" >'tests/generate.fw' <<'END_OF_FILE'
  2758. Generate.Web
  2759. X============
  2760. Some of the FunnelWeb tests require input files that contain control
  2761. characters, improperly terminated lines, and other special constructs
  2762. designed to test FunnelWeb's capacity to deal with anything that could
  2763. arise in an input text file.
  2764. X
  2765. Unfortunately, by their very nature, these constructs tend to be vulnerable
  2766. to file transfer programs and other utilities (e.g. FIXEOLS!) that take it
  2767. upon themselves to "fix up" various problems with text files.
  2768. X
  2769. The solution adopted here is to totally avoid the problem by using FunnelWeb
  2770. itself to generate these awkward test files. The following output file
  2771. macro definitions achieve this.
  2772. X
  2773. This FunnelWeb file should be fed into FunnelWeb before testing begins.
  2774. X
  2775. X@!------------------------------------------------------------------------------
  2776. X
  2777. X@O@<sc06.fw@>==@{@-
  2778. SC06: Test FunnelWeb on a file whose last line is not terminated properly
  2779. with an end of line marker.
  2780. X
  2781. Here is the improper termination!---->@}
  2782. X
  2783. X@!------------------------------------------------------------------------------
  2784. X
  2785. X@O@<sc08.fw@>==@{@-
  2786. SC08: Detection of trailing spaces.
  2787. X
  2788. This line has zero  trailing spaces |
  2789. This line has one   trailing space  | @+@-
  2790. This line has two   trailing spaces |  @+@-
  2791. This line has three trailing spaces |   @+@-
  2792. X@}
  2793. X
  2794. X@!------------------------------------------------------------------------------
  2795. X
  2796. X@O@<sc09.fw@>==@{@-
  2797. SC09: Detection of control characters.
  2798. X
  2799. SC09.1 Test that control characters are detected and replaced by "?".
  2800. SC09.2 Test non printable that has a mnemonic.
  2801. X
  2802. There is a tab between these two bars |@^D(009)| which should come out as "?".
  2803. The above error message should contain the mnemonic "HT".
  2804. X
  2805. SC09.3 Test non printable that has no mnemonic.
  2806. X
  2807. There is a non-mnemonic control character between these bars |@^D(234)|.
  2808. X@}
  2809. X
  2810. X@!------------------------------------------------------------------------------
  2811. X
  2812. X@O@<sc13e.fwi@>==@{@-
  2813. This is the include file for test SC13e. The test is to see how FunnelWeb
  2814. copes with an include file that has an improperly terminated last line.
  2815. X
  2816. Here is the improper termination!---->@}
  2817. X
  2818. X@!------------------------------------------------------------------------------
  2819. END_OF_FILE
  2820. if test 2192 -ne `wc -c <'tests/generate.fw'`; then
  2821.     echo shar: \"'tests/generate.fw'\" unpacked with wrong size!
  2822. fi
  2823. # end of 'tests/generate.fw'
  2824. fi
  2825. if test -f 'tests/hi09.fw' -a "${1}" != "-c" ; then 
  2826.   echo shar: Will not clobber existing file \"'tests/hi09.fw'\"
  2827. else
  2828. echo shar: Extracting \"'tests/hi09.fw'\" \(2869 characters\)
  2829. sed "s/^X//" >'tests/hi09.fw' <<'END_OF_FILE'
  2830. HI09: This example demonstrates how FunnelWeb can be used to create generics
  2831. X      in languages that do not already provide them.
  2832. X
  2833. X@! We have to set the output line length limit up to cater for Barry Dwyer's
  2834. X@! rather horizontal coding style.
  2835. X@p maximum_output_line_length = 100
  2836. X
  2837. X@O@<hi09.out@>==@{
  2838. X@<Generic Set Module@>@(NaryTree@,NaryTreeSet@)
  2839. X@}
  2840. X
  2841. X@$@<Generic Set Module@>@(@2@)==@{@-
  2842. X@! @1 is the base type, @2 is the set type.
  2843. X[inherit ('@1'), environment ('@2')]
  2844. X
  2845. module @2;
  2846. X
  2847. type  @2 = ^@2Record;
  2848. X      @2Record = record
  2849. X         Member: @1;
  2850. X         Next: @2;
  2851. X         end;
  2852. X
  2853. procedure Null@2 (var Result: @2);
  2854. begin new (Result);
  2855. Result^.Member := (- MaxInt)::@1;
  2856. Result^.Next := nil end;
  2857. X
  2858. function IsNull@2 (S: @2): boolean;
  2859. begin IsNull@2 := S^.Member::integer = - MaxInt end;
  2860. X
  2861. procedure ForEach@1 (S: @2; procedure DoIt (i: @1));
  2862. var   ThisS, NextS: @2;
  2863. begin ThisS := S;
  2864. while ThisS^.Member::integer <> - MaxInt do
  2865. X   begin NextS := ThisS^.Next;
  2866. X   DoIt (ThisS^.Member);
  2867. X   ThisS := NextS end;
  2868. end;
  2869. X
  2870. function First@1 (S: @2): @1;
  2871. begin First@1 := S^.Member end;
  2872. X
  2873. function Is@1InSet (i: @1; S: @2): boolean;
  2874. X   procedure TestEquals (j: @1);
  2875. X   begin if Equal@1 (i, j) then Is@1InSet := true; end;
  2876. begin Is@1InSet := false; ForEach@1 (S, TestEquals); end;
  2877. X
  2878. function Includes@2 (S1, S2: @2): boolean;
  2879. var Result: boolean;
  2880. X   procedure TestIfInS1 (i: @1);
  2881. X   begin if Result then if not Is@1InSet (i, S1) then Result := false; end;
  2882. begin Result := true;
  2883. XForEach@1 (S2, TestIfInS1);
  2884. Includes@2 := Result end;
  2885. X
  2886. function Disjoint@2s (S1, S2: @2): boolean;
  2887. var Result: boolean;
  2888. X   procedure TestIfInS1 (i: @1);
  2889. X   begin if Result then if Is@1InSet (i, S1) then Result := false; end;
  2890. begin Result := true;
  2891. XForEach@1 (S2, TestIfInS1);
  2892. Disjoint@2s := Result end;
  2893. X
  2894. function Equal@2 (S1, S2: @2): boolean;
  2895. begin
  2896. XEqual@2 := Includes@2 (S1, S2) and Includes@2 (S2, S1);
  2897. end;
  2898. X
  2899. procedure Insert@1 (i: @1; var S: @2);
  2900. var   This, Pred, Succ: @2;
  2901. begin
  2902. if not Is@1InSet (i, S) then
  2903. X   begin
  2904. X   Pred := nil; Succ := S;
  2905. X   while Succ^.Member::integer > i::integer do begin
  2906. X      Pred := Succ; Succ := Succ^.Next end;
  2907. X   if Succ^.Member::integer < i::integer then begin
  2908. X      new (This); This^.Next := Succ; This^.Member := i;
  2909. X      if Pred <> nil then Pred^.Next := This else S := This;
  2910. X      end;
  2911. X   end;
  2912. end;
  2913. X
  2914. procedure Insert@1s (S1: @2; var S2: @2);
  2915. var   This, Pred, Succ: @2;
  2916. X   procedure Add@1 (i: @1);
  2917. X   begin Insert@1 (i, S2) end;
  2918. begin
  2919. XForEach@1 (S1, Add@1);
  2920. end;
  2921. X
  2922. procedure Remove@1 (i: @1; var S: @2);
  2923. var   Pred, This: @2;
  2924. begin
  2925. Pred := nil; This := S;
  2926. while not Equal@1 (This^.Member, i) do begin
  2927. X   Pred := This; This := This^.Next end;
  2928. if Pred <> nil then Pred^.Next := This^.Next else S := This^.Next;
  2929. Dispose (This);
  2930. end;
  2931. X
  2932. procedure Dispose@2 (var S: @2);
  2933. var   Old: @2;
  2934. begin
  2935. while S <> nil do begin Old := S; S := S^.Next; Dispose (Old) end;
  2936. end;
  2937. X
  2938. end.
  2939. X@}
  2940. X
  2941. END_OF_FILE
  2942. if test 2869 -ne `wc -c <'tests/hi09.fw'`; then
  2943.     echo shar: \"'tests/hi09.fw'\" unpacked with wrong size!
  2944. fi
  2945. # end of 'tests/hi09.fw'
  2946. fi
  2947. if test -f 'tests/hi10.fw' -a "${1}" != "-c" ; then 
  2948.   echo shar: Will not clobber existing file \"'tests/hi10.fw'\"
  2949. else
  2950. echo shar: Extracting \"'tests/hi10.fw'\" \(2635 characters\)
  2951. sed "s/^X//" >'tests/hi10.fw' <<'END_OF_FILE'
  2952. HI10: This example gives examples of heavily and lightly documented pieces
  2953. X      of code.
  2954. X
  2955. X@O@<hi10.out@>==@{
  2956. X@<Set p to the length of the longest plateau in sorted array b[1..N]@>
  2957. X
  2958. X@<Function comp@>
  2959. X@}
  2960. X
  2961. X@A@<Calculation of the longest plateau in array b@>
  2962. X
  2963. This section contains a solution to a problem outlined in section 16.3 of
  2964. the book @/The Science of Programming@/ by David Gries[Gries81].
  2965. X
  2966. X@B Given a sorted array @{b[1..N]@} of integers, we wish to determine the
  2967. X@/length@/ of the longest run of identically valued elements in the array.
  2968. This problem is defined by the following precondition and postcondition.
  2969. X
  2970. X@$@<Precondition@>==@{/* Pre: sorted(b). */@}
  2971. X@$@<Postcondition@>==@{@-
  2972. X/* Post: sorted(b) and p is the length of the longest run in b[1..N]. */@}
  2973. X
  2974. X@B We approach a solution to the problem by deciding to try the approach of
  2975. scanning through the array one element at a time maintaining a useful
  2976. invariant through each iteration. A loop variable
  2977. array index @{i@} is created for this purpose. The bound function is
  2978. X@{N-i@}. Here is the invariant.
  2979. X
  2980. X@$@<Invariant@>==@{@-
  2981. X/* Invariant: sorted(b) and 1<=i<=N and           */
  2982. X/*            p is len of longest run in b[1..i]. */@}
  2983. X
  2984. X@B Establishing the invariant above in the initial, degenerate case is easy.
  2985. X
  2986. X@$@<Establish the plateau loop invariant initially@>==@{i=1; p=1;@}
  2987. X
  2988. X@B At this stage, we have the following loop structure. Note that when both
  2989. the invariant and @{i != N@} are true, the postcondition holds and the loop
  2990. can terminate.
  2991. X
  2992. X@$@<Set p to the length of the longest plateau in sorted array b[1..N]@>==@{@-
  2993. X@<Precondition@>
  2994. X@<Establish the plateau loop invariant initially@>
  2995. while (i != N)
  2996. X  {
  2997. X   @<Invariant@>
  2998. X   @<Loop body@>
  2999. X  }
  3000. X@<Postcondition@>
  3001. X@}
  3002. X
  3003. X@B Now there remains only the loop body whose sole task is to increase @{i@}
  3004. X(and so decrease the value of the bound function) while maintaining the
  3005. invariant. If @{p@} is the length of the longest run
  3006. seen so far (i.e. in b[1..i]), then, because the array is sorted,
  3007. the extension of our array range to
  3008. X@{b[1..i+1]@} can only result in an increase in @{p@} if the new element
  3009. terminates a run of length @{p+1@}. The increase can be at most 1. Because
  3010. the array is sorted, we need
  3011. only compare the endpoints of this possible run to see if it exists. This
  3012. is performed as shown below.
  3013. X
  3014. X@$@<Loop body@>==@{i++; if (b[i] != b[i-p]) p++;@}
  3015. X
  3016. X
  3017. X
  3018. X
  3019. X
  3020. X@A The following function compares two C~strings and returns TRUE iff they
  3021. are identical.
  3022. X
  3023. X@$@<Function comp@>==@{@-
  3024. bool comp(p,q)
  3025. char *p,*q;
  3026. X{
  3027. X while (TRUE)
  3028. X   {
  3029. X    if (*p != *q  ) return FALSE;
  3030. X    if (*p == '\0') return TRUE;
  3031. X    p++; q++;
  3032. X   }
  3033. X}
  3034. X@}
  3035. END_OF_FILE
  3036. if test 2635 -ne `wc -c <'tests/hi10.fw'`; then
  3037.     echo shar: \"'tests/hi10.fw'\" unpacked with wrong size!
  3038. fi
  3039. # end of 'tests/hi10.fw'
  3040. fi
  3041. if test -f 'tests/pr08.fw' -a "${1}" != "-c" ; then 
  3042.   echo shar: Will not clobber existing file \"'tests/pr08.fw'\"
  3043. else
  3044. echo shar: Extracting \"'tests/pr08.fw'\" \(2839 characters\)
  3045. sed "s/^X//" >'tests/pr08.fw' <<'END_OF_FILE'
  3046. PR08: Test semantic checking of macro definitions.
  3047. X
  3048. Trip parser to be sure that we won't get any output files!
  3049. X@>
  3050. X
  3051. X1. File macro has parameters. Error.
  3052. X@O@<Sloth 1@>@(@3@)@{Walrus@}
  3053. X@A@<Error recovery point@>
  3054. X
  3055. X2. File macro is additive. Error.
  3056. X@O@<Sloth 2@>+=@{Walrus@}
  3057. X@A@<Error recovery point@>
  3058. X
  3059. X3. File macro has too long a name. The test name has 1200 characters. Err.
  3060. Note: This test can't test the error message if the maximum length of a
  3061. macro name is less than the maximum length of a file name as the name
  3062. error is caught first.
  3063. X@p maximum_input_line_length = infinity
  3064. X@O@<1234567890(elided by comp.sources.unix moderator)1234567890@>@{@}
  3065. X@A@<Error recovery point@>
  3066. X
  3067. X4. File macro has zero or many attributes. Error.
  3068. X@O@<Sloth 3@>@Z@{Walrus@}
  3069. X@A@<Error recovery point@>
  3070. X
  3071. X@O@<Sloth 4@>@M@{Walrus@}
  3072. X@A@<Error recovery point@>
  3073. X
  3074. X@O@<Sloth 5@>@Z@M@{Walrus@}
  3075. X@A@<Error recovery point@>
  3076. X
  3077. X5. Previous definition is full, current is additive.
  3078. X@$@<Walrus 1@>==@{Sloth@}
  3079. X@$@<Walrus 1@>+=@{Aardvark@}
  3080. X@A@<Error recovery point@>
  3081. X
  3082. X6. Previous definition is additive, current is full.
  3083. X@$@<Walrus 2@>+=@{Sloth@}
  3084. X@$@<Walrus 2@>==@{Aardvark@}
  3085. X@A@<Error recovery point@>
  3086. X
  3087. X7. Non-first body part of partial has parameter.
  3088. X@$@<Unicorn@>@(@3@)+=@{Turkey@}
  3089. X@$@<Unicorn@>@(@3@)+=@{Turkey@}
  3090. X@A@<Error recovery point@>
  3091. X
  3092. X8. Zero or many attributes on non-first body part of additive.
  3093. X@$@<Elephant@>@Z@M+=@{Turkey@}
  3094. X@$@<Elephant@>@Z@M+=@{Turkey@}
  3095. X@A@<Error recovery point@>
  3096. X
  3097. X9. Check that non-existent formal parameters are caught.
  3098. X
  3099. X@$@<Zero@>@Z@{Sloth@1Walrus@}
  3100. X@A@<Error recovery point@>
  3101. X
  3102. X@$@<One@>@(@1@)@Z@{Sloth@2Walrus@}
  3103. X@A@<Error recovery point@>
  3104. X
  3105. X@$@<Many@>@(@7@)@Z@{Sloth@8Walrus@}
  3106. X@A@<Error recovery point@>
  3107. END_OF_FILE
  3108. if test 2839 -ne `wc -c <'tests/pr08.fw'`; then
  3109.     echo shar: \"'tests/pr08.fw'\" unpacked with wrong size!
  3110. fi
  3111. # end of 'tests/pr08.fw'
  3112. fi
  3113. if test -f 'tests/pr09.fw' -a "${1}" != "-c" ; then 
  3114.   echo shar: Will not clobber existing file \"'tests/pr09.fw'\"
  3115. else
  3116. echo shar: Extracting \"'tests/pr09.fw'\" \(2046 characters\)
  3117. sed "s/^X//" >'tests/pr09.fw' <<'END_OF_FILE'
  3118. PR09: Test calls and actual parameter lists.
  3119. X
  3120. XFirst trip up the parser so we don't get any further.
  3121. X@>
  3122. X
  3123. Now define some macros to call. No error.
  3124. X
  3125. X@$@<Zero@>@{@}
  3126. X@$@<One@>@(@1@)@{@}
  3127. X@$@<Two@>@(@2@)@{@}
  3128. X@$@<Three@>@(@3@)@{@}
  3129. X@$@<Nine@>@(@9@)@{@}
  3130. X@$@#"@{@}
  3131. X
  3132. The following test calls should NOT generate any errors.
  3133. X
  3134. X@$@<Macro containing the test macro calls.@>==@{
  3135. X1. Test macro call with no parameter list.
  3136. X@<Zero@>
  3137. X
  3138. X2. Test macro call with quick name.
  3139. X@#"
  3140. X
  3141. X3. Test macro call with one parameter.
  3142. X@<One@>@(Toucan@)
  3143. X
  3144. X4. Test macro call with many parameters.
  3145. X@<Two@>@(Toucan@,Teapot@)
  3146. X@<Three@>@(Toucan@,Teapot@,Walrus@)
  3147. X@<Nine@>@(Toucan@,Teapot@,Walrus@,
  3148. X          Toucan@,Teapot@,Walrus@,
  3149. X          Toucan@,Teapot@,Walrus@)
  3150. X
  3151. X5. Test macro calls with double quotes on parameters.
  3152. X@<One@>@( @"Toucan@"@)
  3153. X@<Two@>@(@"Toucan@"   @,   @"Teapot@"@)
  3154. X@<Three@>@(@"Toucan@" @,
  3155. X           @"Teapot@" @,
  3156. X           @"Walrus@" @)
  3157. X@<Nine@>@( @"Toucan@" @, @"Teapot@" @, @"Walrus@" @,
  3158. X           @"Toucan@" @, @"Teapot@" @, @"Walrus@" @,
  3159. X           @"Toucan@" @, @"Teapot@" @, @"Walrus@" @)
  3160. X
  3161. X7. Test macro calls with mixed double quotes on parameters.
  3162. X@<Two@>@(@"Toucan@"   @,Teapot@)
  3163. X@<Three@>@(@"Toucan@" @,
  3164. X           @"Teapot@" @,Walrus@)
  3165. X@<Nine@>@( @"Toucan@" @, @"Teapot@" @,   Walrus   @,
  3166. X           @"Toucan@" @,   Teapot   @, @"Walrus@" @,
  3167. X           @"Toucan@" @, @"Teapot@" @, @"Walrus@" @)
  3168. X
  3169. X@} @! End of macro definition enclosing all these legal tests.
  3170. X
  3171. X8. Test macro calls with a variety of syntax errors in parameter list.
  3172. X@$@<Error1@>@{
  3173. X@<Zero@>@(
  3174. X@}
  3175. X@A@<Error recovery point@>
  3176. X
  3177. X@$@<Error2@>@{
  3178. X@<Zero@>@)
  3179. X@}
  3180. X@A@<Error recovery point@>
  3181. X
  3182. X@$@<Error3@>@{
  3183. X@<One@>@(@"Toucan@)
  3184. X@}
  3185. X@A@<Error recovery point@>
  3186. X
  3187. X@$@<Error4@>@{
  3188. X@<One@>@(@"Toucan@"@"Sloth@"@)
  3189. X@}
  3190. X@A@<Error recovery point@>
  3191. X
  3192. X@$@<Error5@>@{
  3193. X@<Two@>@(@"Toucan@"Teapot@)
  3194. X@}
  3195. X@A@<Error recovery point@>
  3196. X
  3197. X@$@<Error6@>@{
  3198. X@<Two@>@(@"Toucan@"Teapot
  3199. X@}
  3200. X@A@<Error recovery point@>
  3201. X
  3202. X@$@<Error7@>@{
  3203. X@<Two@>@(@"Toucan@"Teapot
  3204. X@<Three@>@(Toucan@,
  3205. X           @"Teapot@,Walrus
  3206. X
  3207. X@}
  3208. X@A@<Error recovery point@>
  3209. X
  3210. END_OF_FILE
  3211. if test 2046 -ne `wc -c <'tests/pr09.fw'`; then
  3212.     echo shar: \"'tests/pr09.fw'\" unpacked with wrong size!
  3213. fi
  3214. # end of 'tests/pr09.fw'
  3215. fi
  3216. if test -f 'tests/sc10.fw' -a "${1}" != "-c" ; then 
  3217.   echo shar: Will not clobber existing file \"'tests/sc10.fw'\"
  3218. else
  3219. echo shar: Extracting \"'tests/sc10.fw'\" \(4058 characters\)
  3220. sed "s/^X//" >'tests/sc10.fw' <<'END_OF_FILE'
  3221. Scanner Test: Special Sequence Recognition
  3222. X==========================================
  3223. This test tests to see that FunnelWeb is recognising the full set of special
  3224. sequences.
  3225. X
  3226. Turn Off the Parser
  3227. X-------------------
  3228. XFirst we cause a deliberate scanner error so as to prevent the parser from
  3229. generating lots of errors over the syntactic rubbish presented here.
  3230. X
  3231. X   @ 
  3232. X
  3233. List of All Possible Special Sequences
  3234. X--------------------------------------
  3235. The following is a list of the default special character followed by each of
  3236. the ASCII printables.
  3237. X000 to 031 are unprintable control characters.
  3238. X
  3239. X032  @    - ILLEGAL.  (Note: Hyphen is needed to avoid trailing blanks error.)
  3240. X033  @!   - Comment.
  3241. X034  @"   - Parameter delimeter.
  3242. X035  @#X  - Short name sequence.
  3243. X@$   036  - Define macro. Has to be at start of line.
  3244. X037  @%   - ILLEGAL.
  3245. X038  @&   - ILLEGAL.
  3246. X039  @'   - ILLEGAL.
  3247. X040  @(   - Open parameter list.
  3248. X041  @)   - Close parameter list.
  3249. X042
  3250. X@*        - Old fashioned section marker (has to be at start of a line.).
  3251. X043  @+   - Insert newline.
  3252. X044  @,   - Parameter separator.
  3253. X045  @-
  3254. X          - Ignore end of line marker (has to be at end of line).
  3255. X046  @.   - ILLEGAL.
  3256. X047  @/   - Emphasised text.
  3257. X048  @0   - ILLEGAL.
  3258. X049  @1   - Formal parameter 1.
  3259. X050  @2   - Formal parameter 2.
  3260. X051  @3   - Formal parameter 3.
  3261. X052  @4   - Formal parameter 4.
  3262. X053  @5   - Formal parameter 5.
  3263. X054  @6   - Formal parameter 6.
  3264. X055  @7   - Formal parameter 7.
  3265. X056  @8   - Formal parameter 8.
  3266. X057  @9   - Formal parameter 9.
  3267. X058  @:   - ILLEGAL.
  3268. X059  @;   - ILLEGAL.
  3269. X060  @<   - Open macro name.
  3270. X061  @=@  - Set special character.
  3271. X062  @>   - Close macro name.
  3272. X063  @?   - ILLEGAL.
  3273. X064  @@   - Insert special character into text.
  3274. X@A  065   - New section (level 1). Must be at start of a line.
  3275. X@B  066   - New section (level 2). Must be at start of a line.
  3276. X@C  067   - New section (level 3). Must be at start of a line.
  3277. X@D  068   - New section (level 4). Must be at start of a line.
  3278. X@E  069   - New section (level 5). Must be at start of a line.
  3279. X070  @F   - ILLEGAL.
  3280. X071  @G   - ILLEGAL.
  3281. X072  @H   - ILLEGAL.
  3282. X073  @I   - Include file. Will provoke an error here though.
  3283. X074  @J   - ILLEGAL.
  3284. X075  @K   - ILLEGAL.
  3285. X076  @L   - ILLEGAL.
  3286. X077  @M   - Tags macro as being allowed to be called many times.
  3287. X078  @N   - ILLEGAL.
  3288. X@O   079  - New macro attached to output file. Has to be at start of line.
  3289. X080  @P   - Pragma. Will cause error here though.
  3290. X081  @Q   - ILLEGAL.
  3291. X082  @R   - ILLEGAL.
  3292. X083  @S   - ILLEGAL.
  3293. X084  @T   - Typesetter directive. Will cause an error here though.
  3294. X085  @U   - ILLEGAL.
  3295. X086  @V   - ILLEGAL.
  3296. X087  @W   - ILLEGAL.
  3297. X088  @X   - ILLEGAL.
  3298. X089  @Y   - ILLEGAL.
  3299. X090  @Z   - Tags macro as being allowed to be called zero times.
  3300. X091  @[   - ILLEGAL.
  3301. X092  @\   - ILLEGAL.
  3302. X093  @]   - ILLEGAL.
  3303. X094  @^D(065) - Insert control character into text
  3304. X095  @_   - ILLEGAL.
  3305. X096  @`   - ILLEGAL.
  3306. X@a   097  - New section (level 1). Must be at start of a line.
  3307. X@b   098  - New section (level 1). Must be at start of a line.
  3308. X@c   099  - New section (level 1). Must be at start of a line.
  3309. X@d   100  - New section (level 1). Must be at start of a line.
  3310. X@e   101  - New section (level 1). Must be at start of a line.
  3311. X102  @f   - ILLEGAL.
  3312. X103  @g   - ILLEGAL.
  3313. X104  @h   - ILLEGAL.
  3314. X105  @i   - Include file. Will provoke an error here though.
  3315. X106  @j   - ILLEGAL.
  3316. X107  @k   - ILLEGAL.
  3317. X108  @l   - ILLEGAL.
  3318. X109  @m   - Tags macro as being allowed to be called many times.
  3319. X110  @n   - ILLEGAL.
  3320. X@O   111  - New macro attached to output file. Has to be at start of line.
  3321. X112  @p   - Pragma. Will cause error here though.
  3322. X113  @q   - ILLEGAL.
  3323. X114  @r   - ILLEGAL.
  3324. X115  @s   - ILLEGAL.
  3325. X116  @t   - Typesetter directive. Will cause an error here though.
  3326. X117  @u   - ILLEGAL.
  3327. X118  @v   - ILLEGAL.
  3328. X119  @w   - ILLEGAL.
  3329. X120  @x   - ILLEGAL.
  3330. X121  @y   - ILLEGAL.
  3331. X122  @z   - Tags macro as being allowed to be called zero times.
  3332. X123  @{   - Open macro body.
  3333. X124  @|   - ILLEGAL.
  3334. X125  @}   - Close macro body.
  3335. X126  @~   - ILLEGAL.
  3336. X127 to 255 are not standard printable ASCII characters.
  3337. END_OF_FILE
  3338. if test 4058 -ne `wc -c <'tests/sc10.fw'`; then
  3339.     echo shar: \"'tests/sc10.fw'\" unpacked with wrong size!
  3340. fi
  3341. # end of 'tests/sc10.fw'
  3342. fi
  3343. if test -f 'tests/sc11.fw' -a "${1}" != "-c" ; then 
  3344.   echo shar: Will not clobber existing file \"'tests/sc11.fw'\"
  3345. else
  3346. echo shar: Extracting \"'tests/sc11.fw'\" \(2773 characters\)
  3347. sed "s/^X//" >'tests/sc11.fw' <<'END_OF_FILE'
  3348. SC11: Syntax of the include pragma.
  3349. X
  3350. X1. Test include pragma not at start of line.
  3351. X
  3352. X   @i
  3353. X
  3354. X2. Test ATi not followed by a blank.
  3355. X
  3356. X@ix
  3357. X
  3358. X3. Test include filename is too long. The maximum on the Macintosh is
  3359. X   255 but we will use a filename of over 1024 characters so as to make
  3360. X   the test portable. The actual length used is 1100 characters in the
  3361. X   filename.
  3362. X
  3363. X            1         (elided by comp.sources.unix moderator)7         8         9         0
  3364. X@i 1234567890(elided by comp.sources.unix moderator)1234567890
  3365. X
  3366. X4. Include pragma has an empty filename. Note: Because the ATi has to be
  3367. X   followed by a blank, we have to incur a trailing blank error here in
  3368. X   order to provoke the error we really want to see.
  3369. X
  3370. X@i 
  3371. X
  3372. END_OF_FILE
  3373. if test 2773 -ne `wc -c <'tests/sc11.fw'`; then
  3374.     echo shar: \"'tests/sc11.fw'\" unpacked with wrong size!
  3375. fi
  3376. # end of 'tests/sc11.fw'
  3377. fi
  3378. if test -f 'userman/u_manual.log' -a "${1}" != "-c" ; then 
  3379.   echo shar: Will not clobber existing file \"'userman/u_manual.log'\"
  3380. else
  3381. echo shar: Extracting \"'userman/u_manual.log'\" \(4136 characters\)
  3382. sed "s/^X//" >'userman/u_manual.log' <<'END_OF_FILE'
  3383. This is TeX, Version 3.0 (preloaded format=lplain 90.9.16)  27 MAY 1992 15:26
  3384. X**&LaTeX u_manual.tex
  3385. X(u_manual.tex
  3386. LaTeX Version 2.09 <13 Jun 1989>
  3387. X(:TeX-inputs:book.sty
  3388. Document Style `book' <24 May 89>.
  3389. X(:TeX-inputs:bk10.sty)
  3390. X\descriptionmargin=\dimen99
  3391. X\c@part=\count78
  3392. X\c@chapter=\count79
  3393. X\c@section=\count80
  3394. X\c@subsection=\count81
  3395. X\c@subsubsection=\count82
  3396. X\c@paragraph=\count83
  3397. X\c@subparagraph=\count84
  3398. X\c@figure=\count85
  3399. X\c@table=\count86
  3400. X) (:TeX-inputs:titlepage.sty) [0
  3401. X
  3402. X
  3403. X]
  3404. X\@indexfile=\write3
  3405. X
  3406. Writing index file u_manual.idx 
  3407. X(u_manual.aux)
  3408. X(u_ch0.tex [1] [2
  3409. X
  3410. X] (u_manual.toc [3] [4] [5] [6])
  3411. X\tf@toc=\write4
  3412. X [7] [8
  3413. X
  3414. X] [9] [10
  3415. X
  3416. X]
  3417. Underfull \hbox (badness 10000) in paragraph at lines 137--140
  3418. X[]\tenrm Thanks to \tenbf Barry Dwyer[][] \tenrm (\tentt dwyer@cs.adelaide.edu.
  3419. au\tenrm ) and \tenbf Roger Bris-senden[][]
  3420. X
  3421. X\hbox(7.5+2.5)x426.79134, glue set 5.25278
  3422. X.\hbox(0.0+0.0)x0.0
  3423. X.\tenrm T
  3424. X.\tenrm h
  3425. X.\tenrm a
  3426. X.\tenrm n
  3427. X.etc.
  3428. X
  3429. X[11] [12
  3430. X
  3431. X]
  3432. Underfull \hbox (badness 5652) in paragraph at lines 163--169
  3433. X[]\tenbf Typesetting: \tenrm This[] doc-u-ment was pre-pared by the au-thor us-
  3434. ing An-drew Trevor-
  3435. X
  3436. X\hbox(6.94444+1.94444)x426.79134, glue set 3.83969
  3437. X.\hbox(0.0+0.0)x0.0
  3438. X.\tenbf T
  3439. X.\kern-0.31944
  3440. X.\tenbf y
  3441. X.\tenbf p
  3442. X.etc.
  3443. X
  3444. X
  3445. Underfull \hbox (badness 1117) in paragraph at lines 163--169
  3446. X\tenrm row's[][] (\tentt akt150@cscgpo.anu.edu.au\tenrm ) im-ple-men-ta-tion (O
  3447. z-TeX[]) of the T[]X/L[]T[]X\tenbf [Knuth84][]
  3448. X
  3449. X\hbox(7.5+3.01385)x426.79134, glue set 2.23746
  3450. X.\tenrm r
  3451. X.\tenrm o
  3452. X.\kern-0.27779
  3453. X.\tenrm w
  3454. X.\tenrm '
  3455. X.etc.
  3456. X
  3457. X) (u_ch1.tex [13] [14
  3458. X
  3459. X]
  3460. Chapter 1.
  3461. X[15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29]
  3462. X[30] [31] [32] [33] [34] [35]
  3463. Underfull \vbox (badness 4108) has occurred while \output is active
  3464. X\vbox(682.86613+0.0)x426.79134, glue set 3.45125
  3465. X.\glue(\topskip) 3.05556
  3466. X.\hbox(6.94444+0.8333)x426.79134, glue set 416.29144fil
  3467. X..\hbox(0.0+0.0)x0.0
  3468. X..\tentt @
  3469. X..\tentt }
  3470. X..\hbox(0.0+0.0)x0.0
  3471. X..\penalty 10000
  3472. X..etc.
  3473. X.\glue(\baselineskip) 11.1667
  3474. X.\hbox(0.0+0.0)x0.0
  3475. X.\glue(\parskip) 0.0
  3476. X.etc.
  3477. X
  3478. X [36]
  3479. X[37] [38]) (u_ch2.tex [39] [40
  3480. X
  3481. X]
  3482. Chapter 2.
  3483. X[41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55]
  3484. X[56] [57] [58] [59]
  3485. Underfull \vbox (badness 10000) has occurred while \output is active
  3486. X\vbox(682.86613+0.0)x426.79134
  3487. X.\glue(\topskip) 3.88889
  3488. X.\hbox(6.11111+2.22223)x426.79134, glue set 201.0433fil
  3489. X..\hbox(0.0+0.0)x0.0
  3490. X..\tentt @
  3491. X..\tentt !
  3492. X..\penalty 10000
  3493. X..\glue 5.24995
  3494. X..etc.
  3495. X.\glue(\parskip) 0.0
  3496. X.\glue(\baselineskip) 2.83333
  3497. X.\hbox(6.94444+1.38887)x426.79134, glue set 237.79298fil
  3498. X..\hbox(0.0+0.0)x0.0
  3499. X..\tentt [
  3500. X..\tentt i
  3501. X..\tentt n
  3502. X..\tentt h
  3503. X..etc.
  3504. X.etc.
  3505. X
  3506. X [60]
  3507. X[61]) (u_ch3.tex [62]
  3508. Chapter 3.
  3509. X[63
  3510. X
  3511. X] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77]
  3512. X[78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92]
  3513. X[93] [94] [95] [96] [97] [98] [99]) (u_ch4.tex [100]
  3514. Chapter 4.
  3515. X[101
  3516. X
  3517. X] [102] [103] [104] [105] [106]) (u_ch5.tex [107] [108
  3518. X
  3519. X]
  3520. Chapter 5.
  3521. X[109]
  3522. Underfull \hbox (badness 10000) in paragraph at lines 163--163
  3523. X[] []\egtrm To reg-is-ter as a
  3524. X
  3525. X\hbox(5.46666+1.55556)x376.79134, glue set 71.60066
  3526. X.\hbox(0.0+0.0)x15.00002
  3527. X.\glue -15.00002
  3528. X.\hbox(0.0+0.0)x15.00002
  3529. X..\glue 15.00002
  3530. X..\glue -20.0
  3531. X..\glue -5.0
  3532. X..\hbox(0.0+0.0)x20.0, glue set 20.0fil
  3533. X...\glue 0.0 plus 1.0fil
  3534. X..\glue 5.0
  3535. X.\penalty 0
  3536. X.\egtrm T
  3537. X.etc.
  3538. X
  3539. X[110] [111] [112]
  3540. Underfull \hbox (badness 10000) in paragraph at lines 330--340
  3541. X\tenrm FunnelWeb was
  3542. X
  3543. X\hbox(6.94444+0.0)x426.79134, glue set 215.12605
  3544. X.\tenrm F
  3545. X.\kern-0.83334
  3546. X.\tenrm u
  3547. X.\tenrm n
  3548. X.\tenrm n
  3549. X.etc.
  3550. X
  3551. X[113]) (u_cha.tex [114]
  3552. Appendix A.
  3553. X[115
  3554. X
  3555. X] [116]
  3556. Appendix B.
  3557. X[117
  3558. X
  3559. X] (u_manual.sin [118
  3560. X
  3561. X] [119] [120] [121] [122] [123] [124] [125] [126])
  3562. X[127
  3563. X
  3564. X]) (u_manual.aux) ) 
  3565. Here is how much of TeX's memory you used:
  3566. X 244 strings out of 1960
  3567. X 2227 string characters out of 13235
  3568. X 43797 words of memory out of 59980
  3569. X 2172 multiletter control sequences out of 2500
  3570. X 20391 words of font info for 77 fonts, out of 27000 for 100
  3571. X 14 hyphenation exceptions out of 307
  3572. X 16i,8n,15p,190b,240s stack positions out of 200i,40n,60p,500b,600s
  3573. X
  3574. Output written on u_manual.dvi (128 pages, 442404 bytes).
  3575. END_OF_FILE
  3576. if test 4136 -ne `wc -c <'userman/u_manual.log'`; then
  3577.     echo shar: \"'userman/u_manual.log'\" unpacked with wrong size!
  3578. fi
  3579. # end of 'userman/u_manual.log'
  3580. fi
  3581. echo shar: End of archive 2 \(of 20\).
  3582. cp /dev/null ark2isdone
  3583. MISSING=""
  3584. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do
  3585.     if test ! -f ark${I}isdone ; then
  3586.     MISSING="${MISSING} ${I}"
  3587.     fi
  3588. done
  3589. if test "${MISSING}" = "" ; then
  3590.     echo You have unpacked all 20 archives.
  3591.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  3592. else
  3593.     echo You still need to unpack the following archives:
  3594.     echo "        " ${MISSING}
  3595. fi
  3596. ##  End of shell archive.
  3597. exit 0
  3598.