mirror of
https://github.com/semver/semver.git
synced 2026-07-11 08:02:23 -05:00
[GH-ISSUE #575] Use EBNF instead of an own non-standard modified BNF #2153
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Vampire on GitHub (Jun 12, 2020).
Original GitHub issue: https://github.com/semver/semver/issues/575
I'd like to suggest using EBNF according to ISO 14977 instead of a non-standard modified BNF like currently, it is much more readable and makes the result much more concise, e. g. by eliminating the need for recursion and introducing optionals.
E. g.
could be written as
Reuse nonterminals where possible
should be
Simplify the BNF form, even if not using EBNF
e. g. if
is changed to
you can simplify
to
as now
<identifier characters>can be empty@Vampire commented on GitHub (Jun 20, 2020):
This would for example be a possible EBNF form I could PR:
Or maybe even better than ISO 14977 EBNF would be RFC 5234 ABNF:
@davbrito commented on GitHub (Nov 10, 2020):
I like the idea of use ABNF from RFC 5234
@greggirwin commented on GitHub (Feb 22, 2021):
Here's a visible comparison of the 3 formats, as syntax diagrams.
ABNF
#EBNF

#BNF

@greggirwin commented on GitHub (Feb 22, 2021):
Oy, sorry about that. They show large in the comments.
@greggirwin commented on GitHub (Jul 7, 2021):
Any follow-up on this from maintainers?
@steveklabnik commented on GitHub (Jul 15, 2021):
I generally am in favor of using standard things over non-standard things, but haven't had the opportunity to review this in detail at all.
@greggirwin commented on GitHub (Jul 15, 2021):
Here's an ABNF version, minus the ABNF standard values.
@greggirwin commented on GitHub (Sep 10, 2021):
Ping. Any thoughts?
@ghost commented on GitHub (Aug 19, 2022):
May I suggest BNF for Java?
https://sourceforge.net/projects/bnf-for-java/
In 2007, I wrote this parser-generator in Java, and conforms to ISO-14977.
In 2022, I am re-writing the compiler in Antlr. Wish me luck!