I have a situation where there is a rule with a shift/reduce conflict that i understand. I want a rule to never reduce until at the last moment possible (end of line). So I would like to say always shift. How do i do this?
Share
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.
As Craig notes, when there’s a shift reduce conflict, bison does the shift. If the warning about it bothers you, you can use bison’s %expect directive to specify the expected number of shift-reduce conflicts. This way it will be silent if that’s the only conflict, but if there are additional conflicts, the warning will come back.