Re: LR(1) resolving SLR(1) reduce/reduce conflict

haberg@math.su.se (Hans Aberg)
7 Apr 2003 00:22:09 -0400

          From comp.compilers

Related articles
LR(1) resolving SLR(1) reduce/reduce conflict haberg@math.su.se (2003-03-30)
Re: LR(1) resolving SLR(1) reduce/reduce conflict gvcormac@speedy.uwaterloo.ca (2003-03-30)
Re: LR(1) resolving SLR(1) reduce/reduce conflict haberg@math.su.se (2003-03-31)
Re: LR(1) resolving SLR(1) reduce/reduce conflict gvcormac@speedy.uwaterloo.ca (2003-04-05)
Re: LR(1) resolving SLR(1) reduce/reduce conflict haberg@math.su.se (2003-04-07)
| List of all articles for this month |
From: haberg@math.su.se (Hans Aberg)
Newsgroups: comp.compilers
Date: 7 Apr 2003 00:22:09 -0400
Organization: Mathematics
References: 03-03-203 03-04-004
Keywords: parse, LR(1)
Posted-Date: 07 Apr 2003 00:22:09 EDT

  gvcormac@speedy.uwaterloo.ca (Gordon Cormack) wrote:


>Of course you are right, so the grammar is LALR, contrary to what I
>I claimed.
>
>There is still an SLR conflict in state 1.


The SLR conflict is there in your grammar, all right. (Which, for new
readers, is:
        S -> A x B x
        S -> B y A y
        A -> w
        B -> w
.)


Meanwhile, I have discovered that the Bison manual, in the section
"Mysterious reduce/reduce conflicts", gives an example of an LR(1) grammar
that is not LALR(1). It is then not SLR(1) as well, as an SLR(1) grammar
is LALR(1).


    Hans Aberg * Anti-spam: remove "remove." from email address.
                                    * Email: Hans Aberg <remove.haberg@member.ams.org>
                                    * Home Page: <http://www.math.su.se/~haberg/>
                                    * AMS member listing: <http://www.ams.org/cml/>


Post a followup to this message

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