What is CMANGLE?
CMANGLE is an alternative to CTANGLE for CWEB. The principle differences
between CMANGLE and CTANGLE is that CMANGLE keeps comments in the output, and
converts the TeX documentation sections into C comments that are placed with
the code each time it is included. In this way it produces even more human
readable C source than CWEBx.
For an idea of what CMANGLE's output looks like, download
cmangle.c, which is the source code for CMANGLE
after processing by itself.
CMANGLE also has these other features:
- The ability to process some CWEB files, as reflecting the extensive effort
(six hours) put into the writing CMANGLE from scratch. For an idea of what it
can handle, look at cmangle.w, since CMANGLE was tested
on itself. It was also tested on code produced as part of my doctorate, but I
can't give that out right now. One feature that does work, but isn't present
in cmangle.w is the generation of multiple output files using @(.
- A cantankerous parser and output engine, due to the above. In particular,
make sure that section markers occur only at the start of lines, and that there
are no C style comments inside TeX documentation (even between |'s).
- A complete disregard for correct indentation of the resulting C code. Use
your favourite editor to fix the indentation later.
- A complete ignorance of #line directives.
- Numerous bugs.
- The extensive documentation that is this web page.
But it might just be what you need, so give it a try.
Download CMANGLE
Compile with something like:
gcc -Wall -o cmangle cmangle.c
The formatted version of CMANGLE can be downloaded as:
Page created 13 September 2006.