BNF notation
Backus-Naur Form is a formal notation for specifying grammar rules and syntax of languages. BNF defines context-free grammars enabling formal language specification. Productions rules show how non-terminals expand into terminal and non-terminal symbols. BNF enables parser construction and language documentation.
Real World
The Python language specification uses BNF-style grammar rules to define valid syntax, so tools like PyCharm can instantly underline invalid code as you type.
Exam Focus
When writing BNF, ensure every non-terminal on the right-hand side has its own production rule defined somewhere.
How well did you know this?