comp.lang.ada
 help / color / mirror / Atom feed
From: "Ira Baxter" <idbaxter@semdesigns.com>
Subject: Re: C++ to Ada translator?
Date: Wed, 18 Sep 2002 14:50:17 -0500
Date: 2002-09-18T14:50:17-05:00	[thread overview]
Message-ID: <3d88d8bf$1@giga.realtime.net> (raw)
In-Reply-To: c560b18f.0209180558.58d495cc@posting.google.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2181 bytes --]

We build custom translation tools as special cases of out
genearlized compiler technology used for analysis and enhancement
of large scale software systems.
See http://www.semdesigns.com/Products/Services/LegacyMigration.html.
We have Ada and C++ modules for our tools,
although we have not paired these before.

Another poster suggested that the "nature of the C++ code"
would be lost.   From a purist black and white point of view,
probably true.  From a practical point of view,
perhaps not.   C++ classes have decent analogs
in Ada95, and so the basic translation seems feasible.

Lots of icky details invariably show up.
I'd guess type casts in C++ would be gruesome
when converted to Ada, and pointer arithmetic
truly ugly.   Translating macros to something
sensible is hard, but there's less macro
stuff in C++ code than in C programs.
 Nasty assumptions about the nature
of "strings" (zero terminated in C++)
will also show up, probably as a String package
coded in Ada to simulate Ada semantics, etc.
The resulting code would be ... somewhat readable.
(We've had pretty reasonable results
with other langauge translations, such as JOVIAL to C,
where the basic language concepts are
quite similar.  We do better than you
might expect, copying comments, etc).

I'm sure this will start a flame fest over readability.
I'm not going to get into that, because the
result depends on what a translator
actually does.   The issue of the OP,
if he really needs translation, may be the driving
factor.   And I suspect the Ada community
would much rather see C++ programs
moving to Ada than the other way round,
even if the answer isn't ideal :-}

And these translators, even with our foundation tools
and available front-end language modules,
still aren't easy or cheap to produce.
Just a hell of a lot more practical,
if you insist on needing a translation,
that lots of other approaches.

--
Ira Baxter, Ph.D. CTO Semantic Designs
www.semdesigns.com  512-250-1018

"Ivan Paniagua" <paniaguaivan@hotmail.com> wrote in message
news:c560b18f.0209180558.58d495cc@posting.google.com...
> I'm looking for a C++ to Ada translator.
>
> Can anybody help me?
>
> Thanks a lot.
> Iv�n





  parent reply	other threads:[~2002-09-18 19:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-18 13:58 C++ to Ada translator? Ivan Paniagua
2002-09-18 19:12 ` Hyman Rosen
2002-09-18 20:14   ` Robert A Duff
2002-09-18 20:28     ` Hyman Rosen
2002-09-19 14:29   ` Wes Groleau
2002-09-19 23:28     ` Ira Baxter
2002-09-20 16:12       ` Wes Groleau
2002-09-21 15:54         ` Ira Baxter
2002-09-18 19:50 ` Ira Baxter [this message]
2002-09-18 20:18   ` Hyman Rosen
2002-09-18 20:33     ` Robert A Duff
2002-09-19 13:37       ` Hyman Rosen
2002-09-19 13:40     ` Ira Baxter
2002-09-19 14:38       ` Frank J. Lhota
2002-09-19 15:15         ` OT: Russian to English translator? Frank J. Lhota
2002-09-19 17:17           ` Wes Groleau
replies disabled

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