Consider the following grammar 𝐺 𝑆 β†’ 𝐹 | 𝐻 𝐹 β†’ 𝑝 | 𝑐 𝐻 β†’ 𝑑 | 𝑐 where…

PYQ GATE 2015

Consider the following grammar 𝐺

𝑆 β†’ 𝐹 | 𝐻

𝐹 β†’ 𝑝 | 𝑐

𝐻 β†’ 𝑑 | 𝑐

where 𝑆, 𝐹, and 𝐻 are non-terminal symbols, 𝑝, 𝑑, and 𝑐 are terminal symbols. Which of the following statement(s) is/are correct?

S1. LL(1) can parse all strings that are generated using grammar 𝐺

S2. LR(1) can parse all strings that are generated using grammar 𝐺

  1. A.

    Only S1

  2. B.

    Only S2

  3. C.

    Both S1 and S2

  4. D.

    Neither S1 nor S2

Attempted by 287 students.

Sign up free to check your answer

Sign up free

Explore the full course: Compiler Design

Loading lesson…