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

Generating the grammar #89

Open
vwkd opened this issue Sep 17, 2022 · 0 comments
Open

Generating the grammar #89

vwkd opened this issue Sep 17, 2022 · 0 comments

Comments

@vwkd
Copy link
Contributor

vwkd commented Sep 17, 2022

When parsing a complex language it becomes increasingly hard to keep track how everything fits together in the implementation code. It becomes increasingly helpful to look at the grammar of the language without the code. Also for a large enough project it becomes more tedious to write the grammar manually and keep it in sync for every change in the code. It pays of to have the code as single source of truth that the grammar is generated from. For similar reasons, it’s coming to generate a GraphQL schema from the code of a GraphQL server. For example, GraphQL.js has a printSchema function to generate the schema from the code.

Can arcsecond generate the grammar for a language?

I’m assuming arcsecond should have all the information needed to generate the grammar encoded somewhere in its runtime. Though I can imagine for a context-dependent language generating the grammar could pose a challenge simply because I‘m not sure any grammar exists that can express all possibilities. But at least for a context-free language it should be possible using any common grammar like McKeeman Form or (E)BNF.

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

1 participant