Re: Code generation from AST

Hans-Peter Diettrich <DrDiettrich1@aol.com>
Sun, 11 Nov 2007 05:49:41 +0100

          From comp.compilers

Related articles
Code generation from AST lssilva@gmail.com (Lucas S. Silva) (2007-11-10)
Re: Code generation from AST mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2007-11-11)
Re: Code generation from AST DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-11-11)
| List of all articles for this month |

From: Hans-Peter Diettrich <DrDiettrich1@aol.com>
Newsgroups: comp.compilers
Date: Sun, 11 Nov 2007 05:49:41 +0100
Organization: Compilers Central
References: 07-11-033
Keywords: code
Posted-Date: 11 Nov 2007 12:40:37 EST

Lucas S. Silva wrote:


> The algorithm I am using doesn't deal very well with recursive
> expression such as:
>
> a = f.g.h(a , x.y.o(1,2) )


You can transform this statement (i.e. the AST) into Reverse Polish
Notation (RPN), like


    1 2 x y . o . () a f g . h . () a =


Now the sequence of the required actions (machine code) should be quite
obvious.


DoDi



Post a followup to this message

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