Debian Codegraph @

texk/web2c/cwebdir/examples/README

raw
1 This directory contains several files for programs that are tutorial
2 and/or useful. If you are new to CWEB, read "wc.w" first; it's a
3 typical example of CWEB applied to system programming.
4
5 The Makefile on this directory is a generic way to build applications
6 written in CWEB. Say, for example, "make wc" to get an executable
7 program "wc" from wc.w. Say "make wc.dvi" to get a printable listing
8 of its documentation. The program "wc" is a slight improvement over
9 UNIX's standard word-count utility. (Try it, for example, with "wc *".)
10
11 The treeprint program, by Norman Ramsey, generates tree-structured
12 representations of file hierarchies. To use it, say "make treeprint.run"
13 and then
14 find dir -type p -print | sort | treeprint
15 (on a UNIX system), where dir is a directory with interesting subdirectories.
16
17 The wmerge program, by Silvio Levy, produces a single CWEB file from a
18 given CWEB file and a change file. It expands any "web include" (@i)
19 specifications in the original CWEB file. To use it, say "make wmerge.run"
20 and then, e.g., "wmerge foo.w bar.ch > foobar.w". Both CTANGLE and
21 CWEAVE already accept change files, so you need not merge anything yourself
22 in normal day-to-day operations; but wmerge can be useful in connection with
23 the spelling checker described below.
24
25 If you intend to read the source code of CTANGLE and CWEAVE, you may
26 well wish to read wmerge.w first, or the hardcopy version obtained from
27 "make wmerge.dvi"; it is similar but much simpler.
28
29 The extex and wordtest programs, by Don Knuth, are useful spellcheckers.
30 After "make extex.run" say also "ln extex excweb"; this gives
31 you two filter programs, extex and excweb, that remove extraneous
32 material from TeX and CWEB source files, respectively. To use them,
33 you can say for example
34 cat foo.w | excweb | spell
35 (or replace "cat foo.w" with "wmerge foo.w bar.ch"). A similar pipeline
36 for TeX files would be
37 cat foo.tex | extex | spell
38 Even better is to replace "spell" by "wordtest /usr/local/lib/dict/words",
39 if you have a suitable dictionary. One such dictionary in the public domain
40 can be found in directory ~ftp/pub/dict at ftp.cs.stanford.edu, available
41 via anonymous ftp. To make your own dictionary from given ones,
42 cat dict1 dict2 dict3 dict4 | wordtest > words
43 is quick and effective. See the documentation of wordtest for more info.
44
45 A file kspell.el that provides an emacs user interface to extex+excweb+wordtest
46 also appears in this directory. (Somebody should write ELWEB...)
47
48 The files xview_types.w and xlib_types.w are examples of @i (include) files
49 that can be used when writing XView programs. They are based on the header
50 files in OpenWindows Version 3.0.
51
52 An example XView application appears in Knuth's program oemacs.w, which
53 he uses for heavy emacsing. It's not very portable, but if you have
54 OpenWindows3 and a Sun Type-4 keyboard you may like it as much as he does.
55 (It replaces "emacstool".) The file oemacs.el goes with it.