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

Solve backtracking #17

Open
marcelocantos opened this issue Jan 24, 2020 · 0 comments
Open

Solve backtracking #17

marcelocantos opened this issue Jan 24, 2020 · 0 comments
Labels
P2 Low priority

Comments

@marcelocantos
Copy link
Contributor

Given the well-defined grammar a -> b+; b -> "x" ":" "x"+ ";"?, the parser will match valid input x:x;x:x but won't match also-valid input x:xx:x. This is because "x"+ greedily slurps up all the xs and the parser doesn't have any look-ahead to see whether an x has a : after it and should therefore be left to the next b to pick up.

This requires an LL(2) grammar, so we will probably have to bite the LL(k) or LL(*) bullet soon.

@ChloePlanet ChloePlanet added the P2 Low priority label Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Low priority
Projects
None yet
Development

No branches or pull requests

2 participants