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
Consider the following C statements: char *str1 = "Hello; /* Statement S1 */ char *str2 = "Hello;"; /* Statement S2 */ int *str3 = "Hello"; /* Statement S3 */ Which of the following options is/are correct?
Which of the following statements is/are true?
Consider the control flow graph shown in the figure. Which one of the following options correctly lists the set of redundant expressions (common subexpressions) in the basic blocks B and B? Note: All the variables are integers.
Consider the following two syntax-directed definitions and for type declarations. …
Which of the following grammars is/are ambiguous?
A lexical analyzer uses the following token definitions For the string given below, …
Consider the canonical parsing of the grammar below using terminals and non-terminals with as the start symbol. Which one of the following options gives the …
Consider the control flow graph given below. Which one of the following options is the set of live variables at the exit point of each basic block?
Which ONE of the following statements is FALSE regarding the symbol table?
Which ONE of the following techniques used in compiler code optimization uses live variable analysis?
Which of the following statement(s) is/are TRUE while computing and during top down parsing by a compiler?
Refer to the given -address code sequence. This code sequence is split into basic blocks. The number of basic blocks is ________. (Answer in integer) 1001: i = 1 1002: j = 1 1003: t1 = 10*i 1004: t2 = t1+j 1005: t3 = 8*t2 1006: t4 = t3-88 1007: a[t4] = 0.0 1008: j = j+1 1009: if j <= 10 goto 1003 1010: i = i+1 1011: if i <= 10 goto 1002 1012: i = …
Consider two grammars and with the production rules given below: …
Consider the following statements about the use of backpatching in a compiler for intermediate code generation: Backpatching can be used to generate code for Boolean expression in one pass. Back[atching can be used to generate code for flow-of-control statements in one pass. Which ONE of the folloeing options is CORRECT?
Given the following syntax directed translation rules: Rule 1: Rule 2: Rule 3: Which ONE is the CORRECT option among the following?
Given a Context-Free Grammar as follows: Which ONE of the following statements is TRUE?
Which of the following is/are Bottom-Up Parser(s)?
Consider the operator precedence and associativity rules for the integer arithmetic operators given in the table below. …
Consider the following syntax-directed definition . …
Consider the following pseudo-code. L 1: t1 = -1 L 2: t2 = 0 L 3: t3 = 0 L 4: t4 = 4 * t3 L 5: t5 = 4 * t2 L 6: t6 = t5 * M L 7: t7 = t4 + t6 L 8: t8 = a[t7] L 9: if t8 <= max goto L11 L 10: t1 = t8 L 11: t3 = t3 + 1 L 12: if t3 < M goto L4 L 13: t2 = t2 + 1 L 14: if t2 < N goto L3 L 15: max = t1 Which one of the following options CORRECTLY …
