Related articles |
---|
C to pascal, just this once gcowley@cableone.net (Gary Cowley) (2000-08-05) |
Re: C to pascal, just this once derekNOSPAM@knosof.co.uk (2000-08-10) |
Re: C to pascal, just this once snicol@apk.net (Scott Nicol) (2000-08-10) |
Re: C to pascal, just this once franck.pissotte@online.fr (Franck Pissotte) (2000-08-10) |
Re: C to pascal, just this once juliocr@home.com (Julio C. Rincon) (2000-08-13) |
Re: C to pascal, just this once derek@knosof.co.uk (2000-08-13) |
From: | derek@knosof.co.uk (Derek M Jones) |
Newsgroups: | comp.compilers |
Date: | 13 Aug 2000 18:51:29 -0400 |
Organization: | Knowledge Software |
References: | 00-08-040 00-08-046 |
Keywords: | translator |
All,
I had a brief private discussion with the author, who sent me some samples.
Some of the code did not look nice. There are a variety of reasons
why converted code may not look as good as the original.
Old style function declarations. The translator has to assume worst
case. Using prototypes can make a big difference.
Macro that expand to complicated expressions. In this case source
that looks simple suddenly becomes complicated.
Mixing different types (not a problem in the code I saw). This causes
lots of casts to be generated, again a translator has to play safe.
Finally the target language will just look different. For instance
a return X has to be translated to 'func_name:=X ; exit', two statements
that may then need a begin/end pair.
A lot can be gained in any translation project by working on the original
source to help the translator. For instance, going the other way, unnesting
any Pascal procedures leads to a much cleaner translation to C.
In terms of effort. If you have less than 20,000 lines it is probably
better to rewrite manually. More than that and a translator will make
savings.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.