Re: Position of an Intermediate Code Generator

"Marco van de Voort" <marcov@toad.stack.nl>
31 Jul 2002 00:58:49 -0400

          From comp.compilers

Related articles
Position of an Intermediate Code Generator dirkduck2@hotmail.com (Chris Rowland) (2002-07-15)
Re: Position of an Intermediate Code Generator torbenm@diku.dk (Torben Ęgidius Mogensen) (2002-07-21)
Re: Position of an Intermediate Code Generator hannah@schlund.de (Hannah Schroeter) (2002-07-21)
Re: Position of an Intermediate Code Generator marcov@toad.stack.nl (Marco van de Voort) (2002-07-31)
Re: Position of an Intermediate Code Generator pfroehli@ics.uci.edu (Peter H. Froehlich) (2002-08-04)
| List of all articles for this month |

From: "Marco van de Voort" <marcov@toad.stack.nl>
Newsgroups: comp.compilers
Date: 31 Jul 2002 00:58:49 -0400
Organization: Eindhoven University of Technology, The Netherlands
References: 02-07-060 02-07-071
Keywords: practice, comment
Posted-Date: 31 Jul 2002 00:58:49 EDT

Torben Ęgidius Mogensen wrote:
> "Chris Rowland" <dirkduck2@hotmail.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]


Post a followup to this message

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