Skip to content

Allow for implicit rule labels #492

@ivanperez-keera

Description

@ivanperez-keera

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions