comp.lang.ada
 help / color / mirror / Atom feed
From: stuman@earthlink.net
Subject: Re: Ada95 Pretty-Printers
Date: 1997/06/10
Date: 1997-06-10T00:00:00+00:00	[thread overview]
Message-ID: <339E195A.1CB2@earthlink.net> (raw)
In-Reply-To: 339D677D.2FAC886C@link.com


Samuel Mize wrote:
> 
> John G. Volan wrote:
> > Are there any pretty-printers out there for Ada95?
> 
> This seems to come up every so often, and the answer so far has
> been "not really."
> 
> I would suppose that one could be built using the AdaMagic front
> end, but that's sheer speculation and I don't know how much it costs.
> 
> An Ada mode for emacs could be applied in a batch format, if you
> find one that works reliably for what you want.
> 
> > ...  Apex is frustrating because it actively
> > reformats almost every syntactic structure in Ada to suit Rational's
> > coding style.
> 
> That's a feature.  Just ask them.
> 
> ...
> > Apex will ignore your line breaks and alignment, and reformat
> ...
> > Apex does a lot of this sort of thing (I don't _even_ want to begin
> > on how it mangles long expressions), but it doesn't provide very
> > many hooks to control this behavior.
> 
> I got in the habit of putting an empty comment where I wanted a
> line break.  To use your first example:
> 
>    procedure Operation             --
>      (This  : in     This_Type;    --
>       That  : in     That_Type;    --
>       Other :    out Other_Type);
> 
> will become something like:
> 
>    procedure Operation             --
>      (This  : in This_Type;    --
>       That  : in That_Type;    --
>       Other : out Other_Type);
> 
> (Assuming that Apex doesn't maintain the blanks to line up "in"
> and "out").
> 
> I used this mostly to keep expressions broken up the way I wanted.
> I found that, if you could keep the line breaks where you want
> them, you can get fairly readable expression formatting with just
> adding a few extraneous parentheses to direct the formatter to
> indent a sub-expression (I have to do the same thing with emacs).
> 
> I got third-hand, supposedly from someone at Rational, that if you
> put two spaces at the end of a line, the reformatter will leave
> that line break.  If you don't want trailing comments in your code,
> you can try it.  I don't know if it's a feature they promise to
> support, or just an artifact of the then-current implementation.
> 
> I personally prefer using the comments to maintain line breaks,
> because people get used to the formatter output.  Thus, someone
> might misread the expression, because they expect the indentation
> to be correct.  So, I prefer a visible indication that the
> automated indentation has been tampered with.
> 
> Sam Mize
> 
> --
> -- Samuel Mize           (817) 619-8622               "Team Ada"
> -- Hughes Training Inc.  PO Box 6171 m/s 400, Arlington TX 76005
We are using a version of Apex that has several switches to control
pretty printing. One of these switches causes "whitespace" to be
retained. In addition, there is a switch that has an effect on what Apex
does with a statement that does not fit on a line. I think that the
proper setting of these two switches, and adding a couple of spaces at
the end of a line will allow you to retain your formatting. If not,
then  you can set the manual_pretty_printing switch to true and then you
have complete control -- Apex will not do undo your formating --
although it may not do formatting at all.




  parent reply	other threads:[~1997-06-10  0:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <339C58A6.4D5A@sprintmail.com>
1997-06-10  0:00 ` Ada95 Pretty-Printers Samuel Mize
1997-06-10  0:00   ` John G. Volan
1997-06-11  0:00     ` Samuel Mize
1997-06-12  0:00     ` Robert Dewar
1997-06-12  0:00     ` John G. Volan
1997-06-13  0:00       ` Samuel Mize
1997-06-14  0:00         ` Robert Dewar
1997-06-14  0:00           ` Samuel Mize
1997-06-14  0:00             ` Robert Dewar
1997-06-14  0:00         ` Tom Phinney
1997-06-10  0:00   ` stuman [this message]
1997-06-10  0:00   ` John G. Volan
1997-06-10  0:00     ` Spam Hater
1997-06-10  0:00       ` Spam Hater
1997-06-16  0:00     ` Greg Gicca @pulsar
1997-06-10  0:00 ` Anonymous
1997-06-10  0:00   ` John G. Volan
1997-06-11  0:00 ` Matthew Heaney
1997-06-11  0:00 ` Rolf Ebert
1997-06-11  0:00   ` John G. Volan
1997-06-12  0:00 ` Jeff Burns
replies disabled

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