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

Support Left recursive PEG Grammars #214

Open
yhirose opened this issue Jun 18, 2022 · 3 comments
Open

Support Left recursive PEG Grammars #214

yhirose opened this issue Jun 18, 2022 · 3 comments

Comments

@yhirose
Copy link
Owner

yhirose commented Jun 18, 2022

https://medium.com/@gvanrossum_83706/left-recursive-peg-grammars-65dab3c580e1

@mingodad
Copy link
Contributor

Packcc https://github.com/arithy/packcc has it but it has a high toll on memory usage.

@yhirose
Copy link
Owner Author

yhirose commented Jun 18, 2022

cpp-peglib supports 'Infix expression by Precedence climbing', and the feature can properly express 'Operator associativity'. But the downside of this approach is that it introduces the special PEG syntax. If the parser supports left recursive PEG grammars, we can specify such operator associativity with the normal PEG syntax.

https://github.com/yhirose/cpp-peglib#parsing-infix-expression-by-precedence-climbing

@mingodad
Copy link
Contributor

Some people say that direct left recursion is easier than indirect left recursion.
I found this links that can help somehow:

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

No branches or pull requests

2 participants