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

Prolog DCG representation? #1

Open
dmchurch opened this issue Apr 15, 2024 · 0 comments
Open

Prolog DCG representation? #1

dmchurch opened this issue Apr 15, 2024 · 0 comments

Comments

@dmchurch
Copy link

This is really interesting! Out of curiosity, have you ever explored Prolog (the language)? Based on the structure and layout of grammar.js, it seems like you could probably represent the CSTML parser/tree as a Prolog DCG without much difficulty. I was actually exploring something similar a while back, representing C syntax in a DCG form, but it had a different goal - I was looking at translating C source into Prolog source.

Even if you don't end up using Prolog as a bootstrap/implementation language, it might not be a bad idea to experiment with describing the CSTML grammar as a DCG - they're more powerful and less verbose than an equivalent EBNF notation, so it's a good halfway point between a structure fully defined by its implementation, like this one, and the kind of set-in-stone representation you could use while writing a formal specification.

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