Roger Leigh wrote: > [EMAIL PROTECTED] writes: > > > Paul Jarc wrote: > >> [EMAIL PROTECTED] (Himanshu Garg) wrote: > >> > Could you give me an example by which I could use m4 for c > >> > preprocessing such as that for replacing #include<file.h> by its > >> > contents. > >> > >> m4 wouldn't use the same syntax or search path as the C preprocessor, > >> but it can do file inclusion: > >> include(`/usr/include/file.h') > >> See the m4 documentation for more. > > > > Thanks for the reply Paul. This won't do for me. In my case I would > > like to treat statements beginning with % as preprocessor stmts. > > So just write > > define([%include], [include([$1])]) > > or whatever variation you like. You can extend m4 with you own custom > macros to do whatever you like. >
Okay, how about "do loops", "procedures", "if/then/else" and "goto". Would m4 make it easy to do all these. I am working on a preprocessor for pl/1 which has all these as macros! Before I start writing a parser etc, I was wondering if I should rather do it using m4. Thank You, Himanshu. _______________________________________________ help-gnu-utils mailing list help-gnu-utils@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-utils