GATE CSE 2024 Session 2 Q65: Number of items in GOTO(I0, S) for an SLR grammar
- Compiler Design
- 2 marks
- NAT
- No negative marking
Question
Consider the following augmented grammar, which is to be parsed with a SLR parser. The set of terminals is
Let . The number of items in the set is ___________
Try it: numerical answer: type the value
Numerical answer. No negative marking.
Show answer and explanation
Answer: 9 (official GATE 2024 final answer key)
Concept used: LR(0) items: GOTO advances the dot over , then the closure adds items for the non-terminal after the dot.
First step: GOTO gives and ; the dot before pulls in all -productions and then the and productions.
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 2024 Session 2 CS question paper and final answer key, organised by IISc Bangalore. 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