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

Formal grammar spec for prql #12

Closed
qharlie opened this issue Jan 25, 2022 · 4 comments
Closed

Formal grammar spec for prql #12

qharlie opened this issue Jan 25, 2022 · 4 comments

Comments

@qharlie
Copy link
Contributor

qharlie commented Jan 25, 2022

A formal grammar specification would allow others to easily create parsers, do you have a preference PEG or BNF ?

@qharlie qharlie changed the title EBNF for prql Formal grammar spec for prql Jan 25, 2022
@RCHowell
Copy link

Once syntax has an initial decision, I can take up an ANTLR parser

@max-sixty
Copy link
Member

Thanks for opening the issue @qorrect !

My initial plan was to write a parser in nom, which I've heard great things about and had good initial experiences with. As you can see, it's not much at the moment.

I think a formal grammar would be useful, and the language is developed enough to start on that if someone wants to have a go. I would vote to go for a PEG grammar given the language is relatively simple™, and if we pursue the nom route it'll be broadly compatible.

As ever, open to feedback! Thank you!

@max-sixty
Copy link
Member

Now that we're using pest, we have an analytical grammar to coordinate around.

My sense is that while some details are still evolving, the analytical spec is sufficient, and we can formalize when there's less evolution. But if anyone would benefit from changes (e.g. @qorrect depending on what's helpful for you if you're doing this in python), feel free to comment.

@vanillajonathan
Copy link
Collaborator

With a formal grammar you could generate a syntax diagram #1810.

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

4 participants