WANTED - info. on cross-progrmming-language translation

gary@intrepid.com (Gary Funck)
Tue, 16 Nov 1993 17:12:37 GMT

          From comp.compilers

Related articles
WANTED - info. on cross-progrmming-language translation gary@intrepid.com (1993-11-16)
Re: WANTED - info. on cross-progrmming-language translation wjw@eb.ele.tue.nl (1993-11-17)
Program translation issues synaptx!thymus!daveg@uunet.UU.NET (Dave Gillespie) (1993-11-18)
Re: info on source to source translation parrt@s1.arc.umn.edu (Terence Parr) (1993-11-18)
| List of all articles for this month |

Newsgroups: comp.compilers
From: gary@intrepid.com (Gary Funck)
Keywords: translator, question
Organization: Intrepid Technology, Inc.
Date: Tue, 16 Nov 1993 17:12:37 GMT

We are about to embark on a project to translate a large application
witten in Pascal to Ada (why? why ask why?). We're planning to use a
framework that we built some time back for translating a minimal
(small-C-ish) subset of C into Ada. The technique is straightforward
enough; we build a full parse tree in memory and traverse the tree, first
for symbol/type information, second to make various tree transformations,
and finally to produce the translated code. There are both "challenges"
in terms of finding a meaningful mapping one language to the other, and
shortfalls in terms of constructs that are passed through more/less
unaltered (these must be changed manually).


We are well aware of the disadvantages of automatic source code
translation. Let me just offer this consolation: our expectation is that
we will add "domain specific" transformations that take into account
particular naming conventions and structure that will increase the quality
of the resulting code, and that we expect a fair amount of hand-tuning, or
rework at the end of the process. Nevertheless, there is a lot of
leverage in just having the procedural code 'edited' from one syntax to
another.


This long-winded intro. is a lead-in to a few questions about the area of
programming-language translation in general and q reauest for specific
references to/sources of work in that area. I'm aware of 'p2c', the
Pascal-to-C translator written by Dave Gillepsie, posted to
comp.sources.unix (vol. 21). P2c is an impressive piece of work, but its
structure does not lend itself well to our application; we need something
that lets us make several passes over the code, and to make various
parse-tree transformations before generating the translated code (if
yoy're familiar with the internals of this package, and think there's a
way to make it work, please set me straight).


A few questions:


1) Can you recommend any published work/research on the subject of
automated source code conversion?


2) Do you know of any public domain toolsets that offer a general
framework for translation? Ideally what we'd like to see is something
that accepts an input grammar description (yacc syntax preferred), and a
method for describing parse-tree transformations, and methods for walking
the final tree and generating source code. (there are commercial
Pascal-to-C/Ada translators that claim to be 'rule based'; I assume they
have s general method for describing those rules.)


3) Do you have any success/failure stories on using automated source
translation, that you'd like to share?


Thanks,


- Gary
--
| Gary Funck gary@intrepid.com [uunet!uupsi!intrpd!gary]
| Intrepid Technology Inc., Mountain View CA (415) 964-8135
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.