Re: code generation

Pietro <>
28 Jan 2002 01:08:40 -0500

          From comp.compilers

Related articles
code generation (2002-01-24)
Re: code generation (Ira D. Baxter) (2002-01-28)
Re: code generation (Boris Boesler) (2002-01-28)
Re: code generation (Pietro) (2002-01-28)
Re: code generation (=?ISO-8859-15?q? (2002-02-06)
code generation (Viesturs Rikards) (2004-11-14)
Re: code generation (2004-11-17)
Code generation mcvax!ruuinf! (1989-02-14)
| List of all articles for this month |

From: Pietro <>
Newsgroups: comp.compilers
Date: 28 Jan 2002 01:08:40 -0500
Organization: Department of Computer Science - University of Bologna
References: 02-01-112
Keywords: code
Posted-Date: 28 Jan 2002 01:08:40 EST

Hi wrote:
> We are working on our master thesis about code generation. We are
> searching for a code generation method. The method should be general
> and translate from one high level language to another high level
> language.

Just a couple of ideas since I was thinking to something similar.

You can have a look at kimwitu. It is not a meta-xxx compiler but and
advanced parser generator with a lot of handy routine to allow code
transformation. It builds a parser from a grammar and gives you a sort
of api to traverse the AST. The main problem of course is that you
have to write your grammar... It is really easy to build pretty
printer with this, but it requires more work to perform complex
transformation, expecially if the two language trees are differents.

Another way could be to write a back-end for an open source compiler
(like gcc) using it to generate high level code instead of

If you want to be less general there is a project called openc++ that
is a kind of meta-compile for c++. It could be easy used to generate
code the way you want... If fact it has a singular approach, but it is
open source and you can pick up part of the code and use it in your

You can also think of building a tool to transform your language in an
tree xml and from there transform it using xslt... in fact I don't
know if I really belive on this apporach :-)

These are just few ideas. Let me know if your are more lucky than me.

best wishes,
pgp key: 1024D/8A091922 2000-10-18
Pietro Abate <>
Key fingerprint = 5111 D91B 5E0C 5CE6 FDA3 5EF4 6120 E18E 8A09 1922
public key avalaible via public key server at

Post a followup to this message

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