comp.lang.ada
 help / color / mirror / Atom feed
* Ada source comparison
@ 2001-06-30 21:36 Gautier Write-only-address
  2001-06-30 22:02 ` tmoran
  2001-07-02  8:41 ` Jean-Pierre Rosen
  0 siblings, 2 replies; 8+ messages in thread
From: Gautier Write-only-address @ 2001-06-30 21:36 UTC (permalink / raw)
  To: comp.lang.ada

Hi again. Is there a tool allowing to check if two texts represent
the same Ada source, eventually with a different formatting ?
TIA
__________________________________________
Gautier  --  http://www.diax.ch/users/gdm/

NB: Do not answer to sender address, visit the Web site!
    Ne r�pondez pas � l'exp�diteur, visitez le site ouaibe!

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com




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

* Re: Ada source comparison
  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
  1 sibling, 1 reply; 8+ messages in thread
From: tmoran @ 2001-06-30 22:02 UTC (permalink / raw)


>Hi again. Is there a tool allowing to check if two texts represent
>the same Ada source, eventually with a different formatting ?
  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).



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

* Re: Ada source comparison
@ 2001-07-01 18:37 Gautier Write-only-address
  2001-07-01 22:58 ` Jeffrey Carter
  0 siblings, 1 reply; 8+ messages in thread
From: Gautier Write-only-address @ 2001-07-01 18:37 UTC (permalink / raw)
  To: comp.lang.ada

>   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.
__________________________________________
Gautier  --  http://www.diax.ch/users/gdm/

NB: Do not answer to sender address, visit the Web site!
    Ne r�pondez pas � l'exp�diteur, visitez le site ouaibe!

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com




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

* Re: Ada source comparison
@ 2001-07-01 22:38 Gautier Write-only-address
  0 siblings, 0 replies; 8+ messages in thread
From: Gautier Write-only-address @ 2001-07-01 22:38 UTC (permalink / raw)
  To: comp.lang.ada

>   a) run a pretty printer on both, then compare the pretty-printed
>source files.

For that I would rather need an "ugly-printer".
But J-P Rosen has already had the idea, and here is
a pointer to that wonderful tool:

  http://www.adalog.fr/compo2.htm#Normalize

__________________________________________
Gautier  --  http://www.diax.ch/users/gdm/

NB: Do not answer to sender address, visit the Web site!
    Ne r�pondez pas � l'exp�diteur, visitez le site ouaibe!

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com




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

* Re: Ada source comparison
  2001-07-01 18:37 Ada source comparison Gautier Write-only-address
@ 2001-07-01 22:58 ` Jeffrey Carter
  0 siblings, 0 replies; 8+ messages in thread
From: Jeffrey Carter @ 2001-07-01 22:58 UTC (permalink / raw)


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



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

* Re: Ada source comparison
@ 2001-07-02  4:25 Christoph Grein
  0 siblings, 0 replies; 8+ messages in thread
From: Christoph Grein @ 2001-07-02  4:25 UTC (permalink / raw)
  To: comp.lang.ada

Use any lexical scanner, e.g. the one in OpenToken or the one in

http://home.T-Online.de/home/Christ-Usch.Grein/Ada/

and compare the sequence of Ada tokens.




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

* Re: Ada source comparison
  2001-06-30 21:36 Gautier Write-only-address
  2001-06-30 22:02 ` tmoran
@ 2001-07-02  8:41 ` Jean-Pierre Rosen
  1 sibling, 0 replies; 8+ messages in thread
From: Jean-Pierre Rosen @ 2001-07-02  8:41 UTC (permalink / raw)


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


"Gautier Write-only-address" <gautier_niouzes@hotmail.com> a �crit dans le message news:
mailman.993937083.30447.comp.lang.ada@ada.eu.org...
> Hi again. Is there a tool allowing to check if two texts represent
> the same Ada source, eventually with a different formatting ?
Pass your sources through Normalize (available from Adalog's components page, http://www.adalog.fr/compo2.htm), and compare the
outputs.
Normalize eliminates all formating and comments and puts the program text in all uppercase (except strings and characters of
course), so you can compare the meaningful part of your program.

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





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

* Re: Ada source comparison
  2001-06-30 22:02 ` tmoran
@ 2001-07-02 13:34   ` Ted Dennison
  0 siblings, 0 replies; 8+ messages in thread
From: Ted Dennison @ 2001-07-02 13:34 UTC (permalink / raw)


In article <g0s%6.142008$%i7.95843108@news1.rdc1.sfba.home.com>, tmoran@acm.org
says...
>
>>Hi again. Is there a tool allowing to check if two texts represent
>>the same Ada source, eventually with a different formatting ?
>  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).

c) run the OpenToken "Ada tokenizer test" on both, and compare the output. It'd
be pretty easy to modify the test to do the comparison automaticly.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



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

end of thread, other threads:[~2001-07-02 13:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-01 18:37 Ada source comparison Gautier Write-only-address
2001-07-01 22:58 ` Jeffrey Carter
  -- 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

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