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

Allow for implicit rule labels #492

Open
ivanperez-keera opened this issue Jan 26, 2025 · 0 comments
Open

Allow for implicit rule labels #492

ivanperez-keera opened this issue Jan 26, 2025 · 0 comments

Comments

@ivanperez-keera
Copy link
Contributor

ivanperez-keera commented Jan 26, 2025

LBNF rules have the following shape:

Identifier "." Identifier "::=" (Identifier | String)* ";"

However, in many cases, non-terminals will only have one production associated to them, and it's common to call that the same as the value category.

Would it be possible to modify the shape of rules in LBNF's grammar to the following?

(Identifier ".")? Identifier "::=" (Identifier | String)* ";"

It be great if this was allowed for all productions, not just those where the non-terminal has one rule only. Even if BNFC reports an error when code generation is attempted, one might want to use BNFC just to check if the input grammar defines all symbols used and if the syntax is correct before getting into the specifics of giving the rules labels.

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