Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Create .peg/clean.peg files from parsers written in python. #118

Closed
MaxwellWibert opened this issue Aug 7, 2023 · 1 comment
Closed
Labels

Comments

@MaxwellWibert
Copy link

It would be pretty useful to be able to programmatically take a parser defined using Python syntax and write the grammar to a .peg or clean.peg file. Better yet if you could write into other PEG formats by specifying the grammar of those formats with an additional peg file (assuming it interfaces similarly to the arpeggio.peg file).

@igordejanovic
Copy link
Member

It should be straightforward to do as the Arpeggio takes the grammar and represent it in memory as a "parser model" which corresponds 1:1 to the grammar provided. You just need to visit the parser model nodes and generate the string with the correct syntax.

But, I think this feature is outside of the scope of the project. Let me know if you do it and publish as open source so I can link to it from the docs.

@textX textX locked and limited conversation to collaborators Aug 7, 2023
@igordejanovic igordejanovic converted this issue into discussion #119 Aug 7, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants