> Le 17 juin 2018 à 16:33, Rici Lake <ricil...@gmail.com> a écrit : > > Although unrelated to this proposal, I would also favour allowing > > %% > <type> nonterminal: rhs > > as an alternative to > > %type <type> nonterminal > %% > nonterminal: rhs FTR, the more I contemplate this idea, the more I like it. Unfortunately we hit again the classical S/R conflict of the naive YACC grammar: in a grammar such as %% <int> exp : "number" | exp "+" exp { $$ = $1 + $3; } | exp "*" exp { $$ = $1 * $3; } | "(" exp ")" { $$ = $2; } | "[" <int> { $$ = 42; } "]" { $$ = $2; } ; a single lookahead will not suffice for the parser to know, when it's reading the rhs of a rule, whether the <tag> coming is that of a midrule action so we stay in the right hand rule of the rule, or the tag of the lhs of the next rule. GLR would of course solve the problem. But I'm not eager to sit Bison on top of GLR right now (we use LAC for instance, not implemented in glr.c).
- Bison C++ mid-rule value lost with variants Piotr Marcińczyk
- Re: Bison C++ mid-rule value lost with variants Kaz Kylheku
- Re: Bison C++ mid-rule value lost with variants Piotr Marcińczyk
- Re: Bison C++ mid-rule value lost with variants Hans Åberg
- Re: Bison C++ mid-rule value lost with variants Frank Heckenbach
- Re: Bison C++ mid-rule value lost with vari... Akim Demaille
- Re: Bison C++ mid-rule value lost with ... Rici Lake
- [PATCH 0/7] RFC: typed midrule act... Akim Demaille
- Re: [PATCH 0/7] RFC: typed mid... Hans Åberg
- Re: [PATCH 0/7] RFC: typed mid... Hans Åberg
- Re: Bison C++ mid-rule value lost ... Akim Demaille
- Re: Bison C++ mid-rule value lost with ... Hans Åberg
- Re: Bison C++ mid-rule value lost with ... Frank Heckenbach
- Re: Bison C++ mid-rule value lost ... Akim Demaille
- Re: Bison C++ mid-rule value l... Frank Heckenbach
- Re: Bison C++ mid-rule val... Akim Demaille
- Re: Bison C++ mid-rule val... Frank Heckenbach
- Re: Bison C++ mid-rule val... Akim Demaille
- Re: Bison C++ mid-rule val... Hans Åberg
- Re: Bison C++ mid-rule val... Frank Heckenbach
- Bison lexer Hans Åberg