GATE CS 2021 (Forenoon) — Question 41

Compiler DesignLexical Analysis & Parsing Architectures (LL(1), LR(1), LALR)MCQ2 marks · −2/3 if wrongHard

Consider the following context-free grammar where the set of terminals is \(\{a, b, c, d, f\}\) \(S \rightarrow daT \mid Rf\) \(T \rightarrow aS \mid baT \mid \epsilon\) \(R \rightarrow caTR \mid \epsilon\) The following is a partially-filled LL(1) parsing table.
Question image
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)?
  1. A
    1 \(S \rightarrow Rf\) 2 \(S \rightarrow Rf\) 3 \(T \rightarrow \epsilon\) 4 \(T \rightarrow \epsilon\)
  2. B
    1 blank 2 \(S \rightarrow Rf\) 3 \(T \rightarrow \epsilon\) 4 \(T \rightarrow \epsilon\)
  3. C
    1 \(S \rightarrow Rf\) 2 blank 3 blank 4 \(T \rightarrow \epsilon\)
  4. D
    1 blank 2 \(S \rightarrow Rf\) 3 blank 4 blank
Practise the full 2021-FN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAWhat rank do your marks get?GATE score, likely All-India Rank and qualifying marks for your category.
Practise more on Lexical Analysis & Parsing Architectures (LL(1), LR(1), LALR)Timed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group