a notation used to describe the syntax of languages. BNF was devised by J. Backus and Peter Naur and introduced in the first official description of ALGOL 60 (see ALGOL). it is sometimes referred to as Backus normal form.
Each BNF statement describes some syntactic unit by giving one or more alternative expansions of it, separated by the symbol |. For example, the following is a BNF description of the assignment statement in BASIC (Beginner's All-purpose Symbolic Instruction Code) (we assume that
The first statement defines
Many languages contain syntactic rules that cannot be expressed in BNF; for instance, BNF provides no way to say that an integer cannot exceed 32,767. Still, BNF descriptions are handy because they are concise and definitive and because parsers can be generated directly from them.