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

It would be nice to allow textual annotations in the grammar #15

Open
pvillads opened this issue Dec 2, 2021 · 0 comments
Open

It would be nice to allow textual annotations in the grammar #15

pvillads opened this issue Dec 2, 2021 · 0 comments

Comments

@pvillads
Copy link

pvillads commented Dec 2, 2021

A language of any complexity is not just defined by its syntax, but also its semantics. Currently there is no way to annotate (or describe) the grammar rules in natural language.
Consider a rule defining integer literals:

IntegerLiteral = digit+

It is certainly correct, but the reader needs to know that what the maximum allowed literal is. It would be very nice to be able to generate:

IntegerLiteral = digit+
// Integer literals may not exceed unsigned values in 32 bits.

The text in comments should be provided (just like you can do for the actual grammar rule) in the generated HTML.

I realize that you get away with using the -png option and then merging the generated HTML file with the comments, but it is a hassle to maintain.

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