Exam-style question
Try this first
Why can BNF represent some languages that cannot be represented using regular expressions?.
- A.BNF can use recursive production rules, allowing structures such as arbitrarily nested pairs
- B.BNF always uses fewer symbols than a regular expression
- C.BNF automatically checks whether every character is typed correctly
- D.BNF can represent only languages with a fixed maximum length
Answer and explanation
Concise answer
BNF can use recursive production rules, allowing structures such as arbitrarily nested pairs
Why this is correct
A recursive BNF rule can refer to itself and so describe structures with unlimited nesting, such as balanced parentheses. Regular expressions cannot represent every such language.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
