Subject-wise GATE questions

Compiler Design

10 questions and papers

GATE CS 2020 — Question 10

Multiple choice 1 mark GATE CS — Computer Science & IT 2020

Consider the following statements.S1: Every SLR(1) grammar is unambiguous but there are certain unambiguous grammars that are not SLR(1).S2: For any context-free grammar, there is a parser that…

GATE CS 2019 — Question 41

Numerical answer 2 marks GATE CS — Computer Science & IT 2019

Consider the grammar given below:S → a S B | d B → bThe number of reduction steps taken by a bottom-up parser while accepting the string aaadbbb…

GATE CS 2018 — Question 19

Multiple choice 1 mark GATE CS — Computer Science & IT 2018

Consider the following intermediate program in three address code:p = a - b q = p * c p = u * v q = p + qWhich…

GATE CS 2017 Set 1 — Question 7

Multiple choice 1 mark GATE CS — Computer Science & IT 2017

Consider the following grammar:P → x Q R S Q → y z | z R → w | ε S → yWhat is FOLLOW(Q)?

GATE CS 2016 Set 2 — Question 42

Numerical answer 2 marks GATE CS — Computer Science & IT 2016

The attributes of three arithmetic operators in some programming language are given below.OperatorPrecedenceAssociativityArity+HighLeftBinary−MediumRightBinary*LowLeftBinaryThe value of the expression 2 − 5 + 1 − 7 * 3 in this…

GATE CS 2016 Set 1 — Question 41

Numerical answer 2 marks GATE CS — Computer Science & IT 2016

Consider the following code segment:x = u - t; y = x * v; x = y + w; y = t - z; y = x *…

GATE CS 2015 Set 1 — Question 14

Multiple choice 1 mark GATE CS — Computer Science & IT 2015

Match the following:List-IList-II(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

GATE CS 2005 — Question 58

Multiple choice 2 marks GATE CS — Computer Science & IT 2005

Consider the grammarS → ( S ) | aLet the number of states in the SLR(1), LR(1) and LALR(1) parsers for the grammar be \(n_1\), \(n_2\) and \(n_3\)…

GATE CS 2000 — Question 6

Multiple choice 1 mark GATE CS — Computer Science & IT 2000

The number of tokens in the following C statement is:printf("i = %d, &i = %x", i, &i);