This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)(Learn how and when to remove this template message)
|Paradigm||Literate, imperative (procedural), structured|
|Designed by||Donald Knuth|
|Developer||Donald Knuth & Silvio Levy|
3.67 / October 24, 2006
|Typing discipline||Static, weak, manifest, nominal|
|License||custom free-software license|
CWEB is a computer programming system created by Donald Knuth and Silvio Levy as a follow-up to Knuth's WEB literate programming system, using the C programming language (and to a lesser extent the C++ and Java programming languages) instead of Pascal.
Unlike most other documentation generators which relegate documentation to comments, CWEB approach is to write an article to document the making of the source code. Much like TeX articles, the source is divided into sections according to documentation flow. C code sections are seamlessly intermixed in the line of argumentation.
- Can enter manual TeX code as well as automatic.
- Make formatting of C code for pretty printing.
- Can define sections, and can contain documentation and codes, which can then be included into other sections.
- Write the header code and main C code in one file, and can reuse the same sections, and then it can be tangled into multiple files for compiling.
#linepragmas so that any warnings or errors refer to the .w source.
- Include files.
- Change files, which can be automatically merged into the code when compiling/printing.
- Produces index of identifiers and section names in the printout.
- Silvio Levy (12 June 2004). "An example of CWEB" (PDF).