Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ncar!csn!boulder!happy.colorado.edu!hsrender From: hsrender@happy.colorado.edu Newsgroups: comp.software-eng Subject: Re: WANTED: "C" code line counter program Message-ID: <1991Mar20.101004.1@happy.colorado.edu> Date: 20 Mar 91 16:10:04 GMT Sender: news@colorado.edu (The Daily Planet) Organization: University of Colorado, Boulder Lines: 17 Nntp-Posting-Host: happy In article <4816@berry19.UUCP>, crocker@motcid.UUCP (Ronald T. Crocker) writes: > Ok, so back to the question at hand: does anyone have a C program that > counts C lines of code. I have a sed(1) script that will do it (I'll > post it if anyone is interested), but that isn't what is wanted. The > following lex program "almost" works (It doesn't handle quoted strings > quite correctly, and it counts lines that consist of only comments as > lines of code...; it is an exercise for the reader to modify the > program ;-> ) There's a set of tools filed under 'metrics' under the comp.sources.unix archive on gatekeeper.dec.com. Included is a tool called kdsi for counting C LOC. There's also a stripcom tool that strips comments out of C programs. I don't know what volume of the archive it's under, sorry. All of this stuff is available via anonymous ftp to gatekeeper or any other of the comp.sources.unix archive sites. hal.