Statement terminators
Badri Lokanathan
badri at valhalla.ee.rochester.edu
Tue May 9 13:58:31 AEST 1989
>In article <2296 at mit-caf.MIT.EDU> vlcek at mit-caf.MIT.EDU (Jim Vlcek) writes:
>> In fact, I myself would lean the other direction and prefer that
>> macros not follow the strict ``to the next newline'' rule, but rather
>> have a more explicit means of terminating the definition body.
In article <1843 at ubu.warwick.UUCP> geoff at cs.warwick.ac.uk (Geoff Rimmer) writes:
>I agree that it can be *very* annoying having to backquote all the
>newlines in macros (take a look at "putc" in stdio.h !) But how else
>could cpp be designed so it knows when to stop? By matching the
>parentheses/ brackets & braces?
One could have a default set of delimiters that can be modified on the
fly (as in sed pattern matching, for instance)
Say the default is ^
#define Foo ^your macro^
But if your macro contains ^, then modify by
#define Foo @your macro@
cpp can easily be designed to recognize the first non-white character as a
delimiter ...
--
"I care about my fellow man {) badri at ee.rochester.edu
Being taken for a ride, //\\ {ames,cmcl2,columbia,cornell,
I care that things start changing ///\\\ garp,harvard,ll-xn,rutgers}!
But there's no one on my side."-UB40 _||_ rochester!ur-valhalla!badri
More information about the Comp.lang.c
mailing list