On 21 Jun 2009, at 22:46, Michiel Helvensteijn wrote:

I'm designing a language with, among other things, unary and binary operators. I use the Bison precedence declarations for operator precedence. I'm also using the precedence declarations together with %prec to resolve some other
shift/reduce conflicts, such as the dangling else. It makes for a much
cleaner grammar, in my opinion, than building the precedences into the
grammar itself.

The problem has not been resolved, and the type of grammar constraint precedences I made are not implemented.

One way to implement it is to not resolve the operator precedences in the grammar, but in the actions. This is the only way in the case the operator precedences are set dynamically. One program that uses (or so I remember) this approach is Hugs <http://haskell.org/>.

  Hans




_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to