Re: ANSI C grammar without shift-reduce conflict on 'ELSE'

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Sun, 09 Dec 2007 15:32:36 -0800

          From comp.compilers

Related articles
ANSI C grammar without shift-reduce conflict on 'ELSE' ggrares@yahoo.com (Rares GalaN) (2007-12-09)
Re: ANSI C grammar without shift-reduce conflict on 'ELSE' cbarron3@ix.netcom.com (2007-12-09)
Re: ANSI C grammar without shift-reduce conflict on 'ELSE' gah@ugcs.caltech.edu (glen herrmannsfeldt) (2007-12-09)
Re: ANSI C grammar without shift-reduce conflict on 'ELSE' anton@mips.complang.tuwien.ac.at (2007-12-10)
Re: ANSI C grammar without shift-reduce conflict on 'ELSE' anton@mips.complang.tuwien.ac.at (2007-12-10)
Re: ANSI C grammar without shift-reduce conflict on 'ELSE' monnier@iro.umontreal.ca (Stefan Monnier) (2007-12-12)
| List of all articles for this month |

From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Sun, 09 Dec 2007 15:32:36 -0800
Organization: Compilers Central
References: 07-12-021
Keywords: C, yacc

Rares GalaN wrote:


> I'm trying to use the ANSI C Grammar from
> http://www.lysator.liu.se/c/ANSI-C-grammar-y.html and I'm getting a
> "shift - reduce on ELSE" error. I'm quite new with this, so it would
> really be useful if I could get a grammar that's conflict free. Any
> suggestions will help.


The C grammar is not conflict free. I thought shift-reduce was
a warning in yacc.


-- glen
[It is indeed a warning, but it also warns you that the generated
parser doesn't quite parse the input grammar. -John]



Post a followup to this message

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