home *** CD-ROM | disk | FTP | other *** search
- This directory contains several files for programs that are tutorial
- and/or useful. If you are new to CWEB, read "wc.w" first; it's a
- typical example of CWEB applied to system programming.
-
- The MAKEFILE in this directory is a generic way to build applications
- written in CWEB. The SMAKEFILE in this directory is a complete example
- makefile for the SAS/C compiler for the Commodore Amiga, written by
- Andreas Scherer. Say, for example, "smake all" to get all the executable
- programs from their sources. Say "smake docs" to get a printable listing
- of their documentations.
-
- The WC program is a slight improvement over UNIX's standard word-count
- utility. To use it, say "make wc" to get an executable program "wc"
- from wc.w. Say "make wc.dvi" to get a printable listing of its documentation.
-
- The TREEPRINT program, by Norman Ramsey, generates tree-structured
- representations of file hierarchies. To use it, say "make treeprint"
- and then
- find dir -type p -print | sort | treeprint
- (on a UNIX system), where dir is a directory with interesting subdirectories.
-
- The WMERGE program, by Silvio Levy, produces a single CWEB file from a
- given CWEB file and a change file. It expands any "include" specifications
- in the original CWEB file. To use it, say "make wmerge" and then, e.g.,
- "wmerge foo.w bar.ch > foobar.w". Both CTANGLE and CWEAVE already accept
- change files, so you need not merge anything yourself in normal day-to-day
- operations; but wmerge can be useful in connection with the spelling checker
- described below.
-
- If you intend to read the source code of CTANGLE and CWEAVE, you may
- well wish to read wmerge.w first, or the hardcopy version obtained from
- "make wmerge.dvi"; it is similar but much simpler.
-
- The files XVIEW_TYPES.W and XLIB_TYPES.W are examples of @i (include) files
- that can be used when writing XView programs. They are based on the header
- files in OpenWindows Version 3.0.
-
- An examples XVIEW application appears in Knuth's program OEMACS.W, which
- he uses for heavy emacsing. It's not very portable, but if you have
- OpenWindows3 and a Sun Type-4 keyboard you may like it as much as he does.
- (It replaces "emacstool".) The file OEMACS.EL goes with it.
-
- The EXTEX and WORDTEST programs, by Don Knuth, are useful spellcheckers.
- After "make extex" say also "ln extex excweb"; this gives
- you two filter programs, extex and excweb, that remove extraneous
- material from TeX and CWEB source files, respectively. To use them,
- you can say for example
- cat foo.w | excweb | spell
- (or replace "cat foo.w" with "wmerge foo.w bar.ch"). A similar pipeline
- for TeX files would be
- cat foo.tex | extex | spell
- Even better is to replace "spell" by "wordtest /usr/local/lib/dict/words",
- if you have a suitable dictionary. One such dictionary in the public domain
- can be found in directory ~ftp/pub/dict at labrea.stanford.edu, available
- via anonymous ftp. To make your own dictionary from given ones,
- cat dict1 dict2 dict3 dict4 | wordtest > words
- is quick and effective. See the documentation of wordtest for more info.
-
- A file KSPELL.EL that provides an emacs user interface to extex+excweb+wordtest
- also appears in this directory. (Somebody should write ELWEB...)
-
- All the CWEB example programs listed above are provided with change files
- for full ANSI-C compliance (prototypes, #include files, etc.), so they
- should be compilable with any decent C compiler, although they may not be
- operational on every machine.
-
- The COMMONWORDS program, by Andreas Scherer, is based on the WEB program of
- the same name by Don Knuth. It counts the frequencies of the most common
- words in a given text file. To use it, say "make commonwords" and then
- "commonwords < commonwords.w".
-
- The PRIMES program, by Andreas Scherer, is based on the WEB program of the
- same name by Don Knuth. It generates the first thousand prime numbers.
- To use it, say "make primes" and then simply "primes".
-
- The SAMPLE program, by Andreas Scherer, is based on the WEB program of the
- same name by Don Knuth. It generates samples of random numbers. To use
- it, say "make sample" and then simply "sample". Answer the input questions
- with positive integers and see the results.
-