%token A B C D E F G H
%%
x : y H y | z H z
;
y : G | t | y B G | y B t
;
z : w | z D w
;
w : C | t | E z F
;
t : A
;
There is a reduce/reduce conflict because of t. How can we solve it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By default the conflict between y: t and w: t is resolved in favor of y: t. If you want it the other way, reorder the corresponding rules. Or you can expand one of them like this :-
Note that I’ve got rid of the t rule and removed the y: A rule by expanding it :-
Step 1: Eliminate the t: A rule
Step 2: