8000 Link to LR(1) docs in conflict error messages · Issue #1019 · lalrpop/lalrpop · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Link to LR(1) docs in conflict error messages #1019

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

Open
414owen opened this issue Dec 25, 2024 · 5 comments
Open

Link to LR(1) docs in conflict error messages #1019

414owen opened this issue Dec 25, 2024 · 5 comments

Comments

@414owen
Copy link
414owen commented Dec 25, 2024

The errros says:

See the LALRPOP manual for advice on making your grammar LR(1).

It would be great to print a link with that message, as it's not clear where exactly in the manual to find this advice.

@chanbengz
Copy link
Contributor

Well, I can't find any advice about making grammar LR(1) in the manual.

If you're solving the ambiguity, it will be great to post your grammar here.

@414owen
Copy link
Author
414owen commented Jan 2, 2025

Ah, well I'm okay, I've solved a few ambiguities without much trouble.
I just think this error message needs to be updated to point to a resource that helps solve ambiguities.

@chanbengz
Copy link
Contributor

Thanks for the proposal!

However, I think it's tough to do so because there's no general ways to resolve the ambiguity. Often I got the solution from the other project and I'm still lack of those experiences and knowledge.

It will be much appreciated if you found some useful resource and share them!

@414owen
Copy link
Author
414owen commented Jan 3, 2025

Well at the very least we can stop telling people to look through the manual for information that isn't there.

@dburgener
Copy link
Contributor

I think you're right that this isn't really in the lalrpop book yet.

I suspect the intent in the error message was around the line on this page: https://lalrpop.github.io/lalrpop/tutorial/index.html which lists including this advice as a todo.

The "making your grammar LR(1)" message mentioned here is one of several references to the manual in these errors. There are also messages mentioning the sections on inlining and precendence, as well as a "See the LALRPOP manual for advice on making your grammar unambiguous". Of these, only precedence seems to be mentioned in the manual, and it's not obvious where it resides, since the page name is "parsing full expressions" rather than anything about precedence.

So to full resolve this, I think we need the following steps:

  • Write a manual section on ambiguous grammars
  • Write a manual section on insufficient lookahead errors (That's the message listed in the title)
  • Write a manual section on inlining
  • Link to manual sections

I'll leave this open for now, and hopefully start checking off those items. (Other PRs for any of the above are of course always welcome)

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

No branches or pull requests

3 participants
0