[comp.software-eng] SUMMARY of responses "Looking for source code line counter"

maclaugh@marlin.NOSC.MIL (Janet M. Maclaughlin) (02/23/90)

For those who expressed interest in the responses I received to my request
for SLOC counters, here is a list of some of the most significant responses
If you are interested in any of these, let me know.    
NOTE: If you have a UUCP address, I may not be able to get email through 
as I don't have a UUCP map. (Dave Mackie - maybe we can figure it out?)
------------------------------------------------------------------
                     Janet Maclaughlin
Software Engineering Process Office  -  Naval Ocean Systems Center
San Diego, CA 92152    (619) 553-6248    MILNET: maclaugh@nosc.mil
UUCP: {ihnp4,akgua,decvax,dcdwest,ucbvax}!sdcsvax!nosc!maclaugh
                        
                          RECEIVED
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
A list of FTP sites where there is software to pick up
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
A list of references to metrics publications
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
From: Warren Harrison, warren@cs.pdx.edu

Try PC-METRIC ro UX-METRIC from SET Laboratories, Inc. (503/289-4758).
They have versions for C, COBOL, Ada, Pascal, Modula-2, FORTRAN, C++,
dBASE, various assembly languages, and probably some others I don't
know about. Versions are available for MS-DOS and most UNIXs (SunOS,
UNIX/386, Amdahl UTS) and VAX VMS. I recall the MS-DOS versions are like
$200 and the UNIX versions are $500 for a single user license.

In addition to Line COunts they also do most of the popular metrics like
Software Science and Cyclomatic Complexity. You'd have to call them for
line counting rules though.
Disclaimer: My wife works for SET Labs.

                     SOURCE CODE RECEIVED
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
 1. From: Bob Riemenschneider <rar@ads.com>
     An awk script to count SLOC in a list of Ada source files.
     Two versions of the count are maintained:
       1. Conservatively, count a line if it ends -* modulo some spaces
          and/or a comment -*  in a semicolon
       2. Liberally, count a line if it is neither blank nor simply a comment 

 2. From: Bob Riemenschneider <rar@ads.com>
     Ada program that counts SLOC in a list of Ada source files.  
     Two versions of the count are maintained:
       1. Conservatively, count a line if it ends -* modulo some spaces
          and/or a comment -*  in a semicolon
       2. Liberally, count a line if it is neither blank nor simply a comment 

 3. From: bstaton@x102a.ess.harris.com (staton brian 01296)
     C program that counts SLOC in an Ada source file.  
     Definition of a 'line':
	 If a line in the source file is not all blank or all comment,
	 then it is a line of code.
     Required host
	 PC running DOS.  (The code uses ANSI escape sequences to 
	 _optionally_ display the source file and highlight lines
	 of code.  This feature could be easily removed.  The code
	 uses the strstr function which some older (pre ANSI standard)
	 C compiler libraries don't support.  Other than that, the
	 code is portable).

 4. From: bstaton@x102a.ess.harris.com (staton brian 01296)
     C program that counts SLOC in a C source file.  
     Definition of a 'line':
	 If a line in the source file is not all blank or all comment,
	 then it is a line of code.
     Required host
	 PC running DOS.  (The code uses ANSI escape sequences to 
	 _optionally_ display the source file and highlight lines
	 of code.  This feature could be easily removed.  The code
	 uses the strstr function which some older (pre ANSI standard)
	 C compiler libraries don't support.  Other than that, the
	 code is portable).

 5. From:  Paul Biron (pbiron@weber.ucsd.edu)
    An 'awk' script that counts "C  but could easily be modified 
    for Pascal or any other language that has open and close comment 
    delimiters. As the comment in the header says, any line that has
    no comments and is not blank, no serious parse going on here.
    Environment:  Unix with awk, nawk, or gawk; or MS-DOS with something
    like MKS awk, or PolyAwk.

 6. From:  Kent Landfield  INTERNET:kent@ssbell.IMD.Sterling.COM 
                           UUCP:ssbell!kent
                           Phone: (402) 291-8300
   X** A C program which a general purpose tool for dealing with
   X** comment lines in C files.  comments also identifies
   X** Embedded comment and Delimiter mismatch lines while
   X** displaying comment lines of a file.
   X**
   X** The output from comments	goes to	standard out.
   X**
   X** If no options are used the comment lines	are output as they
   X** appear in the file or taken from	standard in.
   X**
   X** The meanings of the options are:
   X**
   X** -c   Produce code/comment/total statistics. The information
   X**  is displayed in 2 rows.  The first row contains the
   X**  number of characters of code, comment, and total.  The
   X**  second row contains	the number of lines with code, com-
   X**  ments, and total.  The second row also includes the
   X**  name of the	file being processed.
   X**
   X**  Special characters (ie. form and line feeds) are
   X**  included only in total counts therefore the	number of
   X**  characters of code plus comments do	not equal the total
   X**  number of characters.  This	prevents blank lines from
   X**  affecting the counts.
   X**
   X**  A line with	both code and a	comment	counts as one code
   X**  line and one comment line.	Therefore the number of
   X**  lines with code plus lines with comment may	be greater
   X**  than the total lines.
   X**
   X** -j   Left justify the comments printed.
   X**
   X** -R   Strip comments removing all	blank lines.
   X**
   X** -r   Strip comments removing multiple blank lines.
   X**
   X** -s   Strip comments leaving all blank lines.
   X**
   X** -tfilename
   X**  The	filename to display with -c if taken from standard
   X**  input.  This option	must be	used in	conjunction with
   X**  the	-c option for it to be active.
   X**
   X** -v   Print out the header for count option.  Three columns
   X**  from the -c	option are labeled:
   X**
   X** Code	   Comment    Total
   X**
   X**  This option	must be	used in	conjunction with the -c
   X**  option for it to be	active.
   X**
   X** file File to be processed if not	from standard input.