GATE CSE 2019 Q53: Number of items in GOTO(I0, '(') for an LR(0) list grammar
- Compiler Design
- 2 marks
- NAT
- No negative marking
Syllabus topic: Lexical analysis, parsing and syntax-directed translation
Question
Consider the augmented grammar given below:
Let . The number of items in the set is: ________.
Try it: numerical answer: type the value
Show answer and explanation
Answer: 5 (official GATE 2019 final answer key)
Concept used: GOTO(I, X) moves the dot past X in every item of I that has X right after the dot, and then takes the closure, adding items for every non-terminal that now follows a dot.
First step: Take the item from , move the dot past the bracket to get , then add closure items for L and then for S, and count them.
Full step-by-step solution
Loading…
Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.
More questions on Lexical analysis, parsing and syntax-directed translation
Every PYQ on this topic →Share this question
Source: official GATE 2019 CS question paper and final answer key, organised by IIT Madras. 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