help-bison
[Top][All Lists]
Advanced

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

Re: Resolving shift/reduce conflicts?


From: Hans Åberg
Subject: Re: Resolving shift/reduce conflicts?
Date: Tue, 2 Feb 2021 10:22:40 +0100

> On 2 Feb 2021, at 07:50, Christoph Grüninger <foss@grueninger.de> wrote:
> 
> Dear Bisons,
> 
> I have another issue within the CMake parser code. When using the
> attached cmDependsJavaParser.y with Bison 3.7.5, i get the following
> warning: 4 shift/reduce conflicts [-Wconflicts-sr]. When adding
> -Wcounterexamples I get the output below. Ok, I understand the issue and
> Bison is right.
> But what should I do to get rid of the problem?

One way is to add precedences %left, %right, %nonassoc, to the tokens 
immediately before and after the parsing dot . in the conflicting rules. If 
there are no such tokens, the grammar must be rewritten, or using GLR.





reply via email to

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