Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!pprg.unm.edu!hc!lll-winken!uunet!mcvax!ukc!mucs!ian From: ian@ux.cs.man.ac.uk (Ian Cottam) Newsgroups: comp.lang.c Subject: Re: request for C comment stripper Message-ID: <5695@ux.cs.man.ac.uk> Date: 21 Mar 89 11:10:48 GMT References: <5693@ux.cs.man.ac.uk> <985@philmds.UUCP> Reply-To: ian@mucs.UUCP (Ian Cottam) Organization: Computer Science, University of Manchester, UK Lines: 24 In article <985@philmds.UUCP> leo@philmds.UUCP (Leo de Wit) writes: >In article <5693@ux.cs.man.ac.uk> ian@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@nss.cs.ucl.ac.uk JANET: ian@uk.ac.man.cs.ux UUCP: ..!mcvax!ukc!mur7!ian -----------------------------------------------------------------