Rewriting as a means for translating

hbaker@netcom.com (Henry G. Baker)
Fri, 4 Feb 1994 17:30:01 GMT

          From comp.compilers

Related articles
Rewriting as a means for translating hbaker@netcom.com (1994-02-04)
Re: Rewriting as a means for translating schrod@iti.informatik.th-darmstadt.de (1994-02-07)
Re: Rewriting as a means for translating parrt@s1.arc.umn.edu (Terence Parr) (1994-02-08)
| List of all articles for this month |

Newsgroups: comp.compilers
From: hbaker@netcom.com (Henry G. Baker)
Keywords: translator, tools, comment
Organization: Compilers Central
Date: Fri, 4 Feb 1994 17:30:01 GMT

In my experience, the idea of source-to-source translation by means of
a simple rewriting system is always a loser. No matter how close the
languages seem, there are always significant "gotchas".


I have written several X-to-Y translators, and they are always full
compilers--i.e., complete syntax analysis and full code generation. The
code generation stuff you won't find in Dragon, but it isn't that
difficult. BTW, the output is surprisingly readable if you spend the time
to produce a pleasing 1-1 name mapping and if you do "pretty printing" in
the target language.
--
            Henry Baker
[That has been my experience, too, except for languages specifically designed
to be embedded in another, e.g. ratfor. -John]
--


Post a followup to this message

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