comp.lang.ada
 help / color / mirror / Atom feed
* Are there any automatic tools to convert ada83 source into ada95?
@ 1998-12-28  0:00 changweimin
  1998-12-28  0:00 ` Tucker Taft
  0 siblings, 1 reply; 8+ messages in thread
From: changweimin @ 1998-12-28  0:00 UTC (permalink / raw)


I have a big system written in Ada83, with millons of lines. I intend to
transit the system to Ada95, Are there any automatic tools to convert ada83
source into ada95? Any suggestion will be appreciated.

Weimin, Chang

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: Are there any automatic tools to convert ada83 source into ada95?
  1998-12-28  0:00 Are there any automatic tools to convert ada83 source into ada95? changweimin
@ 1998-12-28  0:00 ` Tucker Taft
  1998-12-28  0:00   ` Chris Morgan
  0 siblings, 1 reply; 8+ messages in thread
From: Tucker Taft @ 1998-12-28  0:00 UTC (permalink / raw)


changweimin@my-dejanews.com wrote:

: I have a big system written in Ada83, with millons of lines. I intend to
: transit the system to Ada95, Are there any automatic tools to convert ada83
: source into ada95? Any suggestion will be appreciated.

Yes, it is called an Ada 95 compiler ;-).  Seriously, there is no reason
to change your millions of lines of Ada 83 code.  It should compile
as is, or with very minor changes, by any Ada 95 compiler.  

Of course, if there are parts of the existing system which have significant 
maintenance problems, then by all means take advantage of some of the new Ada 
95 language features to improve maintainability.  For example, you might
break a large monolithic package up using child packages, if you find
you keep recompiling the "world" due to changes only of interest to
a small number of users.  Or use tagged type extension rather than variant
records if you have major recompilation problems associated with adding
new variants.  

In general, though, the most important parts of Ada 95 are those parts 
inherited from Ada 83, namely packages and private types.  Presuming
you used them wisely, you already have a very nice Ada 95 program on
your hands.

: Weimin, Chang

--
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




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

* Re: Are there any automatic tools to convert ada83 source into ada95?
  1998-12-28  0:00 ` Tucker Taft
@ 1998-12-28  0:00   ` Chris Morgan
  1998-12-29  0:00     ` robert_dewar
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Morgan @ 1998-12-28  0:00 UTC (permalink / raw)


stt@houdini.camb.inmet.com (Tucker Taft) writes:

> changweimin@my-dejanews.com wrote:
> 
> : I have a big system written in Ada83, with millons of lines. I intend to
> : transit the system to Ada95, Are there any automatic tools to convert ada83
> : source into ada95? Any suggestion will be appreciated.
> 
> Yes, it is called an Ada 95 compiler ;-).  Seriously, there is no reason
> to change your millions of lines of Ada 83 code.  It should compile
> as is, or with very minor changes, by any Ada 95 compiler.  

This is absolutely correct, grab an Ada95 compiler and just give it a
go! 

I worked on a system which was getting on for 2 million lines of Ada83
ode. There were several individual problems here and there with our
coding style, but none more serious than we found going from one Ada83
compiler to another. The only systematic problem was that our
exception handlers were standardised with

   ...
when CONSTRAINT_ERROR =>
  DO_SOMETHING;
when NUMERIC_ERROR =>
  DP_SOMETHING_ELSE;
   ...

which is no longer legal.

Chris
-- 
Chris Morgan <mihalis at ix.netcom.com>		http://www.mihalis.net




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

* Are there any automatic tools to convert ada83 source into ada95?
@ 1998-12-28  0:00 changweimin
  0 siblings, 0 replies; 8+ messages in thread
From: changweimin @ 1998-12-28  0:00 UTC (permalink / raw)


I have a large system written in ada83, I want transit it to ada95. Are there
any automatic tools to convert ada83 source into ada95? any suggestion will be
appreciated.

weimin Chang

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: Are there any automatic tools to convert ada83 source into ada95?
  1998-12-28  0:00   ` Chris Morgan
@ 1998-12-29  0:00     ` robert_dewar
  1998-12-29  0:00       ` Chris Morgan
  0 siblings, 1 reply; 8+ messages in thread
From: robert_dewar @ 1998-12-29  0:00 UTC (permalink / raw)


In article <87vhiv3m7j.fsf@mihalis.ix.netcom.com>,
  Chris Morgan <mihalis@ix.netcom.com> wrote:
> The only systematic problem was that our
> exception handlers were standardised with
>
>    ...
> when CONSTRAINT_ERROR =>
>   DO_SOMETHING;
> when NUMERIC_ERROR =>
>   DP_SOMETHING_ELSE;
>    ...
>
> which is no longer legal.


To be clear on this point, this was highly dubious code
in Ada 83, since Ada 83 compilers were allowed to raise
Constraint_Error instead of Numeric_Error in any situation.

So the above code was dubious, implementation-dependent
Ada 83 code in any case.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: Are there any automatic tools to convert ada83 source into ada95?
  1998-12-29  0:00     ` robert_dewar
@ 1998-12-29  0:00       ` Chris Morgan
  1998-12-30  0:00         ` Robert A Duff
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Morgan @ 1998-12-29  0:00 UTC (permalink / raw)


robert_dewar@my-dejanews.com writes:

> > when CONSTRAINT_ERROR =>
> >   DO_SOMETHING;
> > when NUMERIC_ERROR =>
> >   DP_SOMETHING_ELSE;
> >    ...
> >
> > which is no longer legal.
> 
> 
> To be clear on this point, this was highly dubious code
> in Ada 83, since Ada 83 compilers were allowed to raise
> Constraint_Error instead of Numeric_Error in any situation.

Right, but ours didn't.

> 
> So the above code was dubious, implementation-dependent
> Ada 83 code in any case.

Yes, fine, but since it was custom hardware and we maintained our
version of the compiler, I think we were allowed ;)

I didn't like that bit of code anyway, but it was in the coding
standard. If either type of exception happened the error was noted via
interconnect space on the bus and the node restarted, so it was merely
statistical info. Any code where we really did get exceptions like
this would normally have ben fixed up, so in production use they were
really "exceptional".

One famous one I enjoyed was when I rang back to base from the testing
facility where our software was being fed simulated data.

"It crashed, I got a constraint error in foo_bar_package"
"What was the area code?"
....
"In that case the submarine's inclination was -180 degrees!!"

Yep, you guessed it, someone did an abs() of -32768

Chris
-- 
Chris Morgan <mihalis at ix.netcom.com>		http://www.mihalis.net
	         "At least my mother isn't on the 
                  cover of Crack Whore magazine"




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

* Re: Are there any automatic tools to convert ada83 source into ada95?
  1998-12-29  0:00       ` Chris Morgan
@ 1998-12-30  0:00         ` Robert A Duff
  1998-12-31  0:00           ` Robert A Duff
  0 siblings, 1 reply; 8+ messages in thread
From: Robert A Duff @ 1998-12-30  0:00 UTC (permalink / raw)


Chris Morgan <mihalis@ix.netcom.com> writes:

> robert_dewar@my-dejanews.com writes:
> > To be clear on this point, this was highly dubious code
> > in Ada 83, since Ada 83 compilers were allowed to raise
> > Constraint_Error instead of Numeric_Error in any situation.
> 
> Right, but ours didn't.

To clarify Robert's point: there are many situations in Ada 83 where
something can raise either Constraint_Error or Numeric_Error.  It's not
that some compilers might be sloppy, and fail to distinguish two
different situations.  It's that the different situations are genuinely
indistinguishable.

You gave one example:

> Yep, you guessed it, someone did an abs() of -32768

    type T is range -32768..-32767;
    X: T := -32768;
    ...
    X := abs(X);

According to the Ada 83 RM, the above statement might raise either C_E
or P_E.  Any code that tries to distinguish the two is, as Robert said,
"dubious".

In Ada 95, it raises C_E (and P_E is just a renaming of C_E).

A good style in Ada 83 was to always pair the two: "when C_E | P_E =>
...".  The Ada 95 rules are carefully crafted to make that idiom
still be legal.

- Bob
-- 
Change robert to bob to get my real email address.  Sorry.




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

* Re: Are there any automatic tools to convert ada83 source into ada95?
  1998-12-30  0:00         ` Robert A Duff
@ 1998-12-31  0:00           ` Robert A Duff
  0 siblings, 0 replies; 8+ messages in thread
From: Robert A Duff @ 1998-12-31  0:00 UTC (permalink / raw)


I wrote:

>     X := abs(X);
> 
> According to the Ada 83 RM, the above statement might raise either C_E
> or P_E.  Any code that tries to distinguish the two is, as Robert said,
> "dubious".
> 
> In Ada 95, it raises C_E (and P_E is just a renaming of C_E).
> 
> A good style in Ada 83 was to always pair the two: "when C_E | P_E =>
> ...".  The Ada 95 rules are carefully crafted to make that idiom
> still be legal.

Oops, I meant N_E (Numeric_Error), not Program_Error above.  Thanks to
Art Evans for pointing that out.

- Bob
-- 
Change robert to bob to get my real email address.  Sorry.




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

end of thread, other threads:[~1998-12-31  0:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-28  0:00 Are there any automatic tools to convert ada83 source into ada95? changweimin
1998-12-28  0:00 ` Tucker Taft
1998-12-28  0:00   ` Chris Morgan
1998-12-29  0:00     ` robert_dewar
1998-12-29  0:00       ` Chris Morgan
1998-12-30  0:00         ` Robert A Duff
1998-12-31  0:00           ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1998-12-28  0:00 changweimin

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