Re: [cciug] source code line counter ?

From: Brad Appleton (bradapp@enteract.com)
Date: Thu Jan 20 2000 - 18:45:41 EST


On Thu, Jan 20, 2000 at 04:13:03PM -0700, COCA,PEDRO (HP-Boise,ex1) wrote:
> I am currently writing a program that will not only calculate the number of
> lines in a text file but also the number of lines changed. With some help
> from the cciug I found a Unix shell script that was written and can be found
> on contrib. software area on the Rational web site. Anyway, I am rewriting
> it in perl for use on NT. I'll be glad to send it to you when I'm done. If
> you want to investigate it on your own check out 'cleartool annotate' it
> provides a lot of good information.

I already wrote two such beasts many years ago and still use them today.
Take a look at:

   http://www.enteract.com/~bradapp/clearperl/sclc-cdiff.html

The sclc and cdiff scripts that are ancient Perl4 code I wrote and
still use. The cdiff script produces a cleardiff with surrounding lines
of context. The sclc script counts lines of code (and comments, and
non-comment source lines, and assembly-equivalent source lines) for
several programming languages. When installed in the same directory as
cdiff, the sclc script can also count changed lines of code.

>From the above URL you can surf to:

   * the manual page for sclc
   * the manual page for cdiff
   * Perl source-code for sclc and cdiff

If you ever get the desire to fully convert these to Perl5 - please
drop me a line. Also, if you ever port them to Win32 please let me know
what changes were needed. I'm sure the changes would mostly be pretty
minimal, but I haven't made them. If someone else does it, I'll be happy
to incorporate them into my code.

-- 
Brad Appleton <bradapp@enteract.com> http://www.enteract.com/~bradapp/
  "And miles to go before I sleep." -- Robert Frost
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  



This archive was generated by hypermail 2b29 : Sun May 06 2001 - 00:22:32 EDT