|power of SLR email@example.com (Thant Tessman) (2001-09-16)|
|Re: power of SLR firstname.lastname@example.org (J.H.Jongejan) (2001-09-20)|
|Re: power of SLR email@example.com (Thant Tessman) (2001-09-20)|
|Re: power of SLR firstname.lastname@example.org (Ben Pfaff) (2001-09-25)|
|Date:||20 Sep 2001 00:27:09 -0400|
|Organization:||Groningen University (NL)|
|Posted-Date:||20 Sep 2001 00:27:09 EDT|
Thant Tessman wrote:
> I've implemented the SLR parser generator described in Appel's "Modern
> Compiler Implementation in ML," but I've implemented it in C++. I
> chose SLR because it was the most clearly described technique.
> The parser generator seems to work on the example grammar in the book,
> but reports ambiguities in grammars like the canonical:
> E -> E - T
> E -> T
> T -> T / F
> T -> F
> F -> id
> F -> ( E )
This grammar is SLR(1). It contains two states with a shift/reduce
conflict. However they are solvable using follow information:
E -> T. E -> E-T.
T -> T./F T -> T./F
In both cases follow(E) does not contain the '/'.
Univ. of Groningen,
Return to the
Search the comp.compilers archives again.