BNF - Backus Normal Form
Last update
2016-07-02
2016-07-02
«Come scrivere definizioni»
BNF is one of the two main notation techniques for context-free grammars.
Example:
1 2 3 4 | A sandwich consists of a lower slice of bread, mustard or mayonnaise; optional lettuce, an optional slice of tomato; two to four slices of either bologna, salami, or ham (in any combination); one or more slices of cheese, and a top slice of bread. |
This translates to:
1 2 | sandwich ::= lower_slice [mustard|mayonnaise] lettuce? tomato? [bologna|salami|ham]{2,4} cheese+ top_slice |
References: AListApart, Wikipedia