GATE CS 2024 Set 2 | Question 65

Compiler Design › Parser · NAT · 2 marks · Answer: 9

  1. Question 65Compiler Designnat2 marks
    Augmented grammar: ; ; ; . With , the number of items in is ___________

    Answer: 9

    Solution

    Answer: 9 moves the dot past in every item with , giving and , then closure of re-adds all -, -, -productions:
    S' -> S.          S -> S.S
    S -> .SS   S -> .Aa   S -> .bAc   S -> .Bc   S -> .bBa
    A -> .d#   B -> .@
    That is items.

More GATE PYQ on Parser

All GATE CS Compiler Design PYQ →

Attempt GATE CS 2024 Set 2 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →