bug-bison
[Top][All Lists]
Advanced

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

GLR: ambiguity reports are wrong


From: Akim Demaille
Subject: GLR: ambiguity reports are wrong
Date: Tue, 21 Feb 2012 12:20:46 +0100

On this grammar:

> %%
> start:
>   'a' b 'c' d
> | 'a' b 'c' d
> ;
> b: 'b';
> d: /* nada.  */;
> %%

with input a b c d, the current code reports:

> Option 1,
>   start -> <Rule 1, tokens 1 .. 3>
>     $end <tokens 1 .. 1>
>     'a' <tokens 2 .. 2>
>     b <tokens 3 .. 3>
>     'c' <empty>
> 
> Option 2,
>   start -> <Rule 2, tokens 1 .. 3>
>     $end <tokens 1 .. 1>
>     'a' <tokens 2 .. 2>
>     b <tokens 3 .. 3>
>     'c' <empty>

instead of:

> Option 1,
>   start -> <Rule 1, tokens 1 .. 3>
>     'a' <tokens 1 .. 1>
>     b <tokens 2 .. 2>
>     'c' <tokens 3 .. 3>
>     d <empty>
> 
> Option 2,
>   start -> <Rule 2, tokens 1 .. 3>
>     'a' <tokens 1 .. 1>
>     b <tokens 2 .. 2>
>     'c' <tokens 3 .. 3>
>     d <empty>

This is a regression I introduced in master only with
commit 783aa653f4ca70a75919c8516b950494c612cbfe.
http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00291.html

Attachment: 0001-glr-fix-ambiguity-reports.patch
Description: Binary data



reply via email to

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