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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Pretty-printer? (Alternatives to "gnatpp") Date: Mon, 14 Mar 2016 18:47:50 -0500 Organization: JSA Research & Innovation Message-ID: References: <87a8m2jlp7.fsf@adaheads.consafe1.org> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1457999271 15229 24.196.82.226 (14 Mar 2016 23:47:51 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 14 Mar 2016 23:47:51 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:29763 Date: 2016-03-14T18:47:50-05:00 List-Id: "Jacob Sparre Andersen" wrote in message news:87a8m2jlp7.fsf@adaheads.consafe1.org... > What pretty-printers are available for Ada (83-2012)? > > I'm already aware of "gnatpp", but it has two disadvantages: > > 1) You have to have set up the environment to compile the source file, > before you can pretty-print it. > > 2) You can't get it to select the casing of identifiers on a > word-by-word basis (which means that I have to repeat every acronym > we use in the project once for every identifier it occurs in). > > What alternatives are there? The Janus/Ada syntax checker (comes with the Professional Version of Janus/Ada) includes a pretty printer mode. The only setup it requires is that of the entire Janus/Ada system (and really, it just needs to be on the path). It's a separate tool from the days when compilations took 5 minutes - waiting that long meant that one tended to start a build and then go to lunch or a coffee break - and it was really annoying to get back and find out that I'd left out a semicolon in the third file. These days, I use it to check syntax on new ACATS tests ('cause it does the entire Ada 2012 grammar, Janus/Ada itself does so little more than that it isn't worth setting up a compile). It's alway good to get more than one opinion (GNAT is not perfect!). The casing of identifiers has a number of options, one of which is to leave them alone program-wide. (/AS - "Same case"). We never thought of the GNAT idea of making everything match the declaration (and of course that would be a lot harder to do that as opposed to just using Title capitalization or all UPPER case). I'd be a bit concerned about what it will do on newer syntax; I've tested a few things but we don't really have any customers who've reported problems in it recently so it gets a lower priority than most things. > How do they fare compared to "gnatpp"? Dunno, never used gnatpp (and rarely use "syntax" as a pretty printer, either). Randy.