Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!apple!oliveb!amdahl!rtech!gonzo!daveb From: daveb@gonzo.UUCP (Dave Brower) Newsgroups: comp.lang.c Subject: Re: Want a way to strip comments from a Summary: I feel a contest coming on Message-ID: <620@gonzo.UUCP> Date: 24 Mar 89 03:11:44 GMT References: <7150@siemens.UUCP> <9900010@bradley> <4896@cbnews.ATT.COM> <16078@cup.portal.com> <16492@mimsy.UUCP> Reply-To: daveb@gonzo.UUCP (Dave Brower) Distribution: na Organization: Gonzo Media Group Lines: 25 In article <16492@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: >In article <16078@cup.portal.com> Tim_CDC_Roberts@cup.portal.com writes: >>When scanning the result of preprocessing a nontrivial C program with >>many include files, one finds dozens (in some cases hundreds) of blank >>lines. ... Why not eliminate them and issue a #line instead? > >Why bother? Typically there are at most a few tens in a row. It is >probably faster to count 20 blank lines than to process one >`#line 1234' directive. Yup, true enough for compilation. It is sort of annoying tough when you need to look at the intermediate file to figure something out. So, I offer this week's challenge: Smallest program that will take "blank line" style cpp output on stdin and send to stdout a scrunched version with appropriate #line directives. [f]lex, Yacc, [na]awk, sed, perl, c, c++ are all acceptable. This will be an amusing excercise in typical text massaging that can be enlightening for many people. Is this branching out of comp.lang.c? Where should it go? -dB -- "I came here for an argument." "Oh. This is getting hit on the head" {sun,mtxinu,amdahl,hoptoad}!rtech!gonzo!daveb daveb@gonzo.uucp