help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tell a rule to shift instead of reduce?


From: Akim Demaille
Subject: Re: Tell a rule to shift instead of reduce?
Date: Sun, 22 Dec 2013 20:31:37 +0100

Le 22 déc. 2013 à 18:38, Adam Smalin <address@hidden> a écrit :

> That's one way to solve my literal problem but I would really like to make 
> ',' a higher precedence than '=' on that one rule (so it would shift instead 
> of reducing 100% of the time).
> 
> Both sides should be rvals. What if someone wanted to do something like
> 
> get_state().member[index].value, new_state, error_id = func(current_state, 
> config)

That is still an lvalue on the lhs, not a rvalue.  Unless one can
also write

  f(x), y + 1 = 3, 3

Lvalues can be complex, indeed, they're more that simple variables.
But they are typically not all the possible "exp"s.

> Is there no way to overload the way the rule resolves the shift/reduce?

No.

> I tried prec and dprec several times one email is 
> http://lists.gnu.org/archive/html/help-bison/2013-12/msg00022.html
> I tried using pref directly before and after the comma but that didn't 
> override the reduce into a shift.

We probably need more details to understand why the proposed
solutions don't apply in your case.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]