Re: Reduce/reduce conflicts on A -> e (empty) productions

"Chuck Batson" <broadcast@cbatson.com>
9 Jun 2004 00:26:09 -0400

          From comp.compilers

Related articles
Reduce/reduce conflicts on A -> e (empty) productions broadcast@cbatson.com (Chuck Batson) (2004-06-06)
Re: Reduce/reduce conflicts on A -> e (empty) productions broadcast@cbatson.com (Chuck Batson) (2004-06-09)
Re: Reduce/reduce conflicts on A -> e (empty) productions cfc@shell01.TheWorld.com (Chris F Clark) (2004-06-09)
Re: Reduce/reduce conflicts on A -> e (empty) productions haberg@matematik.su.se (Hans Aberg) (2004-06-15)
| List of all articles for this month |
From: "Chuck Batson" <broadcast@cbatson.com>
Newsgroups: comp.compilers
Date: 9 Jun 2004 00:26:09 -0400
Organization: Compilers Central
References: 04-06-019
Keywords: LALR, parse
Posted-Date: 09 Jun 2004 00:26:09 EDT

> 1) S -> 'Q' foo 'R'
> 2) foo -> empty1 empty2
> 3) empty1 ->
> 4) empty2 ->
>
> According to the dragon book's definition, kernel item [S -> 'Q' . foo
> 'R', b] results in a reduce/reduce conflict on input 'R', since a
> reduction by both productions 3 and 4 are called for as foo => empty1,
> foo => empty2 (again "=>" implies zero or more steps), and 'R' is in
> FIRST(svb) for both cases. How should this conflict be resolved?


I believe I have found my flaw. While it's true foo derives empty2 (in
zero or more steps), it is NOT true that foo *right-most* derives
empty2.


Thanks! :-)


Chuck


Post a followup to this message

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