comp.lang.ada
 help / color / mirror / Atom feed
From: mazzanti@iei.pi.cnr.it (Franco Mazzanti)
Subject: Re: Ada Code Formatting (Ada source diff)
Date: 1996/09/06
Date: 1996-09-06T00:00:00+00:00	[thread overview]
Message-ID: <mazzanti-0609961122160001@mac-mazz.iei.pi.cnr.it> (raw)


Robert wrote:

> The given script is neither reliable (two different programs
> can give the same -do output -- for example 16#1# will look the same as 9#1#))

This, actually, could be seen as a feature, when it documented inside the
script, rather then a bug.

Is there any other really meaningful difference which is lost, (apart from
not distinguing the literals 01, 001, 0001, 2#1#, 4#1#, and similars)?

> 
> nor is the differences that you get very useful if there is no match
> (line numbers are wrong ...)

True, they are related to the gnatf -s -do output. In case of mismatch,
however, we might avoid to delete the gnatf output and give the user the
names of the two gnatf-dumped output so that it were possible to look inside
them for getting a more complete understanding of line numbers.

> 
> The output of course is not useful in doing a patch either.
> 

I have the impression that the possibility of performing a patch would
not be very meaningful in this case.
The real purpose of the script is just to allow an easy verification that 
a simple maintenance operation (or pretty-printing) did not inadvertedly 
modify the code. 
This is not thought as an utility which compares different versions of a
program. Probably the name should be changed, since "diff" implicitly
carries that other stronger meaning (maybe we could call it
"src-equiv", "src-compare", ....).

> So while this script has some value as an approximate check, it does
> not obviate the utility of a more intelligent Ada diff program!

Sure, this was not considered a perfect solution, just a very simple one.
A more intellingent tool might, for example, do not consider as a
difference the removal of unnecessary code, and many other intelligent things.

The main problem of this approach is that the "-do" switch is not an
official gnatf feature, but just an internal debugging option. This means
that there is no guarantee that the switch will exist in future versions
of gnatf, or its effect could be completely different. This also should be noted
in the script (which doesn not even specify with which version of gnat it
supposes to find).

Franco




             reply	other threads:[~1996-09-06  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-06  0:00 Franco Mazzanti [this message]
1996-09-06  0:00 ` Ada Code Formatting (Ada source diff) Robert Dewar
1996-09-06  0:00 ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1996-09-05  0:00 Franco Mazzanti
1996-09-06  0:00 ` Robert Dewar
replies disabled

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