Which one of the following is true?

2020

Which one of the following is true?

  1. A.

    Every regular grammar is LL(1) and every regular set does not have an LR(1) grammar

  2. B.

    Every regular grammar is not LL(1) and every regular set does not have an LR(1) grammar

  3. C.

    Every regular grammar is LL(1) and every regular set has an LR(1) grammar

  4. D.

    Every regular grammar is not LL(1) and every regular set has an LR(1) grammar

Attempted by 79 students.

Show answer & explanation

Correct answer: D


The correct option is D. Not every regular grammar is LL(1) because left-recursion or common prefixes can cause conflicts. However, every regular set (language) can be represented by at least one deterministic, conflict-free LR(1) grammar because regular languages are a strict subset of deterministic context-free languages (DCFLs).

Explore the full course: Niacl Ao It Specialist