comp.lang.ada
 help / color / mirror / Atom feed
* source code line counting in ada
@ 2012-01-19  9:39 tonyg
  2012-01-19  9:45 ` Martin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: tonyg @ 2012-01-19  9:39 UTC (permalink / raw)



Is there a utility that can count lines of ada source code? Maybe
there is something in gnat-gps?




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

* Re: source code line counting in ada
  2012-01-19  9:39 source code line counting in ada tonyg
@ 2012-01-19  9:45 ` Martin
  2012-01-19 11:27   ` Simon Wright
  2012-01-19 11:47 ` Jeffrey Creem
  2012-01-19 20:35 ` Jeffrey Carter
  2 siblings, 1 reply; 6+ messages in thread
From: Martin @ 2012-01-19  9:45 UTC (permalink / raw)


On Jan 19, 9:39 am, tonyg <tonytheg...@gmail.com> wrote:
> Is there a utility that can count lines of ada source code? Maybe
> there is something in gnat-gps?

GPS -> Tools -> Metrics which I guess uses gnatmetric.exe, which can
be used from the command line.

-- Martin



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

* Re: source code line counting in ada
  2012-01-19  9:45 ` Martin
@ 2012-01-19 11:27   ` Simon Wright
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Wright @ 2012-01-19 11:27 UTC (permalink / raw)


Martin <martin@thedowies.com> writes:

> On Jan 19, 9:39 am, tonyg <tonytheg...@gmail.com> wrote:
>> Is there a utility that can count lines of ada source code? Maybe
>> there is something in gnat-gps?
>
> GPS -> Tools -> Metrics which I guess uses gnatmetric.exe, which can
> be used from the command line.

For some bizarre reason, "gnatmetric" doesn't understand -P <project>,
but "gnat metric" does! (I think there are other tools like this;
"gnatls" vs "gnat list")




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

* Re: source code line counting in ada
  2012-01-19  9:39 source code line counting in ada tonyg
  2012-01-19  9:45 ` Martin
@ 2012-01-19 11:47 ` Jeffrey Creem
  2012-01-19 16:32   ` tonyg
  2012-01-19 20:35 ` Jeffrey Carter
  2 siblings, 1 reply; 6+ messages in thread
From: Jeffrey Creem @ 2012-01-19 11:47 UTC (permalink / raw)


On 1/19/2012 4:39 AM, tonyg wrote:
>
> Is there a utility that can count lines of ada source code? Maybe
> there is something in gnat-gps?
>

http://csse.usc.edu/research/CODECOUNT/

Unified Code Count (UCC) includes support for Ada. In addition, it does 
things like looking for duplicate source files and can find 'difference' 
LOC counts between two code baselines (e.g. lines deleted, added, 
modified, etc)



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

* Re: source code line counting in ada
  2012-01-19 11:47 ` Jeffrey Creem
@ 2012-01-19 16:32   ` tonyg
  0 siblings, 0 replies; 6+ messages in thread
From: tonyg @ 2012-01-19 16:32 UTC (permalink / raw)


Thanks Guys I'll try both of those




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

* Re: source code line counting in ada
  2012-01-19  9:39 source code line counting in ada tonyg
  2012-01-19  9:45 ` Martin
  2012-01-19 11:47 ` Jeffrey Creem
@ 2012-01-19 20:35 ` Jeffrey Carter
  2 siblings, 0 replies; 6+ messages in thread
From: Jeffrey Carter @ 2012-01-19 20:35 UTC (permalink / raw)


On 01/19/2012 02:39 AM, tonyg wrote:
>
> Is there a utility that can count lines of ada source code? Maybe
> there is something in gnat-gps?

I have a program called ASC (Ada Statement Counter) which is just a wrapper 
around the public-domain COUNT_OF_ADA_STATEMENTS from the Ada Software 
Repository. I can send it to you if you're interested. ASC is Ada 95 (uses 
command line); COUNT_OF_ADA_STATEMENTS is Ada 83.

    -------- SIMTEL20 Ada Software Repository Prologue ------------
    -- Unit name    : COUNT_OF_ADA_STATEMENTS_3
    -- Version      : 1.3
    -- Author       : Richard Conn
    --              : MACA (from work submitted by TI)
    -- DDN Address  : RCONN at SIMTEL20
    -- Derivation   : COUNT_OF_ADA_STATEMENTS_2 by Richard Conn
    -- Derivation   : COUNT_OF_ADA_STATEMENTS by Bill Whitaker
    -- Date created : 4 Apr 85
    -- Release date : 4 Apr 85
    -- Last update  : 6 Jan 89
    -- Machine/System Compiled/Run on: DEC VAX/VMS with DEC Ada
    --                               : Data General MV8000 with ROLM Ada
    --                               : SUN 3/260 with Verdix Ada
    ---------------------------------------------------------------
    -- Keywords     :  Source analysis, Statement Count, Line Count, Hash
    -- Abstract     :
    --  This procedure calculates the "STATEMENTS" of a valid Ada fragment
    --  specified by a FILE_NAME string parameter.  It need not be a complete
    --  compilation unit, but it should have closed all open parens and
    --  strings.
    --
    --  The Ada statement is defined by a semicolon terminator
    --  outside of comments, parentheses, or string or character literals.
    --  This definition is insensitive to formatting or layout of the source.
    --
    --  There are exotic cases for which this will misestimate the count
    --  but we have never encountered one in real code.
    --
    --  This procedure is derived from Bill Whitaker's original
    --  COUNT_OF_ADA_STATEMENTS, and it does not change his original algorithm.
    --  It adds a line count and a character-checksum hash (sum of POS values of
    --  all non-space characters in the file mod 256).  It also adds a count
    --  of the comment lines (over CAS2, which does not).
    ------------------ Revision history ---------------------------
    -- DATE         VERSION         AUTHOR          HISTORY
    -- 19850215     1.0             R Conn          Initial Release
    -- 19850506     1.1             R Conn          Overflow Traps Added
    -- 19850624     1.2             R Conn          Bug in Single-Quote Proc Fixed
    -- 19890106     1.3             R Conn          Improved Ada style;
    --                                              removed need for CSET package
    ------------------ Distribution and Copyright -----------------
    -- This software is released to the Public Domain (note:
    --   software released to the Public Domain is not subject
    --   to copyright protection).
    ------------------ Disclaimer ---------------------------------
    -- This software and its documentation are provided "AS IS" and
    -- without any expressed or implied warranties whatsoever.
    -- No warranties as to performance, merchantability, or fitness
    -- for a particular purpose exist.
    -- In no event shall any person or organization of people be
    -- held responsible for any direct, indirect, consequential
    -- or inconsequential damages or lost profits.
    -------------------END-PROLOGUE--------------------------------


-- 
Jeff Carter
"What lazy lout left these wires all over the lawn?"
Poppy
98

--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---



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

end of thread, other threads:[~2012-01-19 20:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-19  9:39 source code line counting in ada tonyg
2012-01-19  9:45 ` Martin
2012-01-19 11:27   ` Simon Wright
2012-01-19 11:47 ` Jeffrey Creem
2012-01-19 16:32   ` tonyg
2012-01-19 20:35 ` Jeffrey Carter

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