Compiler Design GATE previous year questions with answer
Ques 14 Gate 2019
Consider the augmented grammar given below:
S → ⏐id
L → L, S⏐S
Let I0= CLOSURE ({[S′ → S]}).
The number of items in the set GOTO (I0, <) is __________.
Ques 15 Gate 2017 Set-2
Which of the following statements about the parser is/are correct?
I. Canonical LR is more powerful than SLR.
II. SLR is more powerful than LALR.
III. SLR is more powerful than canonical LR.
Ques 16 Gate 2017 Set-2
Match the following according to input(from the left column) to the compiler phase(in the right column) that process it:
| (P)Syntax Tree | (i)Code generator |
| (Q)Character Stream | (ii)Syntax analyser |
| (R)Intermediate representation | (iii)Semantic analyser |
| (S)Token stream | (iv)Lexical analyser |
Ques 17 Gate 2016 Set-2
Match the following
| (P) Lexical analysis | (i)Leftmost derivation |
| (Q) Top down parsing | (ii) Type checking |
| (R) Semantic analysis | (iii) Regular expressions |
| (S) Runtime environments | (iv) Activation records |
Ques 18 Gate 2016 Set-1
Consider the following code segment.
y = x * v;
x = y + w;
y = t - z;
y = x * y;
The minimum number of total variables required to convert the above code segment to static single assignment form is ____
Ques 19 Gate 2016 Set-1
Consider the following Syntax Directed Translation Scheme (SDTS), with non-terminals
{S, A} and terminals {a, b}.
S −→ a { print 2 }
A −→ Sb { print 3 }
Using the above SDTS, the output printed by a bottom-up parser, for the input aab is:
Ques 20 Gate 2015 Set-3
Consider the following grammar G.
S → F ⎪ H
F → p ⎪ c
H → d ⎪ c
Where S, F and H are non-terminal symbols, p, d and c are terminal symbols. Which of the following statement(s) is/are correct?
S1: LL(1) can parse all strings that are generated using grammar G.
S2: LR(1) can parse all strings that are generated using grammar G.
Ques 21 Gate 2015 Set-3
Among simple LR (SLR), canonical LR, and look-ahead LR (LALR), which of the following pairs identify the method that is very easy to implement and the method that is the most powerful, in that order?
Ques 22 Gate 2015 Set-2
In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is True?
Ques 23 GATE 2015 SET-2
Match the following:

Total Unique Visitors