comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Ada83 equivalents for Ada95
Date: 1996/05/10
Date: 1996-05-10T00:00:00+00:00	[thread overview]
Message-ID: <Dr70x4.Drs@world.std.com> (raw)
In-Reply-To: 31927190.35AA@csehp3.mdc.com


In article <31927190.35AA@csehp3.mdc.com>,
James A. Squire <m193884@CSEHP3.MDC.COM> wrote:
>Has anybody gone to the trouble of translating code that uses features
>new to Ada95 back into its Ada83 equivalent?  If anyone knows of such
>examples that are available on the Internet, please let me know (email
>or comp.lang.ada).

I don't know of any such effort.

I'm curious as to why you want this.  Do you want to develop Ada 95
code, but then run it on a system where Ada 95 does not yet exist, but
Ada 83 compilers do exist?

It seems pretty difficult, to me.  For example, how do you translate
access-to-subprogram types into Ada 83?  It could be done.  Represent an
access-to-subprogram value as an integer number.  Generate a single
subprogram for each access-type-subtype type.  This subprogram does a
case statement on the integer, and has one branch for every possible
subprogram that might have been called.  The translation tool would have
to do a global analysis of the entire program, to track down every
'Access.  For every subprogram P, if somebody wrote P'Access anywhere in
the program, assign a unique integer to P, and put a call to P in that
case statement mentioned above.

Every such P would have to be declared in the visible part of its
package, even if in the original source, P is declared in the body.

I'm not sure how you would preserve elaboration order, since that
case-statement subprogram will need extra with-clauses to be added.

In any case, such a tool would be approximately as complex as an Ada
compiler -- the same order of magnitude anyway.  If you've gone that
far, why not just write an Ada 95 compiler?

Also, efficiency would suffer.

- Bob




  reply	other threads:[~1996-05-10  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <md5:0CCFC2005521EA8746533FEB9AA03D75>
1996-05-09  0:00 ` Ada83 equivalents for Ada95 James A. Squire
1996-05-10  0:00   ` Robert A Duff [this message]
1996-05-24  0:00     ` Joe Gwinn
1996-05-25  0:00       ` JP Thornley
1996-05-28  0:00       ` Brad Balfour
1996-05-28  0:00         ` Robert A Duff
1996-05-29  0:00           ` Norman H. Cohen
1996-05-29  0:00           ` Ken Garlington
1996-05-17  0:00   ` New POSIX Ada Activity Announcement Shane P. McCarron
1996-05-28  0:00 ` Ada83 equivalents for Ada95 Jon S Anthony
1996-05-29  0:00 ` Ken Garlington
1996-05-31  0:00   ` Robert Dewar
1996-06-03  0:00     ` Ken Garlington
1996-06-03  0:00       ` Robert Dewar
1996-05-10  0:00 tmoran
1996-05-11  0:00 ` Tucker Taft
     [not found] <md5:492A761845FE7D43B3C33CDDC6DB8CD0>
1996-05-10  0:00 ` James A. Squire
1996-05-11  0:00   ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1996-05-25  0:00 tmoran
replies disabled

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