This is a language to define the formal grammar of a language, whether that be a ProgrammingLanguage, a MarkupLanguage or simply the syntax of a configuration file.
An example grammar would be
<sentance> ::= <verb-part> <noun-part>
<verb-part> ::= <noun-part> <verb>
<noun-part> ::= <proper-noun>
| THE <noun>
<verb> ::= throws
| kicks | hides | fetches
<proper-noun> ::= John
| Jane
<noun> ::= ball
::= dog
This grammar accepts sentances such as
but would not accept sentences such as
because deflates is not a verb known in this grammer and in the basement is not a noun. The grammar would have to be extended to cover such cases.
Because some common cases are inconvenient to define using pure BNF, some extensions have been added in EBNF:
3 pages link to BackusNaurForm: