Date: Tue, 13 Feb 1996 15:45:42 -0600 (CST) From: Aaron Ucko Subject: Re: More Complex preprocessors To: djgpp AT delorie DOT com Message-id: <01I164O0S8PG000H5K@VAX1.ROCKHURST.EDU> Organization: Rockhurst College; Kansas City, MO MIME-version: 1.0 >Hi All, > >Every so often I keep wishing that C/C++ had a decent macro preprocessor >of the order of most macro-assemblers. I've had a play around with the >different tools available and cannot find anything that really suits me. > >Can anyone suggest anything? > >Here is what I have looked at so far. > >1) m4 This does give me much of what I want, however the m4 commands > use words which could easily be used in the c code (shift, eval, > index, len, etc...) causing all kinds of possible bugs. > > I would prefer each preprocessor line to be obvious ie starting > with # or some other flag. The fvwm sources contain an m4 file to rename all m4 identifiers to start with (I seem to recall) an underscore; a modified version of this macro (to use something like _m4_ as the prefix) might work. What would be _really_ nice, though, would be something like TeX's "mouth." Everything special begins with an escape character (\ in TeX, perhaps # in tcpp), and almost completely arbitrary syntax is legal. -- Aaron Ucko (ucko AT vax1 DOT rockhurst DOT edu; finger for PGP public key) | httyp! "That's right," he said. "We're philosophers. We think, therefore we am." -- Terry Pratchett, _Small Gods_ | Geek Code 3.1 [for explanation, finger hayden AT mankato DOT msus DOT edu]: GCS/M/S/C d- s: a18 C++(+++)>++++ UL++>++++ P++ L++>+++++ E- W(-) N++(+) o+ K- w--- O M@ V-(--) PS++(+++) PE- Y(+) PGP(+) t(+) !5 X-- R(-) tv-@ b++(+++) DI+ !D-- G++(+++) e->+++++(*) h!>+ r-(--)>+++ y?