GATE CS 2021 Set 2 | Question 61

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

  1. Question 61Compiler Designnat2 marks
    Consider the following augmented grammar with as the set of terminals.
    S' -> S
    S  -> S # c S
    S  -> S S
    S  -> S @
    S  -> < S >
    S  -> a
    S  -> b
    S  -> c
    Let . The number of items in the set is ______.

    Answer: 8

    Solution

    Computing gives the item plus the closure on ; taking on again reproduces the same kernel item with its closure, yielding 8 items in total.

More GATE PYQ on Parser

All GATE CS Compiler Design PYQ →

Attempt GATE CS 2021 Set 2 in real GATE exam mode

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

Create free account →