logo

Question detail

Why can BNF represent some languages that cannot be represented using regular expressions?

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Context-free languages

Exam-style question

Try this first

Why can BNF represent some languages that cannot be represented using regular expressions?.

  1. A.BNF can use recursive production rules, allowing structures such as arbitrarily nested pairs
  2. B.BNF always uses fewer symbols than a regular expression
  3. C.BNF automatically checks whether every character is typed correctly
  4. D.BNF can represent only languages with a fixed maximum length

Model answer

What a good answer should say

  • BNF can use recursive production rules, allowing structures such as arbitrarily nested pairs

Explanation

Why this works

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.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.