Next: Question 30
Prev: Question 28
Up: Common Things People Want To Know
Top: Top
[29] Do FWEB files necessarily have to be monolithic?
[Later, this item might move to the general FAQ by David B. Thompson]
Archive-Date: Thu, 10 Dec 1992 16:16:50 CST
There is no real support for multiple source files under FWEB.
What some might like to see is a solution similar to the one
presented by Cameron Smith in his KR-CWEB-SAMPLE distribution.
He had to hack CWEB's cwebmac.sty to get a neat table of
contents and a combined index distinguishing between entries from
different source files [in fact, `KR-CWEB-SAMPLE' illustrates
many more things, all more or less related to breaking up a literate
C program into multiple source files].
For illustration, this is how the table of contents should look like
(sample from Cameron's files):
source module 1: main Sect Page
introduction..................1.1 1.1
main pgm......................1.4 1.2
index.........................1.10 1.4
source module 2: getop
introduction..................2.1 2.1 etc.
while entries of the combined index are separated like
Index for source module 1: main
...
Index for source module 2: getop
...
...
Sections in source module 1: main
<case for newlines 9> used in section 4...
...
For FWEB, the inclusion of files using `@i' is a partial
solution [M-11-13] to avoid having to put all the source code
in one file. So far, nobody has presented a solution in
Cameron's spirit.
This feature is put on JAK's list of possible future enhancements.
It is not in 1.30a, though. Note that CWEB has got an @i
option, too (although FWEB's is somewhat more general).
Yet another approach (not limited to FWEB) is the use of a
smart editor like GNU Emacs, combined with a smart
tool like web-mode which is effectively hiding many
of the mischiefs of monolithic source files from the programmer.
(see Question 18).