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

Add a grammatical analyser #3

Open
sorear opened this issue Jun 26, 2016 · 2 comments
Open

Add a grammatical analyser #3

sorear opened this issue Jun 26, 2016 · 2 comments

Comments

@sorear
Copy link
Owner

sorear commented Jun 26, 2016

@digama0's KLR does some very nice things, but it's a semialgorithm (not guaranteed to halt on failure) which makes me very reluctant to include it. Could alternatively port SMM2's packrat parser, which does not certify unambiguity.

@digama0
Copy link
Contributor

digama0 commented Jun 26, 2016

I'm not sure if I mentioned this, but you can view compositing depth as a parameter to the algorithm, that is, the maximum number of rules that can be nested. This gives a family KLR(n) of parse algorithms, each of which have guaranteed halting, and any KLR grammar is KLR(n) for some n. If this was annotated in the unambiguous directive in set.mm, you could resolve this issue. (I think you need 4 or 5 composites to get all the variations on df-oprab.)

@sorear
Copy link
Owner Author

sorear commented Jun 26, 2016

Ah, that works for me. (Will have to understand the algorithm a little bit better before I can start on it; I wrote an LR(0) parser for JSON once but that's about it.)

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

2 participants