Extended Backus–Naur Form (EBNF)

Extended Backus-Naur form is a family of metasyntax notations, any of which can be used to express a context-free grammar. EBNF is used to make a formal description of a formal language, for example a programming language. They are extensions of the basic Backus–Naur form (BNF) metasyntax notation.

Many variants of EBNF are in use; the ISO has adopted an EBNF standard (ISO/IEC 14977). Other EBNF variants use somewhat different syntactic conventions.

A formal language is a language with a precise structure, like programming languages, data languages, or Domain Specific Languages (DSL).

A grammar can be used to define two opposite things:

  • how to recognize the different portions in a piece of code written in the formal language

  • the possible ways to build a valid piece of code in the formal language

An EBNF grammar is substantially a list of production rules. Each production rule tells us how a non-terminal can be composed

https://tomassetti.me/ebnf/arrow-up-right http://matt.might.net/articles/grammars-bnf-ebnf/arrow-up-right https://github.com/antlr/grammars-v4arrow-up-right https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_formarrow-up-right http://www.astorehouseofknowledge.info/w/Extended_Backus-Naur_Formarrow-up-right http://matt.might.net/articles/grammars-bnf-ebnf/arrow-up-right https://tomassetti.me/parsing-in-javascript/arrow-up-right http://carol-nichols.com/2015/08/01/rustc-discovery/arrow-up-right https://github.com/log0ymxm/nom-ebnfarrow-up-right https://github.com/jbclements/rust-antlr/arrow-up-right

Last updated

Was this helpful?