help-bison
[Top][All Lists]
Advanced

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

handle shift/reduce conflict (using prec directive)


From: Fiordean Dacian
Subject: handle shift/reduce conflict (using prec directive)
Date: Mon, 1 Jul 2002 18:12:00 +0200

> Hi group,
>
> I'm back again with a 'silly' problem... -:)
>
> I do have a grammer like the following:
>
> shared_loop_expr
>     : KW_LOOP KW_BEGIN=20
>         {
>         }
>         msc_body=20
>         {
>         }
>         KW_ENDLOOP end
>         {
>         }
>     ;
>
> This generates a shift/reduce conflict since when Bizon create the state =
> for the=20
>
> KW_LOOP end
>
> rule, it choses to reduce it with the
>
>     : KW_LOOP KW_BEGIN=20
>
> This is the content of the verbose file:
>
> state 202
>
> shared_loop_expr -> KW_LOOP KW_BEGIN=20
>
> KW_LOOP shift, and go to state 21
>
> .......
>
> KW_LOOP [reduce using rule 37 (msc_body)]
>
> $default reduce using rule 11 (possible_name)
>
>
>
> I would like for the the 2nd KW_LOOP also a shift operation instead of =
> reduce. I've tried defining 2 right operators
>
> %right OP1
> %right OP2
>
> and associate them with my rule respectively rule 37 mentioned in the =
> verbose file. I've changed their declaration order for priority, and I =
> get the same results.
>
> Could anybody give a sugestion what I'm doing wrong here?
>
> Thanks,
> // D.

reply via email to

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