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 CFG with as the non-terminal alphabet, as the terminal alphabet, as the start symbol and the following set of production rules: For …
Consider the CFG with as the non-terminal alphabet, as the terminal alphabet, as the start symbol and the following set of production rules: Which …
Consider the following two statements: P: Every regular grammar is LL(1) Q: Every regular set has a LR(1) grammar Which of the following is TRUE?
Consider the grammar with non-terminals , terminals , with as the start symbol, and the following set of rules: The grammar is NOT LL(1) because:
Which one of the following is a top-down parser?
The grammar generates the language . In this grammar what is the length of the derivation (number of steps starting from ) to generate the string with
Which one of the following grammars generates the language ?
Consider the following C code segment. for (i = 0, i < n; i++) { for (j = 0; j < n; j++) { if (i%2) { x += (4*j + 5*i); y += (7 + 4*j); } } } Which one of the following is false?
Consider the following translation scheme. Here is a token that represents an integer and …
Consider these two functions and two statements S1 and S2 about them. int work1(int *a, int i, int j) { int x = a[i+2]; a[j] = x+1; return a[i+2] - 3; } int work2(int *a, int i, int j) { int t1 = i+2; int t2 = a[t1]; a[j] = t2+1; return t2 - 3; } S1: The transformation form work1 to work2 is valid, i.e., for any program state and input arguments, work2 will …
Consider the following statements about the context free grammar is ambiguous produces all strings with equal number of ’s and ’s can be accepted by a deterministic PDA. Which combination below expresses all the true statements …
Consider the following grammar Consider the following LR(0) items corresponding to the grammar above Given the items above, which two of them will appear in the same set in the …
Consider the following expression grammar. The semantic rules for expression evaluation are stated next to each grammar production. …
Consider line number of the following C-program. int main() { /*Line 1 */ int I, N; /*Line 2 */ fro (I=0, I<N, I++); /*Line 3 */ } Identify the compiler’s response about this line while creating the object-module:
Statement for Linked Answer Questions 83a & 83b: Consider the following expression grammar. The semantic rules for expression evaluation are stated next to each grammar production. …
Consider the grammar: Let the number of states in SLR (1), LR(1) and LALR(1) parsers for the grammar be and respectively. The following relationship holds good:
Consider the grammar: For a sentence , the handles in the right-sentential form of the reduction are:
The grammar is not suitable for predictive-parsing because the grammar is:
Consider the grammar rule for arithmetic expressions. The code generated is targeted to a CPU having a single user register. The subtraction operation requires the first operand to be in the register. If and do not have any common sub expression, in order to get the shortest possible code
Consider the following grammar G: Let and denote the number of a’s and b’s in a string respectively. The language over generated by is
