|Position of an Intermediate Code Generator email@example.com (Chris Rowland) (2002-07-15)|
|Re: Position of an Intermediate Code Generator firstname.lastname@example.org (Torben Ęgidius Mogensen) (2002-07-21)|
|Re: Position of an Intermediate Code Generator email@example.com (Hannah Schroeter) (2002-07-21)|
|Re: Position of an Intermediate Code Generator firstname.lastname@example.org (Marco van de Voort) (2002-07-31)|
|Re: Position of an Intermediate Code Generator email@example.com (Peter H. Froehlich) (2002-08-04)|
|From:||"Marco van de Voort" <firstname.lastname@example.org>|
|Date:||31 Jul 2002 00:58:49 -0400|
|Organization:||Eindhoven University of Technology, The Netherlands|
|Posted-Date:||31 Jul 2002 00:58:49 EDT|
Torben Ęgidius Mogensen wrote:
> "Chris Rowland" <email@example.com> writes:
> I prefer to let the parser generate an abstract syntax tree as a data
> structure and then generate intermediate code from that, possibly
> using several passes (e.g., one pass to collect symbol information and
> another to do the actual code generation).
> The "Dragon Book", which you refer to, describe how to do code
> generation during parsing. While this is possible, it makes for a
> less clean structure for your compiler, and the main reason for doing
> it (lack of memory for keeping the entire syntax tree in memory) is
> not important these days.
What is in your opinion the use of the intermediate code, opposed to
directly generating code from the syntax tree?
[It depends how much optimization you want to do. If you want a simple
code generator, producing code from the parse tree is fine. If you want
to improve the code, you need something else that lets you reorganize
the code without reference to the parse tree. -John]
Return to the
Search the comp.compilers archives again.