EBNF is an acronym for Extended Backus-Naur Form and can be used to describe a computer or other formal language. Backus-Naur Form (BNF) is a notation that describes the syntax of high-level languages. It is used to formally define the grammar of a language. A parser can be mechanically constructed for it. BNF is like a mathematical game: start with a symbol and rules are then given for what this symbol can be replaced with.
A grammar has four important parts:
- the set of tokens
- the set of non-terminal symbols
- the set of productions
- a particular non-terminal symbol called the start symbol
The four parts in our English language grammar are:
EBNF syntax is a sequence of EBNF rules.
The following shows an example of EBNF syntax.