GATE CSE 2021 Set 1 Q41: Fill the blank cells of an LL(1) parsing table
- Compiler Design
- 2 marks
- MCQ
- −2/3 if wrong
Question
Consider the following context-free grammar where the set of terminals is .
The following is a partially-filled LL(1) parsing table.
Which one of the following choices represents the correct combination for the numbered cells in the parsing table ("blank" denotes that the corresponding cell is empty)?
| \$ | ||||||
|---|---|---|---|---|---|---|
| S | (1) | (2) | ||||
| T | (3) | (4) | ||||
| R |
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: A (official GATE 2021 final answer key)
Concept used: LL(1) table: put under FIRST(), and under FOLLOW() when can derive .
First step: FIRST() . For , compute FOLLOW() from and .
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2021 Set 1 CS question paper and final answer key, organised by IIT Bombay. Question paper · Answer key
More Compiler Design PYQs
- 2026 Session 1 · Q27Classify errors in three C string declarations
- 2026 Session 1 · Q28True statements about LL(1) parsing
- 2026 Session 1 · Q42Redundant (common) subexpressions in blocks B4 and B5 of a CFG
- 2026 Session 1 · Q53Compare two SDDs for type declarations
- 2026 Session 2 · Q35Count tokens produced by a lexer for a given string
- 2026 Session 2 · Q41Shift-reduce conflicts in the LR(0) table of a grammar