As far as I know this is not possible in CWEB. You must use a tool
that can distinguish between the different languages you are using.
Currently only the language independent tools (e.g. noweb or nuweb,
both certainly worth a try) allow to mix multi-lingual code in a file.
I know that FWEB can handle different languages too, but I not
sure if you can mix them in a single file.
You'll have to forget about prettyprinting though if you choose
a language independent tool, but this can be fixed (for noweb
see for example http://www.iti.informatik.th-darmstadt.de/
~gaertner/pretzel/noweb-pp.html).
For the sources of these tools, see the FAQ of
comp.programming.literate.
Cheers,
Felix
: Currently only the language independent tools (e.g. noweb or nuweb,
: both certainly worth a try) allow to mix multi-lingual code in a file.
: I know that FWEB can handle different languages too, but I not
: sure if you can mix them in a single file.
You can. I do it. Stefan
==========================================================================
Stefan A. Deutscher, s...@utk.edu, (001)-423-[522-7845|974-7838|574-5897]
home^ UTK^ ORNL^
==========================================================================
If there is software you'd like to have in a native OS/2 version, visit
the: OS/2 E-mail Campaign Page http://www.andrews.edu/~boyko/email.html
--------------------------------------------------------------------------
>Does anyone know if there is a way to stop cweave from formatting
>some of my C sections and treat them as normal text (or verbatim).
Cweb (at least version 3.0 and above) has a @= control code which
is valid in the C part of a chunk and treats the text as verbatim.
I have used this to place copyright information into my generated
cpp and hpp files as otherwise ctangle removes comments while
writing these files. The only problem is that cweave places a box
around each line. I'm sure that this would be easy to change in
the cwebmac.tex file - of course this should be in a change file
that is tangled in to produce cwebmac.tex!
So the process is:
@(makefile@>=
@=The first line@>
@=The second line@>
Messy!
Hope that this helps
Brian
-----------------------------------------------------------------------
Brian Danilko email: t...@olis.net.au
Formal Solutions home page: http://olis.net.au/~tsg
phone/fax: (08) 8388-7216
postal: 20 Main Street
Hahndorf, South Australia 5245
It would be nice if the WEAVE processor could determine automatically
what kind of file a particular chunk is going too. This would make it
possible to use different prettyprinters for different chunks or to
spare some chunks from any prettyprinting at all.
But how determine which file a chunk goes to? One could follow the chunk
dependency tree to a root and look what it's called (e.g. ``... header ...'')
and conclude the information from this. Are there any other ideas?
Felix
If your only purpose is to choose a prettyprinter, I bet it is easy to
modify the prettyprinter to give you a judgement about whether the
language matches the prettyprinter. If you use Knuth's techniques,
just look for minimum-size reductions.
N
--
Norman Ramsey
http://www.cs.virginia.edu/~nr
I mailed a lengthy reply to Deniz concerning this matter, which I am not
going to repeat here. In short, the problem is that ctangle still considers
the output as C code, and emits comments (like /*45:*/) and `#line'
directives, which `make' is probably not going to like. With CWEBx this can
be solved using the `-l' option to ctangle. However, provided you do not
wish to break up the makefile into chunks, you could alternatively simply
keep it as a separate file and include it verbatim (using \input) into one
of the sections of the CWEB file, which seems a better solution to me.
It would be a nice idea to have a per-output-file C/verbatim attribute in
CWEB; this would not be too hard to implement, if it weren't for the fact
that when cweave processes a module, it has no idea to which file ctangle
will send the corresponding code (it might in fact go to several files). I
wonder how FWEB tackles this issue; my guess is that it leaves the
responsibility for selecting languages consistently with the inclusion
structure of modules to the literate programmer.
--
Marc van Leeuwen | What has man wrought
CWI, Amsterdam | for the year naughty-naught?
http://www.cwi.nl/~maavl/ | '00-programming will get its revenge!