Le 23 déc. 2013 à 14:38, Adam Smalin a écrit :
> Oh crap! It's looking at the token ',' and not the other rules (rule 12).
> FF
> I want to rule 12 to trump rule 15. Rule 15 precedence should definitely
> stay the same. F!
I don’t understand w
Oh crap! It's looking at the token ',' and not the other rules (rule 12).
FF
I want to rule 12 to trump rule 15. Rule 15 precedence should definitely
stay the same. F!
So it's impossible for me to ask bison to shift during rule 12 when
possible?
Le 22 déc. 2013 à 21:17, Adam Smalin a écrit :
> > Please, post a self contained and minimal example.
>
> Ok. I didn't test it by parsing actual code. I only looked at the conflict
> %left ','
> %right '='
> %left '.'
>
> %%
>
> program:
> newline_many global_loop newline_many
> global_l
> Please, post a self contained and minimal example.
Ok. I didn't test it by parsing actual code. I only looked at the conflict
%left ','
%right '='
%left '.'
%%
program:
newline_many global_loop newline_many
global_loop:
global_expr
| global_loop global_expr
global_expr:
VAR
Le 22 déc. 2013 à 20:35, Akim Demaille a écrit :
>
> Le 22 déc. 2013 à 18:40, Adam Smalin a écrit :
>
>> I forgot to CC this to the group a few days ago.
>>
>>> The token precedences apply to the tokens immediately before and after the
>>> parsing ‘.’ (as in the .output file) in the shift/r
Le 22 déc. 2013 à 18:40, Adam Smalin a écrit :
> I forgot to CC this to the group a few days ago.
>
> >The token precedences apply to the tokens immediately before and after the
> >parsing ‘.’ (as in the .output file) in the shift/reduce conflicting rules.
> >The grammar must be written so th
Le 22 déc. 2013 à 18:38, Adam Smalin 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
I forgot to CC this to the group a few days ago.
>The token precedences apply to the tokens immediately before and after the
parsing ‘.’ (as in the .output file) in the shift/reduce conflicting rules.
The grammar must be written so that the tokens appear in such a position.
| rval '=' rval %prec
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
Le 17 déc. 2013 à 09:25, Adam Smalin a écrit :
> 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
Maybe I am missing something, by how about clearly stating
that you can have several lvalues and r
[Please cc the list.]
On 18 Dec 2013, at 23:45, Adam Smalin wrote:
> >The token precedences apply to the tokens immediately before and after the
> >parsing ‘.’ (as in the .output file) in the shift/reduce conflicting rules.
> >The grammar must be written so that the tokens appear in such a pos
[Please cc the list.]
On 18 Dec 2013, at 11:05, John P. Hartmann wrote:
> Isn't the grammar context sensitive? No way that can be shoehorned into
> LALR(1).
Computer languages are typically context sensitive, but that is pushed into the
actions.
[Please avoid styled text.]
On 18 Dec 2013, at 02:05, Adam Smalin wrote:
> I don't believe that works. According to my rules and the conflict files it
> REFUSES to shift. "var, var = var" I think will work but "var = var, var"
> will be seen as rval ',' rval which isn't legal. I'm not sure whe
I don't believe that works. According to my rules and the conflict files it
REFUSES to shift. "var, var = var" I think will work but "var = var, var"
will be seen as rval ',' rval which isn't legal. I'm not sure where I can
make rval ',' rval legal and have my code work because doing it in rval:
wi
I tried this
| rval '=' rval ',' rval %prec '.'
I still get the conflict
Conflict between rule 345 and token ',' resolved as reduce (',' < '=').
I tried dprec 1 and 2 on the two lines. Then I changed 1 into 3 to flop
which one is higher. No dice
> A second, more straightforward, idea is to shu
On 17 Dec 2013, at 09:25, Adam Smalin wrote:
> 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
If you can do dynamic type checking, it suffices to write rules (as in the
Bison manual calculator e
Hey Adam,
I have a couple ideas. First, you might try updating the precedence of ','
for just that one rule:
| rvalLoop ',' rval %prec '='
(though you might need to define a precedence-level higher than both ','
and '=' for that to work right).
A second, more straightforward, idea is to shuffl
> because it would be wrong when looking into functions.
Is there some reason you need to treat function parameter lists
as expressions, rather than comma-separated expression lists?
Could you just follow the usual practice of:
a) give ',' and '=' the precedence you desire
b) break your expressio
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:
rva
19 matches
Mail list logo