1
GATE CSE 2003
MCQ (Single Correct Answer)
+2
-0.6

Consider the translation scheme shown below

$$\eqalign{ & S \to TR \cr & R \to + T\left\{ {pr{\mathop{\rm int}} (' + ');} \right\}\,R\,|\,\varepsilon \cr & T \to num\,\left\{ {pr{\mathop{\rm int}} (num.val);} \right\} \cr} $$

Here num is a token that represents an integer and num.val represents the corresponding integer value. For an input string '9 + 5 + 2', this translation scheme will print

A
9 + 5 + 2
B
9 5 + 2 +
C
9 5 2 + +
D
+ + 9 5 2
2
GATE CSE 2003
MCQ (Single Correct Answer)
+2
-0.6

Consider the grammar shown below.

$$\eqalign{ & S \to CC \cr & C \to cC\,|\,d \cr} $$

This grammar is

A
LL(1)
B
SLR(1) but not LL(1)
C
LALR(1) but not SLR(1)
D
LR(1) but not LALR(1)
3
GATE CSE 1995
MCQ (Single Correct Answer)
+2
-0.6

A shift reduce parser carries out the actions specified within braces immediately after reducing with the corresponding rule of grammar.

$$\eqalign{ & S \to xxW\,\left\{ {pr{\mathop{\rm int}} \,'1'} \right\} \cr & S \to y\,\left\{ {pr{\mathop{\rm int}} \,'2'} \right\} \cr & W \to Sz\,\left\{ {pr{\mathop{\rm int}} \,'3'} \right\} \cr} $$

What is the translation of xxxxyzz using the syntax directed translation scheme described by the above rules?

A
23131
B
11233
C
11231
D
33211
4
GATE CSE 1992
MCQ (Single Correct Answer)
+2
-0.6
Consider the SLR(1) and LALR (1) parsing tables for a context-free grammar. Which of the following statements is/are true?
A
The goto part of both tables may be different.
B
The shift entries are identical in both the tables.
C
The reduce entries in the tables may be different.
D
The error entries in the tables may be different.
GATE CSE Subjects
Software Engineering
Web Technologies
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12