Pascal to C source code translator

Joel Rees joel.rees at gmail.com
Mon May 23 12:05:13 UTC 2011


On Sun, May 22, 2011 at 10:54 AM, Marko Vojinovic <vvmarko at gmail.com> wrote:
> On Sunday 22 May 2011 02:23:36 Kevin J. Cummings wrote:
>> On 05/21/2011 08:27 PM, JD wrote:
>> > This is the sample pascal module:
>> This is not PASCAL.  It might very well be Object Pascal, which is a
>> (slightly) different language.  Different enough that the p2c compiler
>> does not know about the extensions in Object Pascal, so I can see how it
>> would fail.  You need to find an Object Pascal to C translator....
>
> AFAIK, an OO language cannot be mapped into a procedural one so easily. Maybe
> you can find an Object Pascal to C++ translator, but I'm not so sure it's
> translatable to just C. Not by a machine, anyway.

??

Sure it can. Or, at least, object languages that have their roots in
procedural languages can be translated to C. C++ is just one example,
although I'll admit that it turned/turns out to be harder than it
first appeared when a lot of us thought we could just pervert or maybe
extend the pre-processor. You do need a lot of runtime support
(special libraries), and you end up with a lot of odd-looking function
calls.

The output of the translation step is by no means pretty, ....

A lot of the peculiarities in both Java and C++ are derived from false
paths taken in that adventure, near as I can tell.

JD --

You have checked the wikipedia page on object pascal, right?

Is there a reason you need C source output?


More information about the users mailing list