Re: Translating OO program to procedural program

"Eric" <englere_geo@yahoo.com>
11 Oct 2006 23:20:10 -0400

          From comp.compilers

Related articles
Translating OO program to procedural program samhng@gmail.com (=?iso-8859-1?B?bW9vcJk=?=) (2006-10-10)
Re: Translating OO program to procedural program pjb@informatimago.com (Pascal Bourguignon) (2006-10-11)
Re: Translating OO program to procedural program oliverhunt@gmail.com (oliverhunt@gmail.com) (2006-10-11)
Re: Translating OO program to procedural program napi@axiomsol.com (napi) (2006-10-11)
Re: Translating OO program to procedural program mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2006-10-11)
Re: Translating OO program to procedural program torbenm@app-6.diku.dk (2006-10-11)
Re: Translating OO program to procedural program englere_geo@yahoo.com (Eric) (2006-10-11)
Re: Translating OO program to procedural program DrDiettrich1@aol.com (Hans-Peter Diettrich) (2006-10-11)
Re: Translating OO program to procedural program int2k@gmx.net (Wolfram Fenske) (2006-10-11)
Re: Translating OO program to procedural program tommy.thorn@gmail.com (Tommy Thorn) (2006-10-11)
Re: Translating OO program to procedural program JoachimPimiskern@web.de (Joachim Pimiskern) (2006-10-12)
Re: Translating OO program to procedural program gnorik@gmail.com (2006-10-24)
| List of all articles for this month |

From: "Eric" <englere_geo@yahoo.com>
Newsgroups: comp.compilers
Date: 11 Oct 2006 23:20:10 -0400
Organization: Compilers Central
References: 06-10-039
Keywords: OOP
Posted-Date: 11 Oct 2006 23:20:08 EDT

moop wrote:


> My approach is just to rename the methods with the instance name so
> that they can be placed in a single source file and then be compiled
> later by the procedural lang compiler.


This can get nasty with instances being created dynamically. I can
create hundreds of instances at runtime, and you won't know this at
compile time. You would have to implement the "new" mechanism yourself,
and you'd have to track the locals for all of my instances dynamically.
This is far more complicated than a simple text translation.


The only option that makes sense to me if to use a C++ compiler that
produces an output in the form of C code - C would be the target
language. This would be a full compiler and not a simple program.



Post a followup to this message

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