Re: how to increase compilation performance, "Jr." <>
12 Feb 1999 02:58:01 -0500

          From comp.compilers

Related articles
how to increase compilation performance (Thomas Gänshirt) (1999-02-05)
Re: how to increase compilation performance (1999-02-07)
Re: how to increase compilation performance (Charles E. Bortle, Jr.) (1999-02-10)
Re: how to increase compilation performance (,Jr.) (1999-02-12)
Re: how to increase compilation performance (Stephen J Bevan) (1999-02-15)
| List of all articles for this month |

From:, "Jr." <>
Newsgroups: comp.compilers
Date: 12 Feb 1999 02:58:01 -0500
Organization: Netcom
References: 99-02-027 99-02-043
Keywords: history, interpreter

"Charles E. Bortle, Jr." <> 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
That is:

20 Let X=4

is allowed but:

20 Let

is not.

2) There are basically two kinds of statement that pose problems
when implementing incremental compilers:

a) declarations
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).



Post a followup to this message

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