hi,
I am writing a parser to support 'parallel assignment i.e. in syntax a,b,c =
1,2,3; and I write the grammar like:
vars : var | var comma vars
values : value | value comma values
assignment : vars assign values semicolon
they are working, but lack of checking if the lhs and rhs of '=' are in
On Sun, Jun 7, 2009 at 6:04 AM, Hans Aberg wrote:
> On 6 Jun 2009, at 23:29, xelanoimis wrote:
>
> I'm updating my scripting language and I need some help from someone more
>> experienced with bison who would like to have a look at my grammar. As it
>> is
>> now it works fine, but I just want to
On 7 Jun 2009, at 14:31, Max cs wrote:
I am writing a parser to support 'parallel assignment i.e. in syntax
a,b,c =
1,2,3; ...
You might do it in the actions, that is, parse LHS and RHS as two
lists, and then assign these two lists. Grammar:
assign: LHS "=" RHS;
LHS: LHS_sequence | .
Thanks for the answers, but I'm still stuck.
I set a few more tokens to %left and reduced the conflicts to 84.
I think some of them may be caused by the unary operators.
Can you please give me an example on my grammar about what should I do
exactly to reduce them further?
I uploaded the output f
Just a thought on this, in case you don't need only a 1:1 parallel
assignment:
I wanted to support this too, along with returning more than one value, like
LUA does. It is pretty tricky if you don't know at compile time how many
values are expected or returned. Even LUA messes up these assigns i