comp.lang.ada
 help / color / mirror / Atom feed
* Re: A tool to count lines in Ada programs
       [not found]   ` <3i8gsl$npt@gnat.cs.nyu.edu>
@ 1995-02-23 14:24     ` Larry Kilgallen, LJK Software
  0 siblings, 0 replies; 11+ messages in thread
From: Larry Kilgallen, LJK Software @ 1995-02-23 14:24 UTC (permalink / raw)


In article <3i8gsl$npt@gnat.cs.nyu.edu>, dewar@cs.nyu.edu (Robert Dewar) writes:

> actually there *is* a GCC port to VMS, and making a port of GNAT using this
> as a base is not a huge job, just hasn't been done yet. Of course to be
> really useful, you need to implement all the Dec interfaces and pragmas etc,
> which is a bit more work.

SDL, the tool which DEC uses to make the first (large) cut at Ada bindings
for OS features was just made available as freeware in December.

There may be a copyright issue regarding the OS feature descriptions, but
the input to SDL ships with VMS so delivering the tool (and a post-massage
tool to fix up the results) with a compiler should work.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: A tool to count lines in Ada programs
       [not found]     ` <3i0pss$q14@gnat.cs.nyu.edu>
@ 1995-02-24 14:58       ` DEAN RUNZEL
  0 siblings, 0 replies; 11+ messages in thread
From: DEAN RUNZEL @ 1995-02-24 14:58 UTC (permalink / raw)


Robert Dewar (dewar@cs.nyu.edu) wrote:
: Phil's comment on "not everyone using Unix" is worth a response. Standard
: unix utilities are available on virtually *all* machines, so something like
: this wc suggestion is indeed pretty universal. If you don't have a basic
: set of unix compatible tools on your PC or whatever, you should get
: hold of them, they can certainly make life a little bit easier.

True, but the name of the group is comp.lang.ada not comp.os.unix. Now about
discussing solutions in Ada, I know of a very simple line counter that was
created by Rick Conn. It uses aflex and ayacc to build a lexical analyzer
and parser respectively. The tool is very customizable. I am part of a group
working to update this to Ada95 as part of our master's thesis. The project
will be completed in August. In addition, another group is working on a
domain specific kit for building Ada95 tools. I'll pass along the idea of
a line counter to them. For now, try searching the PAL for something
called Ada_parsing_tool. If you can't find it, e-mail me or Rick Conn and
I'll try to get a copy to you.

Later,
  Dean R. Runzel




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: A tool to count lines in Ada programs
       [not found] <3hnv6a$i96@vbohub.vbo.dec.com>
@ 1995-02-24 22:21 ` Elgar the Idiot aka Chris Warwick
       [not found] ` <3hq8pb$ah7@Starbase.NeoSoft.COM>
  1 sibling, 0 replies; 11+ messages in thread
From: Elgar the Idiot aka Chris Warwick @ 1995-02-24 22:21 UTC (permalink / raw)


Marc Rouge <rouge@taec.enet.dec.com> wrote:

>I am looking for a tool to count lines in Ada programs.

one comes with the Alsys DOS Ada compiler...

--
Chris Warwick
(902) 465-7552
cwarwick@fox.nstn.ns.ca
chris.warwick@prior.ca



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: A tool to count lines in Ada programs
       [not found] ` <3hq8pb$ah7@Starbase.NeoSoft.COM>
       [not found]   ` <3i8gsl$npt@gnat.cs.nyu.edu>
       [not found]   ` <1995Feb15.073335.29411@sei.cmu.edu>
@ 1995-02-26 23:32   ` Richard Crutchfield
       [not found]   ` <3iad84$meq@butch.lmsc.lockheed.com>
  3 siblings, 0 replies; 11+ messages in thread
From: Richard Crutchfield @ 1995-02-26 23:32 UTC (permalink / raw)


Try ASAP, Ada Static Analyzer Program, available via anonymous ftp thru 
ftp.sei.cmu.edu in /pub/dd/asap072490.tar.Z. It is written in Ada adn set 
up to compile under Dec Ada on a Vax running VMS. Gives SLOC, McCabe's, and
more...

Good Luck!
Richard Crutchfield 

crutchfield@aphst1.saic.com




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: A tool to count lines in Ada programs
       [not found]   ` <3iad84$meq@butch.lmsc.lockheed.com>
@ 1995-02-28  4:23     ` Larry Kilgallen, LJK Software
  1995-02-28 18:41       ` Mark A Biggar
  0 siblings, 1 reply; 11+ messages in thread
From: Larry Kilgallen, LJK Software @ 1995-02-28  4:23 UTC (permalink / raw)


In article <3iad84$meq@butch.lmsc.lockheed.com>, l107353@cliffy.lfwc.lockheed.com (Garlington KE) writes:
> Larry Kilgallen, LJK Software (kilgallen@eisner.decus.org) wrote:
> : I don't see how it is an exception.  On VAX/VMS and Alpha VMS, the
> : Unix-style tools are in the Posix subsystem.  It is inclusion of
> : those mechanisms (along with some ratings from X/Open) which caused
> : DEC marketing to confuse world with their "OpenVMS" terminology.
> 
> Installing Posix gives me access to Unix utilities like "wc" from the
> command line? Are you sure?
> 
> I thought installing Posix let me write/run programs that made Posix
> calls.

I do not know the details of which Unix commands are in the Posix standard,
but here is a sample from an unrelated posting.  In addition to the method
shown below, it is possible to configure particular user accounts so they
automatically get the Posix CLI (shell).

              <<< EISNER::$2$DIA7:[NOTES$HIVOL]SHOP_TALK.NOTE;1 >>>
                                 -< SHOP_TALK >-
================================================================================
Note 176.36             VMS - supported?  or going away?                36 of 36
EISNER::FORREST "Bob Forrest"                        18 lines  27-FEB-1995 22:03
          -< posix tar okay if you use a container area such as /tmp >-
--------------------------------------------------------------------------------
> VMS POSIX's
>    tar is useless, as it chokes the first time it encounters a file with
>    excess dots or other illegal characters in its name.
    
    $ posix
    psx> cd /tmp
    psx> mkdir temp
    psx> cd temp
    
      Then do tar to your heart's content.  I've unpacked tarfiles
    with the un*xed extra dot's with no problem.   So, I can't say that
    it's useless --- just annoying when you're trying to unpack non-VMS
    filenames into a VMS filename space :-(     
    
      Once you've unpacked them in a container area where the 'bizarre'
    filenames are allowed, you can change the filenames into the VMS
    allowed format and move the files where you really wanted them to go.
    



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: A tool to count lines in Ada programs
  1995-02-28  4:23     ` Larry Kilgallen, LJK Software
@ 1995-02-28 18:41       ` Mark A Biggar
  0 siblings, 0 replies; 11+ messages in thread
From: Mark A Biggar @ 1995-02-28 18:41 UTC (permalink / raw)


Attached is a perl script I wrote a while back to count Ada LOC

-----------cut here--------
#!/bin/sh
# shar style archive throw away everything above cut mark and run through sh
sed 's/^X//' >adaloc <<'EEEOOOFFF'
X#!/usr/local/bin/perl
X#
X#	aloc    Ada line of code counter
X#
X#  Rules:
X#
X#	total lines is newline count
X#	comment lines are blank or just have comment text
X#	physical lines have syntactic substance
X#	logical lines correspond to Ada statements and declarations
X#
X#	logical lines is the count of the number of semicolons
X#		outside of strings or comments
X
X$file = $ARGV[0];				# save file name for reports
X($plines,$clines,$tlines,$llines) = (0,0,0,0);
X						# zero out counters
X#physical lines
X#         comment lines
X#                 total lines
X#			  logical lines
X
Xwhile (<>) {					# read all input lines
X#	print ">>$_<<\n";			# uncomment for debug printout
X	s/^\s+//;				# strip off leading white space
X	$_ eq '' && next;			# current line empty goto next
X	/^--/ && next;				# comment go do next line
X	s/^("[^"]*")+// && do {			# token is a " string
X		$slines++;			#   line has substance
X		redo;				#   go do next token
X		};
X	s/^(''''|'[^']')// && do {		# token is a ' string
X		$slines++;			#   line has substance
X		redo;				#   go do next token
X		};
X	s/^;// && do {				# token is a ;
X		$slines++;			#   it has substance
X		$llines++;			#   count logical line
X		redo;				#   go do next token
X		};
X	s/^[^\s-"';]+// && do {			# all other characters
X		$slines++;			#   have substance
X		redo;				#   go do next token
X		};
X} continue {					# next line processing
X	$tlines++;				# count line in total
X	if ($slines) {				# if line had substance
X		$plines++;			#   count as physical
X	} else {
X		$clines++;			#   otherwise comment
X	}
X	$slines = 0;				# reset substance flag
X	if (eof) {				# if we just processed the last
X						#    line of an input file
X		&report($plines,$clines,$tlines,$llines);
X						#    generate report
X		$pl += $plines;			#    add counts to grand totals
X		$cl += $clines;
X		$tl += $tlines;
X		$ll += $llines;
X		($plines,$clines,$tlines,$llines) = (0,0,0,0);
X						# zero counts for next file
X		$file = $ARGV[0];		# save name of next file
X		$nfiles++;			# count next file
X	}
X#	printf "%d %d %d %d\n",$plines,$clines,$tlines,$llines;
X						# uncomment for debug output
X}
Xif ($nfiles > 1) {				# if more then one file
X	print "Total for all files:\n";		#   generate totals report
X	write;
X}
X
Xsub report {					# generate report
X	local($pl,$cl,$tl,$ll) = @_;
X	print "File: ",$file,"\n";
X	write;
X}
X#  report output format
Xformat STDOUT =
X  Physical lines @>>>>>>>>
X		$pl
X  Comment lines  @>>>>>>>>
X	   	$cl
X  Total lines    @>>>>>>>>
X	  	$tl
X  Logical lines  @>>>>>>>>
X		$ll
X.
EEEOOOFFF
exit



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: A tool to count lines in Ada programs
       [not found] ` <3hqtue$ikb@newsbf02.news.aol.com>
@ 1995-02-28 22:12   ` Ellis Hardin
  1995-03-01 11:46     ` Richard Crutchfield
  1995-03-03 12:43     ` Michael A. Cico
  0 siblings, 2 replies; 11+ messages in thread
From: Ellis Hardin @ 1995-02-28 22:12 UTC (permalink / raw)


Come On!
	Obviously, not everyone here is using the same OS. However, we're
all probably using Ada. If you can't write your own Ada program to count
the number of lines in a text file (containing, say, an ADA PROGRAM), you're
not worth your weight in salt.

-- 
-- Ellis Hardin, eehuc@uno.edu, University of New Orleans



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: A tool to count lines in Ada programs
  1995-02-28 22:12   ` A tool to count lines in Ada programs Ellis Hardin
@ 1995-03-01 11:46     ` Richard Crutchfield
  1995-03-01 16:08       ` Ellis Hardin
  1995-03-02  4:59       ` Larry Kahn
  1995-03-03 12:43     ` Michael A. Cico
  1 sibling, 2 replies; 11+ messages in thread
From: Richard Crutchfield @ 1995-03-01 11:46 UTC (permalink / raw)


Ellis Hardin (eehuc@uno.edu) wrote:
: Come On!
: 	Obviously, not everyone here is using the same OS. However, we're
: all probably using Ada. If you can't write your own Ada program to count
: the number of lines in a text file (containing, say, an ADA PROGRAM), you're
: not worth your weight in salt.

: -- 
: -- Ellis Hardin, eehuc@uno.edu, University of New Orleans

I don't think it is lines (cr/lf) that is of interest to everyone. Some 
peaple want the number of Ada Constructs used. They would also like 
these grouped into meaningful categories (executive, declarative, full
line comments, in-line comments, blank lines ect...). Even though I fill 
in general most should still be able to write a program to do this , I 
don't think it whould be productive. I have the ability to write a 
compiler; but no doubt would rather have one purchased rather than use
a home grown one.

crutchfi@longwood.cs.ucf.edu Richard CrutchfielD



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: A tool to count lines in Ada programs
  1995-03-01 11:46     ` Richard Crutchfield
@ 1995-03-01 16:08       ` Ellis Hardin
  1995-03-02  4:59       ` Larry Kahn
  1 sibling, 0 replies; 11+ messages in thread
From: Ellis Hardin @ 1995-03-01 16:08 UTC (permalink / raw)


Richard Crutchfield (crutchfi@longwood.cs.ucf.edu) writes:
>I don't think it is lines (cr/lf) that is of interest to everyone. Some 
>people want the number of Ada Constructs used. They would also like 
>these grouped into meaningful categories (executive, declarative, full
>line comments, in-line comments, blank lines etc...). Even though I fill 
>in general most should still be able to write a program to do this , I 
>don't think it would be productive. I have the ability to write a 
>compiler; but no doubt would rather have one purchased rather than use
>a home grown one.

	My fault.  I had not seen the original post. I made an assumption
based on the subject line one of the messages in this thread.
	That having been said, I still think it wouldn't be difficult to
write a program that counts the different constructs used.

-- 
-- Ellis Hardin, eehuc@uno.edu, University of New Orleans
-- Random Quote: Bureaucratic organization is like a septic tank - the big
--    chunks tend to rise to the top.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: A tool to count lines in Ada programs
  1995-03-01 11:46     ` Richard Crutchfield
  1995-03-01 16:08       ` Ellis Hardin
@ 1995-03-02  4:59       ` Larry Kahn
  1 sibling, 0 replies; 11+ messages in thread
From: Larry Kahn @ 1995-03-02  4:59 UTC (permalink / raw)


In article <3j1mrf$qps@longwood.cs.ucf.edu>, crutchfi@longwood.cs.ucf.edu says...
>
>Ellis Hardin (eehuc@uno.edu) wrote:
>: Come On!
>:       Obviously, not everyone here is using the same OS. However, we're
>: all probably using Ada. If you can't write your own Ada program to count
>: the number of lines in a text file (containing, say, an ADA PROGRAM), you're
>: not worth your weight in salt.
>
>: -- 
>: -- Ellis Hardin, eehuc@uno.edu, University of New Orleans
>
>I don't think it is lines (cr/lf) that is of interest to everyone. Some 
>peaple want the number of Ada Constructs used. They would also like 
>these grouped into meaningful categories (executive, declarative, full
>line comments, in-line comments, blank lines ect...). Even though I fill 
>in general most should still be able to write a program to do this , I 
>don't think it whould be productive. I have the ability to write a 
>compiler; but no doubt would rather have one purchased rather than use
>a home grown one.
>
>crutchfi@longwood.cs.ucf.edu Richard CrutchfielD
>


we make AdaMAT that does this and much much more.....

-- 
Laurence G. Kahn
Senior Software Engineer
Dynamics Research Corp.
(Finger .site@ambra.drcoffsite.com for PGP public key.)





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: A tool to count lines in Ada programs
  1995-02-28 22:12   ` A tool to count lines in Ada programs Ellis Hardin
  1995-03-01 11:46     ` Richard Crutchfield
@ 1995-03-03 12:43     ` Michael A. Cico
  1 sibling, 0 replies; 11+ messages in thread
From: Michael A. Cico @ 1995-03-03 12:43 UTC (permalink / raw)


Ellis Hardin (eehuc@uno.edu) wrote:
: Come On!
: 	Obviously, not everyone here is using the same OS. However, we're
: all probably using Ada. If you can't write your own Ada program to count
: the number of lines in a text file (containing, say, an ADA PROGRAM), you're
: not worth your weight in salt.

: -- 

If the above author deems himself not worthy of dabbling in this trivial 
endeavor, is there someone else out there that would be willing to answer 
this question?

I apologize for the naive question, but since I am a s/w engineer from
a non-CS/CE background (EE), I don't have a lot of the languages 
a non CS/CE background (actually I'm an EE), I lack the lexical analysis 
background that most of you probably have...

Thanks in advance, 

Mike

*******************************************************************************
* Mike Cico                    (315)456-2292|                                 *
* 867 Ackerman Ave.                         |    macico@mailbox.syr.edu       *
* Syracuse, NY 13210           (315)471-2636|                                 *
*******************************************************************************



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~1995-03-03 12:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3hokkj$dsa@news.rain.org>
     [not found] ` <3hqtue$ikb@newsbf02.news.aol.com>
1995-02-28 22:12   ` A tool to count lines in Ada programs Ellis Hardin
1995-03-01 11:46     ` Richard Crutchfield
1995-03-01 16:08       ` Ellis Hardin
1995-03-02  4:59       ` Larry Kahn
1995-03-03 12:43     ` Michael A. Cico
     [not found] <3hnv6a$i96@vbohub.vbo.dec.com>
1995-02-24 22:21 ` Elgar the Idiot aka Chris Warwick
     [not found] ` <3hq8pb$ah7@Starbase.NeoSoft.COM>
     [not found]   ` <3i8gsl$npt@gnat.cs.nyu.edu>
1995-02-23 14:24     ` Larry Kilgallen, LJK Software
     [not found]   ` <1995Feb15.073335.29411@sei.cmu.edu>
     [not found]     ` <3i0pss$q14@gnat.cs.nyu.edu>
1995-02-24 14:58       ` DEAN RUNZEL
1995-02-26 23:32   ` Richard Crutchfield
     [not found]   ` <3iad84$meq@butch.lmsc.lockheed.com>
1995-02-28  4:23     ` Larry Kilgallen, LJK Software
1995-02-28 18:41       ` Mark A Biggar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox