|Algol68 compiler ? firstname.lastname@example.org (1996-02-19)|
|Re: Algol68 compiler ? email@example.com (1996-02-23)|
|Parallel Algol68 compiler firstname.lastname@example.org (1996-02-27)|
|Re: Parallel Algol68 compiler email@example.com (1996-03-01)|
|Re: Parallel Algol68 compiler firstname.lastname@example.org (Henry Spencer) (1996-03-01)|
|From:||Henry Spencer <email@example.com>|
|Date:||1 Mar 1996 14:02:33 -0500|
|Organization:||SP Systems, Toronto|
|References:||96-02-236 96-02-290 96-02-325|
firstname.lastname@example.org (Alex Colvin) writes:
>Early Un*x compilers ran as a number of processes connected by pipes.
>Although this was largely due to address space limits, I suppose it
>might allow some overlap of analysis and I/O.
No, actually the early Unix compilers ran one phase at a time,
connected by temporary files. Remember that early Unix hardware
configurations often could not accommodate more than one big process
in memory; trying to run all the phases simultaneously, connected by
pipes, would have slowed down compiles quite substantially.
> Unfortunately, it looks like C requires that the lexer and
> declaration semantics be carefully synchronized, limiting the
> potential concurrency.
This is not really true, actually. I've written a C parser which had
lexer, parser, and semantics as completely separate passes (joined by
pipes, as it happens, so I can guarantee the separation).
The problem Alex is alluding to is typedef. But typedef is not
semantics; it is context-dependent syntax. It's not hard to
determine, purely at the syntactic level, when a type name is being
declared. The tricky part is that you need to feed that knowledge
back into the parsing.
The parsing technology I was using was context-independent, so I
fudged a little. A tiny bit of "front end" code consulted a table of
type names and turned ID into TYPEID where necessary, before the
parser saw it. When the declaration parsing saw a type-name
declaration, it invoked a little bit of code which maintained the
type-name table. (Nested scopes did complicate the table slightly.)
Henry Spencer, email@example.com
Return to the
Search the comp.compilers archives again.