EBNF = Extended Backus-Naur Form. A slightly more detailed and expanded version of standard BNF (Backus-Naur Form). They are both more or less the same definition, so this one stands for both.

Essentially, the EBNF defines the rules and grammar of a programming language. Lines in the EBNF are called production rules, ie they set rules strings in the ensuing language must obey. Production rules obey the following syntax:

symbol := value1 | value2 ...

What this means is the symbol value can only be replaced in any given situation by value1 or value2. This is best explained via an example:

<equation> := <operand><operator><operand>
This simple production rule means that any valid equation in this language must follow the pattern "operand - operator - operand".

The operators and operands must also be defined. Basic examples of definitions might be:

<operator> := + | - | * | /
<operand> := <digit> | <digit><digit>
<digit> := "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "0"

Therefore, we can see a valid equation must be comprised of a one- or two-digit number, an operator, and another one- or two-digit number.

This is, of course, a very basic explanation of EBNF. It is, however, sufficient to pass GCSE and A-Level Information Systems / Computing.

This node is part of the Node your Homework project.

Log in or registerto write something here or to contact authors.