Re: C to pascal, just this once (Derek M Jones)
13 Aug 2000 18:51:29 -0400

          From comp.compilers

Related articles
C to pascal, just this once (Gary Cowley) (2000-08-05)
Re: C to pascal, just this once (2000-08-10)
Re: C to pascal, just this once (Scott Nicol) (2000-08-10)
Re: C to pascal, just this once (Franck Pissotte) (2000-08-10)
Re: C to pascal, just this once (Julio C. Rincon) (2000-08-13)
Re: C to pascal, just this once (2000-08-13)
| List of all articles for this month |

From: (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


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

Post a followup to this message

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