comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: Ada source comparison
Date: Sun, 01 Jul 2001 22:58:16 GMT
Date: 2001-07-01T22:58:16+00:00	[thread overview]
Message-ID: <3B3FAAFC.108928F3@acm.org> (raw)
In-Reply-To: mailman.994012684.15428.comp.lang.ada@ada.eu.org

Gautier Write-only-address wrote:
> 
> >   a) run a pretty printer on both, then compare the pretty-printed
> >source files.
> >   b) compile both and compare the resulting object files (may differ
> >slightly in a timestamp but shouldn't differ much more than that).
> 
> Thank you for the ideas - in fact I already used b) but I was
> looking for a more civilized method.

I don't know if it's any more "civilized", but I have a program that
counts the number of source lines, comments, and terminator semicolons,
and calculates the sum mod 256 of the Character'Pos of all
non-whitespace, non-comment characters in the file. It's not intended
for this purpose, but one would expect the number of comments and
terminator semicolons to be the same if the only difference is
formatting. If the case of identifiers is the same, then the hash would
also be the same. While not guaranteed, it would be pretty rare for two
different units to have the same counts and hash.

Someone (Rosen?) has an uglifier that exists for the purpose of
comparing source files. You might want to try to find it.

-- 
Jeff Carter
"My brain hurts!"
Monty Python's Flying Circus



  reply	other threads:[~2001-07-01 22:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-01 18:37 Ada source comparison Gautier Write-only-address
2001-07-01 22:58 ` Jeffrey Carter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-07-02  4:25 Christoph Grein
2001-07-01 22:38 Gautier Write-only-address
2001-06-30 21:36 Gautier Write-only-address
2001-06-30 22:02 ` tmoran
2001-07-02 13:34   ` Ted Dennison
2001-07-02  8:41 ` Jean-Pierre Rosen
replies disabled

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