The best way for me to read the CWEB program is to run cweave ( manpage ) on the .w source file to create the .tex file, and then run pdfetex to get good PDF hyperlinks. Clearly:
`.W SOURCE ----(cweave)----> .TEX ----(pdfetex)----> PDF`
As you know, the structure of the CWEB program is itself a hyperlink (with sections related to other sections). A good, linked PDF file is just a pleasure to read, especially if the programs were written by don Knut himself!
The following setup will require some effort on your part (and MB downloads), but I hope you enjoy the end result:
- Install Cygwin (for any serious Windows programmer, I think installing cygwin is easy). Make sure you install the bundle bundle package (tex, pdfetex, amstex and all that). If cygwin gives you the option to install CWEB, do it too.
- If you do not get
cweave and ctangle with cygwin, download the sources and create / install them.
After installing cygwin and cweb, follow these steps for any .w program that you want to learn (I take the bdd12.w example):
- Run
cweave as follows: cweave bdd12.w This should generate the bdd12.tex file. - Then run
pdfetex as follows: pdfetex bdd12.tex This should help you get a detailed PDF file with cross-reference. The generated PDF also has a character index at the end (and some other cross-reference data), so you can quickly jump to their definitions.
source share