BNF is a way of writing down the grammar of a computer based language. It defines rules which must be followed in order for source code to be syntactically correct. This means that the syntax of the source code must contain no grammatical errors. For example if I write a IF statement like this

IF ELSE a > 10 THEN END IF a = 1

As you can see the above statement is syntactically incorrect. ELSE should never follow immediately after the IF. What is excepted is some sort of comparison, such as a > 10.

In order to enforce this syntax rule, the above IF statement would have been written in BNF. We can then say the following statement

Source code is syntactically correct if it obeys all of the rules of some grammar defined in BNF. As such BNF is critical for the syntax analysis stage of the compilation process. The rules defined in BNF will tell the compiler what is valid syntax and what is not valid syntax.