Re: Compiler Design + feedback

russell kym horsell <kym@svalbard.freeshell.org>
Thu, 23 Apr 2009 05:24:40 +0000 (UTC)

          From comp.compilers

Related articles
Compiler Design + feedback herron.philip@googlemail.com (Philip Herron) (2009-04-21)
Re: Compiler Design + feedback cfc@shell01.TheWorld.com (Chris F Clark) (2009-04-21)
Re: Compiler Design + feedback herron.philip@googlemail.com (Philip Herron) (2009-04-22)
Re: Compiler Design + feedback kym@svalbard.freeshell.org (russell kym horsell) (2009-04-23)
Re: Compiler Design + feedback pertti.kellomaki@tut.fi (Pertti Kellomaki) (2009-04-24)
| List of all articles for this month |

From: russell kym horsell <kym@svalbard.freeshell.org>
Newsgroups: comp.compilers
Date: Thu, 23 Apr 2009 05:24:40 +0000 (UTC)
Organization: Central Iowa (Model) Railroad, Plano, TX, USA
References: 09-04-044 09-04-046
Keywords: design
Posted-Date: 24 Apr 2009 06:49:33 EDT

Chris F Clark <cfc@shell01.theworld.com> wrote:
> Philip Herron <herron.philip@googlemail.com> writes:
> > But for an interpreter should you like do the python way of doing
> > things and just execute line by line, i just dont know how you control
> > the flow that way of your program without parsing the entire source
> > code into some kind of syntax map.
> At some level, you eventually have to parse more than line-by-line
> unless your language stays trivial. So, yes, it is a good thing to
> parse then entire source into an internal representation. I once
> wrote an article about this for Sigplan Notices called "Build a
> Tree--Save a Parse".
[...]


Now this is a rule I wished all language designers/implementers would follow.


I had the displeasure to recently use a preprocessor in which the "directives"
were sometimes executed immediately, and sometimes altered internal options
and acted on at the end-of-input by the preprocessor.


While this doesn't sound TOO bad, the doc for the system didn't make it clear
which did what and, in fact, examples included with the package suggested
that all directives operated on a "store and later interpret" basis (i.e.
the logical way :).


To get even a basic thing to work involved trying non-trivial (no joke-- I
had to write a script to do it) interleavings & permutations of directives
to find out what did what (or in many cases just got an unremarked s/w
emergency exit).



Post a followup to this message

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