Augmented Backus Naur Format

Comparing ABNF and EBNF

Backus Naur formats are metalanguages used to describe other languages and structured text. They have a longish history. While formal language description systems date back to Pāṇini’s Sanskrit grammar from 2,500 years ago, modern variants evolved from John Backus’s work in the 1950s.

Panini

Demo

Variation history

graph TB pan[-350: Pāṇini] bal[1958: Backus Algol] bnf[1963: Backus Naur Form] wsn[1970: Wirth Syntax Notation] ebnf[1977: Wirth EBNF] xml[2006: XML EBNF] gon[2009: Go EBNF] abnf[2010: Augmented BNF] iso[1996: ISO BNF] pan --> bal bal --> bnf bnf --> wsn bnf --> xml wsn --> ebnf ebnf --> xml ebnf --> gon ebnf --> abnf ebnf --> iso classDef green fill:#9f6,stroke:#333,stroke-width:2px; classDef orange fill:#f96,stroke:#333,stroke-width:4px; class abnf green class pan orange

Evolution of Notation Systems

BNF and Wirth Syntax Notation (1960s-1970s)

The original Backus-Naur Form (BNF) was developed for defining ALGOL 58’s syntax. Niklaus Wirth later created the Wirth Syntax Notation (WSN), which added important features like repetition using {...}.

EBNF Development (1977)

EBNF emerged from Wirth’s beautifully short article in ACM. Key developments in Pascal’s documentation:

Modern Variants

Syntax Comparison

Feature BNF EBNF ABNF Notes
Definition ::= = = Rule declaration
Alternatives | | | Choice between options
Optional - […] […] Optional elements
Repetition - {…} n*m ABNF allows count ranges
Grouping - (…) (…) Combining elements
Comments - () ; ABNF uses line comments
Termination - ; ; End of rule marker

Modern Considerations

Case Sensitivity

ABNF added case sensitivity support through RFC 7405, making it more precise for modern usage.

Unicode Support

While ABNF officially uses ASCII, there are proposals like Leonard and Kyzivat’s draft to standardize Unicode handling.

© 2018 - 2025 · Bytestone Blog · Theme Simpleness Powered by Hugo ·