Hi,

I'm writing this dummy language very similar (and smaller) to Haskell. I
have a shift/reduce conflict. (please note that this is the first time I
write a grammar, so pardon me some mistakes)

I have the following productions:

expr =
                {expr_sequence}         expr_sequence |
                {fun_chan_declar}               id type_dec type |
                {if_then_else_expr}             if formula then 
[then_expr]:expr_sequence else
[else_expr]:expr_sequence;
expr_sequence = 
...
...
...
unary =
                {basic}                                 basic|
                {not_expr}                              not unary;
basic=
                {expr_between_parens}   right_paren function_calls left_paren |
                {id}                                    id |
                {literal}                               literal;

literal =
                {string_literal}                string_literal |
                {boolean_literal}       boolean_literal  |
                {neg_integer_literal}   minus integer_literal |
                {integer_literal}               integer_literal;
        
This is organized like this, because of expression precedences. Of course
the proper tokens are defined.
I am just putting here what I think is necessary to understand the problem.

If I remove id and literal from the basic production, the conflicts go away,
so I suppose this is what I have to change (just removing is no good,
because I need those literals and ids). I just don't know how to do this in
another way.
Can anyone help?

Thanks on advance!

(If you need any more data, just ask!)

-- 
View this message in context: 
http://old.nabble.com/Shift-Reduce-Conflict-tp27922792p27922792.html
Sent from the SableCC - User mailing list archive at Nabble.com.


_______________________________________________
SableCC-Discussion mailing list
[email protected]
http://lists.sablecc.org/listinfo/sablecc-discussion

Reply via email to