This directory contains the source to my C preprocessor.  This behaves
more or less the way the 4.xbsd /lib/cpp does, but it has some extra
features.  These include the #elif control and controls introduced with
@ signs anywhere on the line.  The @ sign controls were designed to
allow preprocessor definitions that include preprocessor controls in
the replacement text.  /lib/cpp does not permit this sort of hackery,
but there are some things for which it is the natural solution (such as
the following, which it would have been nice to have been able to write
in this preprocessor itself):

#define maybe(name) @ifdef name predefine("name"); @endif

or, equivalently,

@define maybe(name) @@ifdef name predefine("name"); @@endif @

For compatibility, @ signs are disabled by default.  In order to enable
them as control introducers, use the line

#define at_sign_ctrls

or anything equivalent, such as -Dat_sign_ctrls on the command line.
You can also use -D@ on the command line, though not "#define @".

I have added other features, such as expression evaulation and control
structure in the preprocessor.  There are some purely cosmetic issues,
such as blank line compression.  As a concession to humans who wish to
read preprocessor output (as when debugging complicated #defines), my
preprocessor does not generate huge numbers of blank lines for comments
and preprocessor lines.  It compacts out all lines that contain nothing
but possibly some whitespace and produces a line-number line so that
line numbers in compiler errors will be correct.  Also in the interests
of cosmetics, *one* blank line is left alone.  Two or more will be
compressed out.  (This happens even inside strings, which could be
considered a bug, though such code is not legal C; a backslash to
escape the newline is necessary.  This does not affect most uses of cpp
for non-C things.)

For a full list of ways in which this cpp behaves differently from the
BSD /lib/cpp, read the file Differences.

Mine is, unfortunately, substantially slower.  Someday I will have to
try to speed it up.  Mine also is very probably less portable.  I know
it runs under Sun releases 3.5 and 4.1, NeXT release 1.0, and mtXinu
4.3+NFS, and previous versions ran under 4.3 and 4.2 BSD and Sun
releases 2.0 and 3.0, but that's all I've tried it on.

I explicitly place this code in the public domain.  You can do anything
you like with it (though I would appreciate it if you give credit where
it is due).

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu

Comments by F. Steltz

I did the port of the Mouse CPP as a second step in the unfinished porting imake
to the MSDOS (windows,...) environment.  (The first step was porting
gnu make 3.71)

I used the Watcom C/C++ 386 compiler version 10.a.
This allowed the building of a 32 bit executable run under
the royalty-free DOS extender by Rational System (DOS4GW.EXE)
(included).

This CPP will run under MSDOS or Windows in a DOS box.

I had very few problems with the port.  The most problems had to
do with "/" (UNIX) -> "\"(MSDOS) path names.

I added a cpp.man document that shows how to use CPP. 

The makefile was modified to use the WATCOM 386 compiler in my
environment so may have to change it.

!!! The file DOS4GW.EXE must be copied to a directory in your path. !!!

F. Steltz (FrankS6707@aol.com)
