
Formal Languages and Automata 415
A.3.1 Methods of Grammar Specification
Ways of specifying a grammar:
1. Backus Normal Form (BNF) and modified or extended BNF;
2. syntax or “Railroad” diagrams;
3. syntax trees.
Note that a Chomsky type-3 language (Regular Language) can also be specified by a formula
known as Regular Expressions, see Sections A.3.2 and A.4.
Backus Normal Form
The grammar G0 in the above example can be expressed in BNF as:
<identifier> ::= <letter> | <identifier> <letter> |
<identifier> <digit>
<letter> ::= a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z
<digit> ::= 0|1|2|3|4|5|6|7|8|9
Extended BNF
The BNF is extended by additional ...