[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LR(1) paser generator based on Pager's algorithm
From: |
Joel E. Denny |
Subject: |
Re: LR(1) paser generator based on Pager's algorithm |
Date: |
Sun, 1 Apr 2007 19:54:40 -0400 (EDT) |
On Sun, 1 Apr 2007, Joel E. Denny wrote:
> I am studying Menhir (and OCaml) now to figure out what it does with this
> grammar.
Menhir version 20070322 does not detect the problem. It does at least
report a useless production (A: 'a' 'a') that results from the problem,
and Bison (sigh) fails to report even that because it fails to eliminate
the associated unreachable state.
Here's an extended grammar that makes the production useful again:
S: 'a' A 'a'
| 'b' A 'b'
| 'c' c
;
A: 'a' 'a'
| 'a'
;
c: 'a' 'b'
| A
;
With the %left 'a' declaration, neither Bison nor Menhir reports any
warning for this grammar. Both report a syntax error at the dot in the
input:
ba.ab
Again, canonical LR(1) would accept this input.
- Re: LR(1) paser generator based on Pager's algorithm, Joel E. Denny, 2007/04/01
- Re: LR(1) paser generator based on Pager's algorithm, Paul Hilfinger, 2007/04/01
- Re: LR(1) paser generator based on Pager's algorithm, Joel E. Denny, 2007/04/01
- Re: LR(1) paser generator based on Pager's algorithm,
Joel E. Denny <=
- Re: LR(1) paser generator based on Pager's algorithm, Xin Chen, 2007/04/15
- Re: LR(1) paser generator based on Pager's algorithm, Joel E. Denny, 2007/04/02
- Re: LR(1) paser generator based on Pager's algorithm, Xin Chen, 2007/04/15
- Re: LR(1) paser generator based on Pager's algorithm, Joel E. Denny, 2007/04/02
- Re: LR(1) paser generator based on Pager's algorithm, Joel E. Denny, 2007/04/02
- Re: LR(1) paser generator based on Pager's algorithm, Xin Chen, 2007/04/15
- Re: LR(1) paser generator based on Pager's algorithm, Joel E. Denny, 2007/04/03
- Re: LR(1) paser generator based on Pager's algorithm, Xin Chen, 2007/04/15
- Re: LR(1) paser generator based on Pager's algorithm, Xin Chen, 2007/04/15
- Re: LR(1) paser generator based on Pager's algorithm, Joel E. Denny, 2007/04/07