From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8d89c9a2a78ae143 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-01 15:58:13 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3B3FAAFC.108928F3@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada source comparison References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sun, 01 Jul 2001 22:58:16 GMT NNTP-Posting-Host: 206.133.140.50 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 994028296 206.133.140.50 (Sun, 01 Jul 2001 15:58:16 PDT) NNTP-Posting-Date: Sun, 01 Jul 2001 15:58:16 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net X-Received-Date: Sun, 01 Jul 2001 15:55:57 PDT (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:9306 Date: 2001-07-01T22:58:16+00:00 List-Id: 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