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

PEG, Packrat, Pika Parsing mode #118

Open
EDKarlsson opened this issue Jun 10, 2022 · 2 comments
Open

PEG, Packrat, Pika Parsing mode #118

EDKarlsson opened this issue Jun 10, 2022 · 2 comments

Comments

@EDKarlsson
Copy link

EDKarlsson commented Jun 10, 2022

Thanks for responding to my tweet! Just opening this ticket to start a discussion of implementing PEG parsing mode. Side note, you could enable the discussions section to have an area where people could discuss topics without having to create an issue about it.

A bit of context.
I'm currently implementing the SysML v2 modeling language and I've made very good progress using textX since it came graphical output and model/AST traversal built in. TextX lacks some features and flexibility in its grammar that results in bloat/excessive elements in the model and it is restricted to Python.

I think having a PEG, and more specifically an implementation of Pika Parsing would be a great addition since it allows for linear time parsing and can handle left recursive rules. I think Pike parsing would help with implementing a parser for SysML since the Systems Modeling Language is extensive/complex and has 2 separate specifications for the base language, KerML, and SysML.

@EDKarlsson
Copy link
Author

Here is the paper on Pika parsing: https://arxiv.org/abs/2005.06444
Reference implementation: https://github.com/lukehutch/pikaparser

@DmitrySoshnikov
Copy link
Owner

@EDKarlsson, thanks for submitting the issues (yeah, I'll if Discussions would be useful). PEG would be nice to implement, we probably can start from gradual experimental approach. We'll need to see whether PEG grammar syntax is similar to BNF we use, otherwise (if it uses some extension to BNF) might be a first good step - to define a PEG-grammar format and build a parser for it. Then the actual runtime for PEG.

I'll need to read the paper on Pika, might worth handling in a separate issue.

Also, as mentioned, I won't be having much time to implement this at the moment (due to my main job load), however will appreciate a PR if you'd like to start building 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