comp.lang.ada
 help / color / mirror / Atom feed
* wanted: Ada diff tool
@ 2000-05-02  0:00 Terry Westley
  2000-05-02  0:00 ` Ted Dennison
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Terry Westley @ 2000-05-02  0:00 UTC (permalink / raw)


Does anyone know of a difference tool which understands the syntax of Ada?

Here's the context:

We use Clearcase for configuration management.  Clearcase provides a useful
merge facility for reconciling changes to one source file made by multiple
people.

Unfortunately, it's based on a pretty simple diff tool.  Most of the time
it's OK,
but sometimes I'd really like to know if the only changes to a file are
reformatting
or comment changes.  Then I can better make decisions about what needs to
be tested or whether I even want to accept a specific change in certain
releases.

Any suggestions?

I've thought of pretty-printing both files, them comparing the results, but
then
it would be difficult to trace back to the changes in the original file.

So far, I haven't found anything at the code repositories I frequent.

--
Terry J. Westley, Software Systems Engineering Supervisor
Veridian Engineering, Calspan Operations
twestley@buffalo.veridian.com   http://www.veridian.com/
-------------------------------------------------------
Author of TASH, an Ada binding to Tcl/Tk.
Visit the TASH web site at http://www.adatcl.com.
-------------------------------------------------------







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

* Re: wanted: Ada diff tool
  2000-05-02  0:00 wanted: Ada diff tool Terry Westley
@ 2000-05-02  0:00 ` Ted Dennison
       [not found] ` <tlivgsorsn19mtm29qi98c42tac8gnfleg@4ax.com>
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Ted Dennison @ 2000-05-02  0:00 UTC (permalink / raw)


In article <L_DP4.1$GS.1551@wdc-read-01.qwest.net>,
  "Terry Westley" <twestley@buffalo.veridian.com> wrote:
> Does anyone know of a difference tool which understands the syntax of
> Ada?

If you end up making your own, the Ada statement counter that comes with
OpenToken (
http://www.telepath.com/dennison/Ted/OpenToken/OpenToken.html ) might be
a good start.

If your compiler supports it, ASIS might help too.

--
T.E.D.

http://www.telepath.com/~dennison/Ted/TED.html


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: wanted: Ada diff tool
  2000-05-03  0:00 ` Jean-Pierre Rosen
  2000-05-03  0:00   ` james hopper
@ 2000-05-03  0:00   ` Brian Rogoff
  1 sibling, 0 replies; 14+ messages in thread
From: Brian Rogoff @ 2000-05-03  0:00 UTC (permalink / raw)


On Wed, 3 May 2000, Jean-Pierre Rosen wrote:
> On Adalog's component page (http://pro.wanadoo.fr/adalog/compo2.htm), you'll
> find a small utility called Normalize that processes an Ada source and
> removes comments, unnecessary spaces, and turns the whole text (except
> strings) upper-case. This is precisely intended to make a diff on the
> "semantic" part of the program. FWIW....
> 
> (I wrote this because of a lengthy discussion on this topic here some times
> ago. It turned out that it was faster to write the utility than to discuss
> about its desirability ;-)

I think this also relates to why C has to date been more successful than
Ada. Not enough Ada programmers have Jean-Pierre's excellent
code-first-ask-questions-later attitude. Bravo J-P, we need to clone a 
bunch more of you!

And yes, I'm entirely serious. "Hacking" seems to be a dirty word in the
Ada community, even though Ada is an outstanding language for hacking, as 
well as for large scale disciplined software engineering.

-- Brian






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

* Re: wanted: Ada diff tool
  2000-05-03  0:00 ` Jean-Pierre Rosen
@ 2000-05-03  0:00   ` james hopper
  2000-05-04  0:00     ` Geoff Bull
                       ` (2 more replies)
  2000-05-03  0:00   ` Brian Rogoff
  1 sibling, 3 replies; 14+ messages in thread
From: james hopper @ 2000-05-03  0:00 UTC (permalink / raw)


In article <8eot2o$kbm$1@wanadoo.fr>, Jean-Pierre Rosen
<rosen.adalog@wanadoo.fr> wrote:

> On Adalog's component page (http://pro.wanadoo.fr/adalog/compo2.htm), you'll
> find a small utility called Normalize that processes an Ada source and
> removes comments, unnecessary spaces, and turns the whole text (except
> strings) upper-case. This is precisely intended to make a diff on the
> "semantic" part of the program. FWIW....
> 
> (I wrote this because of a lengthy discussion on this topic here some times
> ago. It turned out that it was faster to write the utility than to discuss
> about its desirability ;-)

i looke dat it and its good as far as it goes, but it doent handle the
case where lines with embedded carrage control.  if you change the
formatting on lines it won't do a true diff. to make this a true
normalize it needs to convert every ada statement into a single line.

jim




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

* Re: wanted: Ada diff tool
  2000-05-02  0:00 wanted: Ada diff tool Terry Westley
  2000-05-02  0:00 ` Ted Dennison
       [not found] ` <tlivgsorsn19mtm29qi98c42tac8gnfleg@4ax.com>
@ 2000-05-03  0:00 ` James D. Veale
  2000-05-03  0:00 ` Geoff Bull
  2000-05-03  0:00 ` Jean-Pierre Rosen
  4 siblings, 0 replies; 14+ messages in thread
From: James D. Veale @ 2000-05-03  0:00 UTC (permalink / raw)


  Dear Mr. Westley,

  Although not Ada specific,  you might want to look at the
  comparison utilities on my web page,  these are available for OS/2, NT, 
  and DOS.   http://world.std.com/~jdveale

> Unfortunately, it's based on a pretty simple diff tool.  Most of the time
> it's OK, but sometimes I'd really like to know if the only changes to a 
> file are reformatting or comment changes.  

  These tools perform a true word-by-word comparison where words may be
  separated not only by blanks,  but by common programming language
  delimiters.  As a result it can be insensitive to many formatting
  changes.  It can also be configured to ignore most Ada comments,
  and changes in text flow.

> I've thought of pretty-printing both files, them comparing the results, 
> but then it would be difficult to trace back to the changes in the 
> original file.

  You might also find the interactive "bounce merge" facility useful.
  This allows you to 'bounce' lines from one file to another and save
  the results.

  Jim Veale








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

* Re: wanted: Ada diff tool
       [not found] ` <tlivgsorsn19mtm29qi98c42tac8gnfleg@4ax.com>
@ 2000-05-03  0:00   ` Robert A Duff
  0 siblings, 0 replies; 14+ messages in thread
From: Robert A Duff @ 2000-05-03  0:00 UTC (permalink / raw)


Brian Orpin <abuse@borpin.co.uk> writes:

> On Tue, 2 May 2000 13:05:48 -0400, "Terry Westley"
> <twestley@buffalo.veridian.com> wrote:
> 
> >Does anyone know of a difference tool which understands the syntax of Ada?
> 
> I have found Emacs to be invaluable in the 'diffing' department.  It will
> ignore whitespace and single stepping through using the spacebar is very
> quick.  It will also diff all files in 2 directories and build a set
> which you can then go over.

Also in Emacs, take a look at M-x compare-windows.

>..  All this is on Unix of course <g>.

I use Emacs on Unix, Windows-NT, and Windows-95.  If you want to use
some of the more unix-ish features on Windows, you can get various tools
like diff and bash from Cygnus.

- Bob




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

* Re: wanted: Ada diff tool
  2000-05-02  0:00 wanted: Ada diff tool Terry Westley
                   ` (2 preceding siblings ...)
  2000-05-03  0:00 ` James D. Veale
@ 2000-05-03  0:00 ` Geoff Bull
  2000-05-03  0:00 ` Jean-Pierre Rosen
  4 siblings, 0 replies; 14+ messages in thread
From: Geoff Bull @ 2000-05-03  0:00 UTC (permalink / raw)



There is a program called normalize, which removes formatting, at
http://pro.wanadoo.fr/adalog/compo2.htm

This may allow you to build what you need.

Terry Westley wrote:
> 
> I'd really like to know if the only changes to a file are
> reformatting
> or comment changes.




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

* Re: wanted: Ada diff tool
  2000-05-02  0:00 wanted: Ada diff tool Terry Westley
                   ` (3 preceding siblings ...)
  2000-05-03  0:00 ` Geoff Bull
@ 2000-05-03  0:00 ` Jean-Pierre Rosen
  2000-05-03  0:00   ` james hopper
  2000-05-03  0:00   ` Brian Rogoff
  4 siblings, 2 replies; 14+ messages in thread
From: Jean-Pierre Rosen @ 2000-05-03  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1427 bytes --]


Terry Westley <twestley@buffalo.veridian.com> a �crit dans le message :
L_DP4.1$GS.1551@wdc-read-01.qwest.net...
> Does anyone know of a difference tool which understands the syntax of Ada?
>
> Here's the context:
>
> We use Clearcase for configuration management.  Clearcase provides a
useful
> merge facility for reconciling changes to one source file made by multiple
> people.
>
> Unfortunately, it's based on a pretty simple diff tool.  Most of the time
> it's OK,
> but sometimes I'd really like to know if the only changes to a file are
> reformatting
> or comment changes.  Then I can better make decisions about what needs to
> be tested or whether I even want to accept a specific change in certain
> releases.
>
> Any suggestions?
>
On Adalog's component page (http://pro.wanadoo.fr/adalog/compo2.htm), you'll
find a small utility called Normalize that processes an Ada source and
removes comments, unnecessary spaces, and turns the whole text (except
strings) upper-case. This is precisely intended to make a diff on the
"semantic" part of the program. FWIW....

(I wrote this because of a lengthy discussion on this topic here some times
ago. It turned out that it was faster to write the utility than to discuss
about its desirability ;-)

--
---------------------------------------------------------
           J-P. Rosen (Rosen.Adalog@wanadoo.fr)
Visit Adalog's web site at http://pro.wanadoo.fr/adalog






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

* Re: wanted: Ada diff tool
  2000-05-03  0:00   ` james hopper
  2000-05-04  0:00     ` Geoff Bull
  2000-05-04  0:00     ` Jean-Pierre Rosen
@ 2000-05-04  0:00     ` Wes Groleau
  2 siblings, 0 replies; 14+ messages in thread
From: Wes Groleau @ 2000-05-04  0:00 UTC (permalink / raw)



> case where lines with embedded carrage control.  if you change the
> formatting on lines it won't do a true diff. to make this a true
> normalize it needs to convert every ada statement into a single line.

I once wrote a tool that converted an Ada program to one lexical token
per line, upper cased.  Gave a true semantic diff capability, but the
results were awfully hard to read!  The CompLite/CompTig tool recently 
mentioned looks like an excellent solution.

-- 
Wes Groleau
http://freepages.genealogy.rootsweb.com/~wgroleau




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

* Re: wanted: Ada diff tool
  2000-05-04  0:00     ` Geoff Bull
@ 2000-05-04  0:00       ` Ted Dennison
  2000-05-05  0:00       ` Benjamin J. Robinson
  1 sibling, 0 replies; 14+ messages in thread
From: Ted Dennison @ 2000-05-04  0:00 UTC (permalink / raw)


In article <3910F63E.A461B879@research.canon.com.au>,
  Geoff Bull <geoff@research.canon.com.au> wrote:
> If you just need to know if the files are functionally different,
> not where they are different, you could just compile the two files
> and compare the resulting binaries.

What if the reason for wanting to know if they are different is to know
if the file needs to be recompiled?
:-)

--
T.E.D.

http://www.telepath.com/~dennison/Ted/TED.html


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: wanted: Ada diff tool
  2000-05-03  0:00   ` james hopper
@ 2000-05-04  0:00     ` Geoff Bull
  2000-05-04  0:00       ` Ted Dennison
  2000-05-05  0:00       ` Benjamin J. Robinson
  2000-05-04  0:00     ` Jean-Pierre Rosen
  2000-05-04  0:00     ` Wes Groleau
  2 siblings, 2 replies; 14+ messages in thread
From: Geoff Bull @ 2000-05-04  0:00 UTC (permalink / raw)


If you just need to know if the files are functionally different, 
not where they are different, you could just compile the two files
and compare the resulting binaries.

james hopper wrote:
> 
> i looke dat it and its good as far as it goes, but it doent handle the
> case where lines with embedded carrage control.  if you change the
> formatting on lines it won't do a true diff.




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

* Re: wanted: Ada diff tool
  2000-05-03  0:00   ` james hopper
  2000-05-04  0:00     ` Geoff Bull
@ 2000-05-04  0:00     ` Jean-Pierre Rosen
  2000-05-04  0:00     ` Wes Groleau
  2 siblings, 0 replies; 14+ messages in thread
From: Jean-Pierre Rosen @ 2000-05-04  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1665 bytes --]


james hopper <nospam@nospam.com> a �crit dans le message :
030520002201489719%nospam@nospam.com...
> In article <8eot2o$kbm$1@wanadoo.fr>, Jean-Pierre Rosen
> <rosen.adalog@wanadoo.fr> wrote:
>
> > On Adalog's component page (http://pro.wanadoo.fr/adalog/compo2.htm),
you'll
> > find a small utility called Normalize that processes an Ada source and
> > removes comments, unnecessary spaces, and turns the whole text (except
> > strings) upper-case. This is precisely intended to make a diff on the
> > "semantic" part of the program. FWIW....
> >
> > (I wrote this because of a lengthy discussion on this topic here some
times
> > ago. It turned out that it was faster to write the utility than to
discuss
> > about its desirability ;-)
>
> i looke dat it and its good as far as it goes, but it doent handle the
> case where lines with embedded carrage control.  if you change the
> formatting on lines it won't do a true diff. to make this a true
> normalize it needs to convert every ada statement into a single line.

Yes, I wanted the output to be somehow readable, and the line structure is
kept. This could be changed by flushing the output buffer appropriately. If
you want to make the modification (maybe on a command line option), feel
free to do it (the whole program is 200- lines long, including comments),
and I'd be happy to accept the modifications. Sorry, I'm a bit to busy
currently to do it myself now. (Maybe if I have a couple of minutes next
time I take the Eurostar).

--
---------------------------------------------------------
           J-P. Rosen (Rosen.Adalog@wanadoo.fr)
Visit Adalog's web site at http://pro.wanadoo.fr/adalog






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

* Re: wanted: Ada diff tool
  2000-05-05  0:00       ` Benjamin J. Robinson
@ 2000-05-05  0:00         ` Ted Dennison
  0 siblings, 0 replies; 14+ messages in thread
From: Ted Dennison @ 2000-05-05  0:00 UTC (permalink / raw)


In article <Pine.LNX.4.10.10005050902360.20175-100000@freenet1.afn.org>,
  "Benjamin J. Robinson" <afn46299@afn.org> wrote:
> On Thu, 4 May 2000, Geoff Bull wrote:
>
> > If you just need to know if the files are functionally different,
> > not where they are different, you could just compile the two files
> > and compare the resulting binaries.
>
> Some compilers have the habit of slipping time-of-compile information
> into the image.  This has the effect of making two binaries different,
> even if they were compiled from the same source.  Before trying this
> suggestion

The old DEC Ada compiler would even optimize differently, depending on
how much RAM it happened to have available to it when you compiled.

(I got royally roasted here about 7 years ago when I brought this up.)

--
T.E.D.

http://www.telepath.com/~dennison/Ted/TED.html


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: wanted: Ada diff tool
  2000-05-04  0:00     ` Geoff Bull
  2000-05-04  0:00       ` Ted Dennison
@ 2000-05-05  0:00       ` Benjamin J. Robinson
  2000-05-05  0:00         ` Ted Dennison
  1 sibling, 1 reply; 14+ messages in thread
From: Benjamin J. Robinson @ 2000-05-05  0:00 UTC (permalink / raw)


On Thu, 4 May 2000, Geoff Bull wrote:

> If you just need to know if the files are functionally different, 
> not where they are different, you could just compile the two files
> and compare the resulting binaries.

Some compilers have the habit of slipping time-of-compile information into
the image.  This has the effect of making two binaries different, even if
they were compiled from the same source.  Before trying this suggestion
with two different sources, you should compile the same source twice, and
compare *those* two binaries to ensure you get consistent results from one
compile to the next.

-Benjamin Robinson
-- 
"The government cannot reduce the adult population to reading or viewing only
            to what is appropriate for children."  -- Bruce Ennis
My opinions don't represent, and are likely contrary to, those of my employer.
This message may or may not contain sarcastic content; your burden to decide.





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

end of thread, other threads:[~2000-05-05  0:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-02  0:00 wanted: Ada diff tool Terry Westley
2000-05-02  0:00 ` Ted Dennison
     [not found] ` <tlivgsorsn19mtm29qi98c42tac8gnfleg@4ax.com>
2000-05-03  0:00   ` Robert A Duff
2000-05-03  0:00 ` James D. Veale
2000-05-03  0:00 ` Geoff Bull
2000-05-03  0:00 ` Jean-Pierre Rosen
2000-05-03  0:00   ` james hopper
2000-05-04  0:00     ` Geoff Bull
2000-05-04  0:00       ` Ted Dennison
2000-05-05  0:00       ` Benjamin J. Robinson
2000-05-05  0:00         ` Ted Dennison
2000-05-04  0:00     ` Jean-Pierre Rosen
2000-05-04  0:00     ` Wes Groleau
2000-05-03  0:00   ` Brian Rogoff

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