Question
Consider the following grammar:
What is ?
Official answer and solution
- Official answer
- C
- From
- Official GATE 2017 answer key
Solution
Compute using the standard First and Follow set construction rules for context-free grammars.
Given grammar productions:
Non-terminal appears on the right-hand side of .
By the definition of FOLLOW sets, contains everything in except .
Compute and :
Since :
Since does not contain , does not derive . Therefore:
This matches Option C.
Final answer
C
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2017 Computer Science and Information Technology (CS) Session 1
- Question
- 17 of 65, printed as CS Q.17
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.