A-level Computing/AQA/Paper 1/Theory of computation/Backus-naur form

Backus-Naur Form (also known as Backus Normal Form (BNF) or BNF for short) is a notation technique to express syntax of languages in computing. The expression is put in lists and can be used to see if syntax that is written is valid.

Symbols
BNF is represented using the following symbols: ::=  'is defined as' |    'or' <>   category names

The way that these symbols are laid out are as such:  ::=  |  In plain English, the expression above means "The parent expression is defined as the child expression 1 or the child expression 2". This means that to make up the parent expression, it must have a child expression and a child expression is made up of other things.

Example
In this example, The BNF structure is breaking down the syntax to create

 ::=       |     

 ::= <Area Code> <Street Code> <Area Code> ::= <City Prefix> | <City Prefix> <Street Name> ::= <Name> <Street Type> <Flat Number> ::= | <House Number> ::= | ::= |   <Name> ::= <Street Type> ::= <City Prefix> ::= <Street Code> ::= <Town Name> ::= <City Name> ::= <Country> ::= ::= |   ::= A|B|C|D|E|F|G|H|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z ::= 0|1|2|3|4|5|6|7|8|9