Consider the following grammar G: S → A | B A → a | c B → b | c Where {S, A,…

Consider the following grammar G:

S → A | B
A → a | c
B → b | c

Where {S, A, B} is the set of non-terminals and {a, b, c} is the set of terminals.

Which of the following statement(s) is/are correct?

S₁: LR(1) can parse all strings that are generated using grammar G.

S₂: LL(1) can parse all strings that are generated using grammar G.

Choose the correct answer:

  1. A.

    Only S₁

  2. B.

    Only S₂

  3. C.

    Both S₁ and S₂

  4. D.

    Neither S₁ nor S₂

Attempted by 37 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…