Don’t Use ISO/IEC 14977:1996 Extended Backus-Naur Form (EBNF) David A. Wheeler 2023-03-21 (original 2019-03-02) If you need to define a language (such as a programming language or complex data structure) it’s often helpful to use some kind of Extended Backus-Naur form (EBNF). Often people do a Google search, find out that there’s an ISO/IEC standard (ISO/IEC 14977:1996), and then just use it... without realizing that this very old ISO/IEC standard has a lot of problems and should not be used. In this essay I will briefly explain the problems of the ISO/IEC 14977:1996 specification, and why I think you should avoid using it. I will first discuss the many technical failings of the specification itself, then follow that with why just mindlessly obeying ISO is inappropriate (since some people may do that). When I discuss its failings I will also compare the 14977 specification to a common alternative, the EBNF notation from the W3C Extensible Markup Language (XML) 1.0 (Fifth Edition). I'll also briefly mention IETF's RFC 5234, "Augmented BNF for Syntax Specifications: ABNF". IETF's specification isn't nearly as bad as 14977, though I don't recommend using RFC 5234 outside of RFC specifications. My focus in this essay is the problems of 14977. It is not necessarily a disaster to use 14977, but a lot of people use 14977 without realizing that it has a number of very serious problems and that there are much better alternatives available. Obviously these are my personal opinions, which you may not share... but I hope this essay will help you understand why I hold them, and perhaps convince you. The specification itself has serious problems The whole point of an EBNF is to make it possible to describe a grammar clearly, unabiguously, and succinctly. Here I examine the freely-available specification. Here are some of its key weaknesses (as I perceive them): It is unable to indicate International/Unicode characters, code points, or byte values. ISO/IEC 14977:1996 only supports...
First seen: 2025-05-19 22:56
Last seen: 2025-05-20 02:57