logo

AQA A-Level Computer Science practice

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

Try the question first, then check the answer and practise the same topic again.

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

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.

Related flashcards

No flashcards are published for this page yet.

Related practice questions