Last updated
Was this helpful?
Last updated
Was this helpful?
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