GATE CS 2017 (Afternoon) — Question 32

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

Consider the following expression grammar G : \(E \rightarrow E - T \mid T\) \(T \rightarrow T + F \mid F\) \(F \rightarrow (E) \mid \text{id}\) Which of the following grammars is not left recursive, but is equivalent to G?
  1. A
    \(E \rightarrow E - T \mid T\) \(T \rightarrow T + F \mid F\) \(F \rightarrow (E) \mid \text{id}\)
  2. B
    \(E \rightarrow TE'\) \(E' \rightarrow -TE' \mid \epsilon\) \(T \rightarrow T + F \mid F\) \(F \rightarrow (E) \mid \text{id}\)
  3. C
    \(E \rightarrow TX\) \(X \rightarrow -TX \mid \epsilon\) \(T \rightarrow FY\) \(Y \rightarrow +FY \mid \epsilon\) \(F \rightarrow (E) \mid \text{id}\)
  4. D
    \(E \rightarrow TX \mid (TX)\) \(X \rightarrow -TX \mid +TX \mid \epsilon\) \(T \rightarrow \text{id}\)
Practise the full 2017-AN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAFree All-India Mock — every SundayA full GATE CS paper, exactly 180 minutes, ranked across India with your GATE score.
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