Seth Woolley's Man Viewer

cweb(1) - ctangle, cweave - translate CWEB to C and/or TeX - man 1 cweb

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

CWEB(1L)                                                              CWEB(1L)



NAME
       ctangle, cweave - translate CWEB to C and/or TeX

SYNOPSIS
       ctangle [ -bhp ] [ +s ] webfile[.w] [changefile[.ch]] [outputfile[.c]]
       cweave [ -befhpx ] [ +s ] webfile[.w] [changefile[.ch]] [output-
       file(1,n)[.tex]]

DESCRIPTION
       The ctangle program converts a CWEB source document  into  a  C program
       that  may be compiled in(1,8) the usual way.  The output file(1,n) includes #line
       specifications so that debugging can be  done  in(1,8)  terms  of  the  CWEB
       source file.

       The cweave program converts the same CWEB file(1,n) into a TeX file(1,n) that may
       be formatted and printed in(1,8) the usual way.  It takes  appropriate  care
       of  typographic  details  like  page layout and the use of indentation,
       italics, boldface, etc., and it supplies extensive cross-index informa-
       tion that it gathers automatically.

       CWEB  allows you to prepare a single document containing all the infor-
       mation that is needed both to produce a  compilable  C program  and  to
       produce  a  well-formatted  document  describing the program in(1,8) as much
       detail as the writer may desire.  The user of CWEB ought to be familiar
       with TeX as well as C.

       The command line should have one, two, or three names on it.  The first
       is taken as the CWEB file(1,n) (and .w is added if(3,n) there is  no  extension).
       If  that  file(1,n)  cannot  be opened, the extension .web is tried instead.
       (But .w is recommended, since .web usually implies Pascal.)   If  there
       is  a second name, it is a change file(1,n) (and .ch is added if(3,n) there is no
       extension).  The change file(1,n)  overrides  parts  of  the  WEB  file(1,n),  as
       described in(1,8) the documentation.  If there is a third name, it overrides
       the default name of the output file(1,n), which is ordinarily  the  same  as
       the  name  of  the  input  file(1,n) (but on the current directory) with the
       extension .c or .tex.

       Options in(1,8) the command line may be either turned off  with -  (if(3,n)  they
       are  on  by  default) or turned on with + (if(3,n) they are off by default).
       In fact, the options are processed from left to right,  so  a  sequence
       like -f +f corresponds to +f (which is the default).

       The  -b option suppresses the banner line that normally appears on your
       terminal when ctangle or cweave begins.  The -h option  suppresses  the
       happy  message  that normally appears if(3,n) the processing was successful.
       The -p option suppresses progress reports (starred module  numbers)  as
       the processing takes place.  If you say -bhp, you get nothing but error(8,n)
       messages.

       The +s option prints statistics about memory usage at the end of a  run
       (assuming that the programs have been compiled with the -DSTAT switch(1,n)).

       There are three other options applicable to cweave only:  -f  means  do
       not  force a newline after every statement in(1,8) the formatted output.  -e
       inhibits the enclosure of C material formatted by  cweave  in(1,8)  brackets
       \PB{...}.   Such  brackets  are normally inserted so that special hooks
       can be used by cweb-latex and similar  programs.   -x  means  omit  the
       index and table of contents.

FILES
       /usr/local/lib/tex/inputs/cwebmac.tex
              TeX macros used by cweave output.

       /usr/local/src/cweb/cwebman.tex
              The user manual.

       /usr/local/src/cweb/examples/wc.w
              An introductory example.

       /usr/local/src/cweb/examples/wmerge.w
              Patch program based on CWEB-style change files.

       /usr/local/lib/cweb
              Directory for cweb "include" files.

SEE ALSO
       Literate Programming
              by D. E. Knuth

       Weaving a Program
              by Wayne Sewell

       The CWEB System of Structured Documentation
              by  Donald  E.  Knuth and Silvio Levy (hardcopy version(1,3,5) of cweb-
              man.tex and the source code listings)

       tex(1), cc(1)

AUTHORS
       Don Knuth wrote WEB for TeX  and  Pascal.   Silvio  Levy  designed  and
       developed  CWEB  by  adapting  the WEB conventions to C and by recoding
       everything in(1,8) CWEB.  Knuth began using CWEB and  made  further  refine-
       ments.  Many other helpers are acknowledged in(1,8) the CWEB manual.




                                  2002-Apr-13                         CWEB(1L)

References for this manual (incoming links)