1 .TH CWEB 1L 2002-Apr-13
4 ctangle, cweave \- translate CWEB to C and/or TeX
13 ] webfile[.w] [changefile[.ch]] [outputfile[.c]]
20 ] webfile[.w] [changefile[.ch]] [outputfile[.tex]]
26 program converts a CWEB
27 source document into a C\ program that may be compiled in the usual way.
28 The output file includes #line specifications so that debugging can be
29 done in terms of the CWEB source file.
33 program converts the same CWEB file into a TeX file that may be
34 formatted and printed in the usual way.
35 It takes appropriate care of typographic details like page
36 layout and the use of indentation, italics, boldface, etc., and it supplies
37 extensive cross-index information that it gathers automatically.
39 CWEB allows you to prepare a single
40 document containing all the information that is needed both to produce
41 a compilable C\ program and to produce a well-formatted document
42 describing the program in as much detail as the writer may desire.
43 The user of CWEB ought to be familiar with TeX as well as\ C.
45 The command line should have one, two, or three names on it.
46 The first is taken as the CWEB file (and .w is added if there is no
48 If that file cannot be opened, the extension .web is tried instead.
49 (But .w is recommended, since .web usually implies Pascal.)
50 If there is a second name, it is a change file (and .ch is added if there is
52 The change file overrides parts of the WEB file,
53 as described in the documentation.
54 If there is a third name, it overrides
55 the default name of the output file, which is ordinarily the same as
56 the name of the input file (but on the current directory) with the
59 Options in the command line may be either turned off with\ \-
60 (if they are on by default) or turned on with\ + (if they are off by
62 In fact, the options are processed from left to right,
63 so a sequence like -f\ +f corresponds to +f (which is the default).
67 option suppresses the banner line that normally appears on your terminal
68 when ctangle or cweave begins.
71 option suppresses the happy message that normally appears if the processing
75 option suppresses progress reports (starred module numbers) as the processing
77 If you say -bhp, you get nothing but error messages.
81 option prints statistics about memory usage at the end of a run
82 (assuming that the programs have been compiled with the -DSTAT switch).
84 There are three other options applicable to
88 means do not force a newline after every statement in the formatted output.
90 inhibits the enclosure of C\ material formatted by
94 Such brackets are normally inserted so that special hooks
99 means omit the index and table of contents.
103 /usr/local/lib/tex/inputs/cwebmac.tex
104 TeX macros used by cweave output.
106 /usr/local/src/cweb/cwebman.tex
109 /usr/local/src/cweb/examples/wc.w
110 An introductory example.
112 /usr/local/src/cweb/examples/wmerge.w
113 Patch program based on CWEB-style change files.
116 Directory for cweb "include" files.
120 .I Literate Programming
126 .I The CWEB System of Structured Documentation
127 by Donald E. Knuth and Silvio Levy (hardcopy version of cwebman.tex
128 and the source code listings)
133 Don Knuth wrote WEB for TeX and Pascal.
134 Silvio Levy designed and developed CWEB
135 by adapting the WEB conventions to\ C and by recoding everything in CWEB.
136 Knuth began using CWEB and made further refinements.
137 Many other helpers are acknowledged in the CWEB manual.