Le 22 déc. 2013 à 18:40, Adam Smalin <[email protected]> a écrit :
> I forgot to CC this to the group a few days ago.
>
> >The token precedences apply to the tokens immediately before and after the
> >parsing ‘.’ (as in the .output file) in the shift/reduce conflicting rules.
> >The grammar must be written so that the tokens appear in such a position.
>
> | rval '=' rval %prec '.' ',' rval
That's bad style, move your "%prec '.'" at the end of the rule.
It means the same, but it's clearer. And therefore notice that
now, this rule has the precedence of '.', not that of '='.
> conflict file:
>
>
> rval '=' rval . ',' rval
> Conflict between rule 343 and token ',' resolved as reduce (',' < '=').
So it's bizarre that in that conditions bison still refers to '='.
> Shouldn't it have worked? I tried putting %prec at the end of the line and
> after the ',' as well and it failed. I tried multiple places at once and got
> an error saying only one %prec per line.
Please, post a self contained and minimal example.
_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison