GateAI
Parsing

GATE CSE 2014 Set 1 · Q34

MCQ2 marksEasy

Time

A canonical set of items is given below S→L.>RS \rightarrow L. > R Q→R.Q \rightarrow R. On input symbol < the set has

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: D) neither a shift-reduce nor a reduce-reduce conflict.

Parsing

In the given canonical set of LR items:

  1. S→L.>RS \rightarrow L. > R

    • The dot is followed by the terminal symbol $>$. A shift action can only occur on the input symbol $>$, not on $<$.

  2. Q→R.Q \rightarrow R.

    • This is a completed reduce item. A reduction to QQ might be placed in the lookahead set (or FOLLOW(Q)\text{FOLLOW}(Q) for SLR), but for a conflict to occur:

      • A shift-reduce conflict requires both a shift action and a reduce action on the *same* input symbol.

      • A reduce-reduce conflict requires two different reduction actions on the *same* input symbol.

On the input symbol $<$:

  • There is no shift action because the shift item only shifts on symbol $> $.

  • There is at most one reduce action (from Q→R.Q \rightarrow R.), so there is no reduce-reduce conflict.

  • Since there is no shift action on $<$, there is no shift-reduce conflict.

Therefore, on input symbol $<$, the set has neither a shift-reduce nor a reduce-reduce conflict (Option D).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Parsing previous year question is Q34 of the GATE CSE 2014 Set 1 paper. Find more GATE CSE PYQs on Parsing in Compiler Design, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Parsing PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Parsing in GATE CSE

Parsing has 23 GATE CSE PYQs across 16 papers from 2012 to 2026. 11 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2014 Set 1.

How GATE tests Parsing

More from GATE CSE 2014 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2014 Set 1 · Q34 · MCQ

A canonical set of items is given below S → L. > R Q → R. On input symbol < the set has

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.