Hi Uxio, hi Hans,

You cannot use Bison to resolve dynamically your precedence if
you have a free set of levels.  But if you have a fixed number
of level, say 10, then you could define ten tokens for each level,
and give them the precedence you want.  Then, in the scanner,
map each operator to the corresponding level, storing the actual
operator as a semantic value.  The scanner could use a map for
instance to decide to which token you map each operator.

That wouldn’t be of much help if you also want to play with
associativity.  Maybe using even more tokens to denote the different
possibilities.


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

Reply via email to