bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: webkit will not build with bison 2.4


From: Joel E. Denny
Subject: Re: webkit will not build with bison 2.4
Date: Wed, 19 Nov 2008 11:46:20 -0500 (EST)

On Wed, 19 Nov 2008, George Sherwood wrote:

> > > 346 closing_brace:
> > > 347     '}'
> > > 348   | %prec maybe_sgml TOKEN_EOF
> > > 349   ;
> > 
> > The argument of %prec must be a token.  maybe_sgml is a nonterminal.  
> > Bison 2.3 ignored this error.  Bison 2.3b and later complain about it.
> > 
> > I can't tell for sure what the webkit developers intended here, but 
> > removing maybe_sgml from line 348 should make Bison stop complaining.
> > 
> 
> Thanks.  Unfortunately it isn't going to be that easy.  Removing
> maybe_sgml from 348 results in an error also.
> 
> /usr/bin/bison -d -p cssyy WebCore/css/CSSGrammar.y
> -o ./DerivedSources/CSSGrammar.cpp 
> WebCore/css/CSSGrammar.y: conflicts:105 shift/reduce, 6 reduce/reduce 
> WebCore/css/CSSGrammar.y: expected 48 shift/reduce conflicts
> WebCore/css/CSSGrammar.y: expected 0 reduce/reduce conflicts 
> make: *** [DerivedSources/CSSGrammar.cpp] Error 1

Given how this change increases the conflicts, it's possible that Bison 
2.3's interpretation is actually what the webkit developers intended.  
It's hard to tell though because precedence cannot be declared for 
nonterminals.  Bison 2.3 is using a default precedence by mistake here.

If you want to adjust the grammar so that both Bison 2.4 and Bison 2.3 
interpret it in the same manner as Bison 2.3 interpreted the original 
grammar, it looks like you can do this as follows.  Add

  %nonassoc LOWEST_PREC

before any other %nonassoc, %left, or %right in the grammar file.  Now 
change `maybe_sgml' in line 348 to LOWEST_PREC.  You'll have to test this 
on the webkit grammar as I have not downloaded it to try it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]