GATE CS 2015, set 3 · Question 65 · Compiler Design · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer
Consider the following grammar G
S → F | H ; F → p | c ; H → d | c
where S, F, and H are non-terminal symbols, p, d, and c are terminal symbols. Which of the following statement(s) is/are correct?
S1. LL(1) can parse all strings that are generated using grammar G
S2. LR(1) can parse all strings that are generated using grammar G
- (A) Only S1
- (B) Only S2
- (C) Both S1 and S2
- (D) Neither S1 nor S2
Answer
Answer (D)
Answer from the official GATE CS 2015 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes