Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cadence!acae037!eversole From: eversole@acae037.cadence.com (Richard Eversole; x6239) Newsgroups: comp.software-eng Subject: RE: Re: WANTED: "C" code line counter program Message-ID: <1991Mar12.152134.15903@cadence.com> Date: 12 Mar 91 15:21:34 GMT References: <1991Mar6.214157.18633@ntpal.uucp> <9082@suns6.crosfield.co.uk> Sender: usenet@cadence.com (USENET News) Reply-To: eversole@acae037.cadence.com (Richard Eversole; x6239) Organization: Cadence Design Systems, Inc. Lines: 30 -- In article , mitch@hq.af.mil (Mitch Wright) writes: |> > I need a "C" code line counter program, preferably written in |> >"C". It will be used on several platforms, so solutions involving |> Ray> So how about one that counts semi-colons :-) |> |> Because: |> |> #include |> main() |> { |> printf(";;;; Hello World ;;;;\n"); |> } But that is still only 1 semi-colon. It is very simple code to ignore quoted strings !!!! Someone who knows YACC & LEX can write that in only a few lines. Take maybe an hour to do. (Of course counting only semi-colons not in quoted strings using only C code would take not much more than the same hour to code.) Counting semi-colons is a trivial programming task. ===================================================================== eversole@cadence.com Live long and prosper !