|how to increase compilation performance email@example.com (Thomas Gänshirt) (1999-02-05)|
|Re: how to increase compilation performance firstname.lastname@example.org (1999-02-07)|
|Re: how to increase compilation performance email@example.com (Charles E. Bortle, Jr.) (1999-02-10)|
|Re: how to increase compilation performance firstname.lastname@example.org (Charles.E.Bortle@dfw-ixnews9.ix.netcom.com,Jr.) (1999-02-12)|
|Re: how to increase compilation performance email@example.com (Stephen J Bevan) (1999-02-15)|
|From:||Charles.E.Bortle@dfw-ixnews9.ix.netcom.com, "Jr." <firstname.lastname@example.org>|
|Date:||12 Feb 1999 02:58:01 -0500|
"Charles E. Bortle, Jr." <email@example.com> wrote:
>You might have a look at the book Writing Interactive Compilers And
>Interpreters, by P.J. Brown, John Wiley & Sons, 1979, ISBN 0 471 27609
>X. Brown discusses incremental compilers.
>[I'd love to get a copy of that book. It's long out of print. -John]
As John has indicated that the book I mentioned is out of print, and
as I have a copy, I have summarized below the chapter on Incremental
Compiling. (Perhaps some of this seems self evident...also, though
I would still recommend the book if you can get your hands on it,
Brown does not really give much more detail in this chapter.)
I have not implemented an incremental compiler, but I have implemented
a multi-pass FORTRAN IV compiler and a PILOT interpreter (a pure
interpreter for Windows), and am currently implementing a PASCAL
compiler. (I have used incremental compilers, such as MAI BASIC
FOUR's Business Basic, which has an incremental front end "compiler"
which creates an internal program which is interpreted. Microsoft's
Visual Basic gives incremental diagnostic information, though I don't
know how the program statements are handled internally.)
1) Each line is a complete statement in the source language
20 Let X=4
is allowed but:
2) There are basically two kinds of statement that pose problems
when implementing incremental compilers:
2) block structure statements (e.g. BEGIN END or
or FOR NEXT loops or IF THEN ELSE structures)
These types of statments pose line to line context-dependency problems.
The less context-dependant the more suited it will be to incremental
3) Generally, a pre-run module is therefore need, which will make
the necessary checks that the incremental front-end could not due
to context-dependant statements.
4) There are two approaches to dealing with context-dependency:
(Brown presupposes that approach a is the one adopted.)
a) Ignore all context when processing each line and leave the entire
context processing to the pre-run module.
b) Process the lines as input, creating lists of the missing
context-dependant information, and removing items from the lists
as these items are processed as input lines. The pre-run module now
simply checks to see that all the lists are empty, and if not, flaggs
the error that it finds (e.g. a goto who's target statement number
does not exist).
Return to the
Search the comp.compilers archives again.