I still need help with this. I rewrote it maybe this will be more clear?
I want to allow this
var = var
var, var = var
var = var, var
My rules are similar to the below
body:
recursive-expr //rval = rval is here
| rval '=' rval ',' rvalLoop
| rval ',' rvalLoop '=' rval
rvalLoop:
rval
| rvalLoop ',' rval
The problem is '=' is higher precedence than ','. When I write "a=b,c" it
reduce when it sees ',' making a=b an rval and rval ',' rval is invalid so
my parser fails and "rval '=' rval ',' rvalLoop" is never used. The
conflict file shows
rval '=' rval . ',' rvalLoop
Conflict between rule 352 and token ',' resolved as reduce (',' < '=').
How do I say for this rule shift instead of reduce? I don't want to make
',' higher than '=' because it would be wrong when looking into functions.
For example func(a,b=2,c) should have b=2 as an expression and not (a,b) =
(2,c).
_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison