In computer science, extended Backus–Naur form (EBNF) is a family of metasyntax notations, any of which can be used to express a context-free grammar.
for optionality): A Pascal-like programming language that allows only assignments can be defined in EBNF as follows: For example, a syntactically correct program then could be: The language can easily be extended with control flows, arithmetical expressions, and Input/Output instructions.
Any grammar defined in EBNF can also be represented in BNF, though representations in the latter are generally lengthier.
This prevents these characters from being used in the languages, and requires a special symbol for the empty string.
Furthermore, EBNF includes mechanisms for enhancements, defining the number of repetitions, excluding alternatives, comments, etc.
The first is part of EBNF grammar, the special sequence, which is arbitrary text enclosed with question marks.
The interpretation of the text inside a special sequence is beyond the scope of the EBNF standard.
For example, the space character could be defined by the following rule: The second facility for extension is using the fact that parentheses in EBNF cannot be placed next to identifiers (they must be concatenated with them).