Skip to content

GATE CS Compiler Design questions

Practise Compiler Design questions for GATE CS. Explore official PYQs and original subject-wise quizzes, check answers and view available solutions. Free, no sign-in.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

20 on this page
Official PYQ1999Compiler DesignParsing (LL, LR)MCQ · 1 mark
Which of the following is the most powerful parsing method?
Official PYQ1998Compiler DesignRuntime EnvironmentsMCQ · 1 mark
Faster access to non-local variables is achieved using an array of pointers to activation records called a
Official PYQ1998Compiler DesignParsing (LL, LR)MCQ · 1 mark
Type checking is normally done during
Official PYQ1998Compiler DesignRuntime EnvironmentsMCQ · 1 mark
A linker reads four modules whose lengths are 200,800,600200, 800, 600 and 500500 words, respectively. If they are loaded in that order, what are the relocation constants?
Official PYQ1998Compiler DesignParsing (LL, LR)MCQ · 1 mark
Which of the following statements is true?
Official PYQ1998Compiler DesignRuntime EnvironmentsMCQ · 1 mark
In a resident – OS computer, which of the following systems must reside in the main memory under all situations?
Official PYQ1997Compiler DesignRuntime EnvironmentsMCQ · 1 mark
The expression (a∗b)∗c  op…( a * b) * c \; op \dots where ‘op’ is one of ‘++’, ‘∗*’ and ‘↑\uparrow’ (exponentiation) can be evaluated on a CPU with single register without storing the value of (a∗ba * b) if
Official PYQ1997Compiler DesignRuntime EnvironmentsMCQ · 1 mark
Heap allocation is required for languages.
Official PYQ1997Compiler DesignLexical AnalysisMCQ · 1 mark
The conditional expansion facility of macro processor is provided to
Official PYQ1997Compiler DesignRuntime EnvironmentsMCQ · 1 mark
A language LL allows declaration of arrays whose sizes are not known during compilation. It is required to make efficient use of memory. Which one of the following is true?
Official PYQ1997Compiler DesignParsing (LL, LR)MCQ · 1 mark
In the following grammar X::=X⊕Y∣YX ::= X \oplus Y \mid Y Y::=Z∗Y∣ZY::= Z * Y \mid Z Z::=idZ::= id Which of the following is true?
Official PYQ1996Compiler DesignRuntime EnvironmentsMCQ · 1 mark
The correct matching for the following pairs is …
Official PYQ1996Compiler DesignLexical AnalysisMCQ · 1 mark
Which of the following macros can put a macro assembler into an infinite loop? .MACRO M1, X .IF EQ, X ;if X=0 then M1 X + 1 .ENDC .IF NE, X ;if X ≠ O then .WORD X ;address (X) is stored here .ENDC .ENDM .MACRO M2, X .IF EQ, X M2 X .ENDC .IF NE, X .WORD X + 1 .ENDC .ENDM
Official PYQ1996Compiler DesignParsing (LL, LR)MCQ · 1 mark
The grammar whose productions are ⟨stmt⟩→ if id then ⟨stmt⟩\langle\text{stmt}\rangle \to\text{ if id then } \langle\text{stmt}\rangle ⟨stmt⟩→ if id then ⟨stmt⟩ else ⟨stmt⟩\langle\text{stmt}\rangle\to\text{ if id then } \langle\text{stmt}\rangle\text{ else } \langle\text{stmt}\rangle ⟨stmt⟩→ id := id\langle\text{stmt}\rangle \to\text{ id }:=\text{ id} is ambiguous because if a then if b then c:= d has more than two parse …
Official PYQ1996Compiler DesignLexical AnalysisMCQ · 1 mark
The pass numbers for each of the following activities object code generation literals added to literal table listing printed address resolution of local symbols that occur in a two pass assembler respectively are
Official PYQ1995Compiler DesignSyntax-directed TranslationMCQ · 1 mark
A shift reduce parser carries out the actions specified within braces immediately after reducing with the corresponding rule of grammar S→xxW  print“1"S \rightarrow xxW \;\text{{print“1"}} S→y  print“2"S \rightarrow y \;\text{{print“2"}} W→Sz  print“3"W \rightarrow Sz\; \text{{print“3"}} What is the translation of xxxxyzzxxxxyzz using the syntax directed translation scheme described by the …
Official PYQ1995Compiler DesignRuntime EnvironmentsMCQ · 1 mark
What is the value of XX printed by the following program? program COMPUTE (input, output); var X:integer; procedure FIND (X:real); begin X:=sqrt(X); end; begin X:=2 FIND(X); writeln(X); end.
Official PYQ1995Compiler DesignRuntime EnvironmentsMCQ · 1 mark
A linker is given object modules for a set of programs that were compiled separately. What information need not be included in an object module?
Official PYQ1995Compiler DesignLexical AnalysisMCQ · 1 mark
What are xx and yy in the following macro definition? macro Add x, y Load y Mul x Store y end macro
Official PYQ1995Compiler DesignParsing (LL, LR)MCQ · 1 mark
Consider a grammar with the following productions S→aαb∣bαc∣aBS \rightarrow a \alpha b \mid b \alpha c \mid aB S→αS∣bS \rightarrow \alpha S\mid b S→αbb∣abS \rightarrow \alpha b b\mid ab Sα→bdb∣bS \alpha \rightarrow bd b\mid b The above grammar is: