request for C comment stripper

Ian Cottam ian at ux.cs.man.ac.uk
Tue Mar 21 21:10:48 AEST 1989


In article <985 at philmds.UUCP> leo at philmds.UUCP (Leo de Wit) writes:
>In article <5693 at ux.cs.man.ac.uk> ian at ux.cs.man.ac.uk (Ian Cottam) writes:
>|
>|I usually use a lex script for such things....

>This will cover most ordinary cases; but not this one:
>
>[an include file...] (startcom.h is either empty or contains a /* ).

According to my understanding of the pANS C preprocessor and the
notion of a "translation unit", your example is erroneous as the
comment must be terminated within startcom.h.  (As a practical
man I also confirmed my suspicion with the help of gcc :-) )
However, I suspect someone can come up with a case that will
throw my lex script as comment-strippers always require more
thought than people can believe possible.

-----------------------------------------------------------------
Ian Cottam, Room IT101, Department of Computer Science,
University of Manchester, Oxford Road, Manchester, M13 9PL, U.K.
Tel: (+44) 61-275 6157         FAX: (+44) 61-275-6280
ARPA: ian%ux.cs.man.ac.uk at nss.cs.ucl.ac.uk   
JANET: ian at uk.ac.man.cs.ux    UUCP: ..!mcvax!ukc!mur7!ian
-----------------------------------------------------------------



More information about the Comp.lang.c mailing list