Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Really (this time) no reduce/reduce conflicts in grammar #68

Merged
merged 1 commit into from
Nov 29, 2015
Merged

Really (this time) no reduce/reduce conflicts in grammar #68

merged 1 commit into from
Nov 29, 2015

Conversation

alexdowad
Copy link
Contributor

Last time, when I converted the right recursion in one_or_more_semis to left recursion, I accidentally introduced another R/R conflict! Sorry!

In the diff below, you can see an adjustment involving optional_space; this one caused a conflict because it can be null, and any_number_of_idents can also be null, so if there is a space but no "idents", the parser won't know if the space should be consumed by the first instance of optional_space or the second.

Similarly with one_or_more_semis -- there were several redundant rules for declarations, and if there were semis there, there was more than one way that the rules could be applied to parse them. Now there is only ever one way that the declarations rules can be applied.

(I'm just working on the 2.0 release of Racc, and have added much better warnings, which show you just where Racc has difficulty with your grammar. This is how I found these. There are still 3 S/R conflicts, which I may figure out how to fix later.)

JasonBarnabe added a commit that referenced this pull request Nov 29, 2015
Really (this time) no reduce/reduce conflicts in grammar
@JasonBarnabe JasonBarnabe merged commit 1a9b1f2 into sparklemotion:master Nov 29, 2015
@JasonBarnabe
Copy link
Contributor

Thanks! My method in updating the parser files is akin to wandering in the dark, hoping to bump into the correct solution. Glad to have someone who knows what they're doing fix stuff up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants