Related articles |
---|
SLR parse table question msm@spaceworks.com (Michael Mstowski) (1997-11-13) |
Re: SLR parse table question torbenm@diku.dk (1997-11-14) |
From: | torbenm@diku.dk (Torben AEgidius Mogensen) |
Newsgroups: | comp.compilers |
Date: | 14 Nov 1997 11:43:42 -0500 |
Organization: | Department of Computer Science, U of Copenhagen |
References: | 97-11-073 |
Keywords: | parse |
Michael Mstowski <msm@spaceworks.com> writes:
>I'm trying to understand how to construct a SLR parse table and am
>having difficulty building the canonical set of items. The dragon
>book shows an algorithm, then magically generates the entire canonical
>set. I don't know how the I(n) items are generated from I(1) and
>can't determine how the 'dot' is placed. I know how to find the
>closure, but after that, things get a bit fuzzy.
You can try looking in Andrew Appel's "Modern Compiler Implementation
in [ML/C/Java]" (these are three similar books, only differing in the
language used for examples). I find the explanation of SLR
construction much more readable than in the Dragon Book. One reason
for this is that it much more clearly separates _what_ you have to do
from _how_ you do it. That said, the Dragon books has a lot more
detail about things like table compression etc, which may be
interesting when you actually have to write a compiler for a language
with a large syntax (e.g. Cobol). These subjects are, however, fairly
unimportant for an intuitive understanding of the algorithms.
Torben Mogensen (torbenm@diku.dk)
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.