2 ms·
Don't use the old ISO 14977:1996 specification for BNF. For a rationale, see: https://dwheeler.com/essays/dont-use-iso-14977-ebnf.html https://dwheeler.com/essa
by dwheeler 4y ago
Don't use the old ISO 14977:1996 specification for BNF. For a rationale, see: https://dwheeler.com/essays/dont-use-iso-14977-ebnf.html https://dwheeler.com/essays/dont-use-iso-14977-ebnf.html
Quick summary:
1. It is unable to indicate International/Unicode characters, code points, or byte values. ISO/IEC 14977:1996 only supports ISO/IEC 646:1991 characters.
2. It is unable to indicate character ranges.
3. It requires a sea of commas, so using it produces hard-to-read grammars.
4. It does not build on widely-used regex notation
5. It has a bizarre, difficult-to-understand, and easily-misunderstood “one or more” notation.
6. It is challenging to understand and many key terms are undefined.
I suggest considering the EBNF notation from the W3C Extensible Markup Language (XML) 1.0 (Fifth Edition). That's much closer to the regex notation used by many software developers today, and since the point of a BNF is to communicate, using a language similar to a language most developers already know is a big advantage.