Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Webpage for Compiler Design:
Recent questions tagged compiler-design
23
votes
2
answers
1831
GATE CSE 2004 | Question: 88
Consider the following grammar G: $S \rightarrow bS \mid aA \mid b$ $A \rightarrow bA \mid aB$ $B \rightarrow bB \mid aS \mid a$ Let $N_a(w)$ and $N_b(w)$ denote the number of a's and b's in a string $\omega$ respectively. The language $L(G)$ ... $\left\{w \mid N_b(w) = 3k, k \in \left\{0, 1, 2, \right\}\right\}$
Kathleen
asked
in
Compiler Design
Sep 19, 2014
by
Kathleen
5.3k
views
gatecse-2004
compiler-design
grammar
normal
29
votes
2
answers
1832
GATE CSE 2004 | Question: 45
Consider the grammar with the following translation rules and $E$ ... root of the parse tree for the expression:$2$ # $3$ & $5$ # $6$ & $4$ $200$ $180$ $160$ $40$
Kathleen
asked
in
Compiler Design
Sep 19, 2014
by
Kathleen
8.9k
views
gatecse-2004
compiler-design
grammar
normal
28
votes
2
answers
1833
GATE CSE 2004 | Question: 9
Consider a program $P$ that consists of two source modules $M_1$ and $M_2$ contained in two different files. If $M_1$ contains a reference to a function defined in $M_2$ the reference will be resolved at Edit time Compile time Link time Load time
Kathleen
asked
in
Compiler Design
Sep 19, 2014
by
Kathleen
5.0k
views
gatecse-2004
compiler-design
easy
linker
21
votes
2
answers
1834
GATE CSE 2004 | Question: 8
Which of the following grammar rules violate the requirements of an operator grammar? $P, Q, R$ are nonterminals, and $r, s, t$ are terminals. $P \rightarrow Q R$ $P \rightarrow Q s R$ $P \rightarrow \: \varepsilon$ $P \rightarrow Q t R r $ (I) only (I) and (III) only (II) and (III) only (III) and (IV) only
Kathleen
asked
in
Compiler Design
Sep 19, 2014
by
Kathleen
9.0k
views
gatecse-2004
compiler-design
grammar
normal
30
votes
5
answers
1835
GATE CSE 2004 | Question: 2,ISRO2017-54
Consider the following function void swap(int a, int b) { int temp; temp = a; a = b; b = temp; } In order to exchange the values of two variables $x$ and $y$. call $swap(x, y)$ call $swap(\&x, \&y)$ $swap (x, y)$ cannot be used as it does not return any value $swap (x, y)$ cannot be used as the parameters are passed by value
Kathleen
asked
in
Compiler Design
Sep 19, 2014
by
Kathleen
9.5k
views
gatecse-2004
compiler-design
programming-in-c
parameter-passing
easy
isro2017
runtime-environment
59
votes
4
answers
1836
GATE CSE 2006 | Question: 32, ISRO2016-35
Consider the following statements about the context free grammar $G = \left \{ S \rightarrow SS, S \rightarrow ab, S \rightarrow ba, S \rightarrow \epsilon \right \} $ $G$ is ambiguous $G$ produces all strings with equal number of $a$'s ... combination below expresses all the true statements about $G$? I only I and III only II and III only I, II and III
Rucha Shelke
asked
in
Compiler Design
Sep 18, 2014
by
Rucha Shelke
24.8k
views
gatecse-2006
compiler-design
context-free-language
normal
isro2016
51
votes
4
answers
1837
GATE CSE 2003 | Question: 76
Which of the following is NOT an advantage of using shared, dynamically linked libraries as opposed to using statistically linked libraries? Smaller sizes of executable files Lesser overall page fault rate in the system Faster program startup Existing programs need not be re-linked to take advantage of newer versions of libraries
Kathleen
asked
in
Compiler Design
Sep 17, 2014
by
Kathleen
13.6k
views
gatecse-2003
compiler-design
runtime-environment
linker
easy
36
votes
5
answers
1838
GATE CSE 2003 | Question: 73
The following program fragment is written in a programming language that allows global variables and does not allow nested declarations of functions. global int i=100, j=5; void P(x) { int i=10; print(x+10); i=200; j=20; print (x); } main() {P(i ... by need parameter passing mechanism, the values printed by the above program are: $115, 220$ $25, 220$ $25, 15$ $115, 105$
Kathleen
asked
in
Programming
Sep 17, 2014
by
Kathleen
7.0k
views
gatecse-2003
compiler-design
normal
runtime-environment
parameter-passing
31
votes
4
answers
1839
GATE CSE 2003 | Question: 59
Consider the syntax directed definition shown below. ... $t_1 = Y+Z; X=t_1$ $t_1 =Y; t_2=t_1 +Z; X=t_2$ $t_1 =Y; t_2=Z; t_3=t_1+t_2; X=t_3$
Kathleen
asked
in
Compiler Design
Sep 17, 2014
by
Kathleen
6.7k
views
gatecse-2003
compiler-design
target-code-generation
normal
38
votes
3
answers
1840
GATE CSE 2003 | Question: 58
Consider the translation scheme shown below. $S \rightarrow T\;R$ $R \rightarrow + T \{\text{print}( +');\} R\mid \varepsilon$ $T \rightarrow$ num $\{\text{print}$(num.val)$;\}$ Here num is a token that represents an integer and num.val represents the corresponding integer value. For an ... scheme will print $9 + 5 + 2$ $9 \ 5 + 2 +$ $9 \ 5 \ 2 + +$ $+ + 9 \ 5 \ 2$
Kathleen
asked
in
Compiler Design
Sep 17, 2014
by
Kathleen
10.2k
views
gatecse-2003
compiler-design
grammar
normal
37
votes
3
answers
1841
GATE CSE 2003 | Question: 57
Consider the grammar shown below. $S \rightarrow C \ C$ $C \rightarrow c \ C \mid d$ This grammar is LL(1) SLR(1) but not LL(1) LALR(1) but not SLR(1) LR(I) but not LALR(1)
Kathleen
asked
in
Compiler Design
Sep 17, 2014
by
Kathleen
16.3k
views
gatecse-2003
compiler-design
grammar
parsing
normal
30
votes
3
answers
1842
GATE CSE 2003 | Question: 56
Consider the grammar shown below $S \rightarrow i E t S S' \mid a$ $S' \rightarrow e S \mid \epsilon$ $E \rightarrow b$ In the predictive parse table, $M,$ of this grammar, the entries $M[S' , e]$ and $M[S' , \$]$ respectively are $\{S' \ ... $\{S' \rightarrow \epsilon\}$ $\{S' \rightarrow e S, S' \rightarrow \varepsilon$} and $\{S' \rightarrow \epsilon\}$
Kathleen
asked
in
Compiler Design
Sep 17, 2014
by
Kathleen
10.4k
views
gatecse-2003
compiler-design
grammar
normal
parsing
69
votes
9
answers
1843
GATE CSE 2003 | Question: 18
In a bottom-up evaluation of a syntax directed definition, inherited attributes can always be evaluated be evaluated only if the definition is L-attributed be evaluated only if the definition has synthesized attributes never be evaluated
Kathleen
asked
in
Compiler Design
Sep 16, 2014
by
Kathleen
29.8k
views
gatecse-2003
compiler-design
syntax-directed-translation
normal
25
votes
4
answers
1844
GATE CSE 2003 | Question: 17
Assume that the SLR parser for a grammar G has $n_1$ states and the LALR parser for G has $n_2$ states. The relationship between $n_1$ and $n_2$ is $n_1$ is necessarily less than $n_2$ $n_1$ is necessarily equal to $n_2$ $n_1$ is necessarily greater than $n_2$ None of the above
Kathleen
asked
in
Compiler Design
Sep 16, 2014
by
Kathleen
9.2k
views
gatecse-2003
compiler-design
parsing
easy
62
votes
10
answers
1845
GATE CSE 2003 | Question: 16
Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar? Removing left recursion alone Factoring the grammar alone Removing left recursion and factoring the grammar None of the above
Kathleen
asked
in
Compiler Design
Sep 16, 2014
by
Kathleen
23.1k
views
gatecse-2003
compiler-design
parsing
easy
28
votes
6
answers
1846
GATE CSE 2006 | Question: 7
Consider the following grammar $S \rightarrow S * E$ $S \rightarrow E$ $E \rightarrow F + E$ $E \rightarrow F$ $F \rightarrow id$ Consider the following LR(0) items corresponding to the grammar above $S \rightarrow S *.E$ $E \rightarrow F. + E$ ... will appear in the same set in the canonical sets-of-items for the grammar? i and ii ii and iii i and iii None of the above
Rucha Shelke
asked
in
Compiler Design
Sep 16, 2014
by
Rucha Shelke
9.2k
views
gatecse-2006
compiler-design
parsing
normal
25
votes
1
answer
1847
GATE CSE 2002 | Question: 22
Construct all the parse trees corresponding to $i + j * k$ for the grammar $E \rightarrow E+E$ $E \rightarrow E*E$ $E \rightarrow id$ In this grammar, what is the precedence of the two operators $*$ and $+$? If only one parse tree is desired for any string in the same language, what changes are to be made so that the resulting LALR(1) grammar is unambiguous?
Kathleen
asked
in
Compiler Design
Sep 16, 2014
by
Kathleen
3.0k
views
gatecse-2002
compiler-design
parsing
normal
descriptive
27
votes
5
answers
1848
GATE CSE 2002 | Question: 2.19
To evaluate an expression without any embedded function calls One stack is enough Two stacks are needed As many stacks as the height of the expression tree are needed A Turing machine is needed in the general case
Kathleen
asked
in
Compiler Design
Sep 16, 2014
by
Kathleen
7.5k
views
gatecse-2002
compiler-design
expression-evaluation
easy
19
votes
2
answers
1849
GATE CSE 2001 | Question: 18
Remove left-recursion from the following grammar: $S \rightarrow Sa \mid Sb \mid a \mid b$ Consider the following grammar: $S \rightarrow aSbS\mid bSaS \mid ∊$ Construct all possible parse trees for the string abab. Is the grammar ambiguous?
Kathleen
asked
in
Compiler Design
Sep 15, 2014
by
Kathleen
3.0k
views
gatecse-2001
compiler-design
grammar
descriptive
8
votes
1
answer
1850
GATE CSE 2001 | Question: 17
The syntax of the repeat-until statement is given by the following grammar $S \rightarrow\text{ repeat }S_1\text{ until }E$ where E stands for expressions, $S$ and $S_1$ stand for statements. The non-terminals $S$ and $S_1$ have an ... statement. Use the operator '\\' to concatenate two strings and the function gen(s) to generate a line containing the string s.
Kathleen
asked
in
Compiler Design
Sep 15, 2014
by
Kathleen
1.5k
views
gatecse-2001
compiler-design
syntax-directed-translation
normal
descriptive
23
votes
2
answers
1851
GATE CSE 2001 | Question: 16
Consider the following grammar with terminal alphabet $\Sigma =\{a,(,),+,* \}$ and start symbol $E$. The production rules of the grammar are: $ E \rightarrow aA$ $ E \rightarrow (E)$ $A \rightarrow +E$ $A \rightarrow *E$ $A \rightarrow \epsilon $ Compute the FIRST and FOLLOW sets for $E$ and $A$. Complete the LL(1) parse table for the grammar.
Kathleen
asked
in
Compiler Design
Sep 15, 2014
by
Kathleen
3.9k
views
gatecse-2001
compiler-design
parsing
normal
descriptive
23
votes
4
answers
1852
GATE CSE 2001 | Question: 2.17 | UGCNET-AUG2016-III: 21
What is printed by the print statements in the program $P1$ assuming call by reference parameter passing? Program P1() { x = 10; y = 3; func1(y,x,x); print x; print y; } func1(x,y,z) { y = y + 4; z = x + y + z } $\text{10, 3}$ $\text{31, 3}$ $\text{27, 7}$ None of the above
Kathleen
asked
in
Programming
Sep 15, 2014
by
Kathleen
9.3k
views
gatecse-2001
programming
compiler-design
parameter-passing
normal
runtime-environment
ugcnetcse-aug2016-paper3
36
votes
6
answers
1853
GATE CSE 2001 | Question: 1.18
Which of the following statements is false? An unambiguous grammar has same leftmost and rightmost derivation An LL(1) parser is a top-down parser LALR is more powerful than SLR An ambiguous grammar can never be LR(k) for any k
Kathleen
asked
in
Compiler Design
Sep 14, 2014
by
Kathleen
14.4k
views
gatecse-2001
compiler-design
grammar
normal
35
votes
1
answer
1854
GATE CSE 2001 | Question: 1.17
The process of assigning load addresses to the various parts of the program and adjusting the code and the data in the program to reflect the assigned addresses is called Assembly parsing Relocation Symbol resolution
Kathleen
asked
in
Compiler Design
Sep 14, 2014
by
Kathleen
11.0k
views
gatecse-2001
compiler-design
runtime-environment
easy
16
votes
3
answers
1855
GATE CSE 2000 | Question: 19
Consider the syntax directed translation scheme $\textsf{(SDTS)}$ ... given, without changing the grammar, to find $E.red$, the number of reductions performed while reducing an input to $E$.
Kathleen
asked
in
Compiler Design
Sep 14, 2014
by
Kathleen
5.9k
views
gatecse-2000
compiler-design
syntax-directed-translation
normal
descriptive
26
votes
6
answers
1856
GATE CSE 2000 | Question: 2.21, ISRO2015-24
Given the following expression grammar: $\begin{align} E &\to E * F \mid F + E \mid F \\[1em] F &\to F - F \mid id \end{align}$ Which of the following is true? $*$ has higher precedence than $+$ $-$ has higher precedence than $*$ $+$ and $-$ have same precedence $+$ has higher precedence than $*$
Kathleen
asked
in
Compiler Design
Sep 14, 2014
by
Kathleen
8.7k
views
gatecse-2000
operator-precedence
normal
compiler-design
isro2015
21
votes
5
answers
1857
GATE CSE 2000 | Question: 1.19, UGCNET-Dec2013-II: 30
Which of the following derivations does a top-down parser use while parsing an input string? The input is scanned from left to right. Leftmost derivation Leftmost derivation traced out in reverse Rightmost derivation Rightmost derivation traced out in reverse
Kathleen
asked
in
Compiler Design
Sep 14, 2014
by
Kathleen
6.4k
views
gatecse-2000
compiler-design
parsing
normal
ugcnetcse-dec2013-paper2
36
votes
7
answers
1858
GATE CSE 2000 | Question: 1.18, ISRO2015-25
The number of tokens in the following C statement is printf("i=%d, &i=%x", i, &i); $3$ $26$ $10$ $21$
Kathleen
asked
in
Compiler Design
Sep 14, 2014
by
Kathleen
32.2k
views
gatecse-2000
compiler-design
compiler-tokenization
easy
isro2015
14
votes
1
answer
1859
GATE CSE 1992 | Question: 11a
Write syntax directed definitions (semantic rules) for the following grammar to add the type of each identifier to its entry in the symbol table during semantic analysis. Rewriting the grammar is not permitted and semantic rules are to be added to the ends of productions ... $T \rightarrow \text{int}$ $T \rightarrow \text{real}$ $L \rightarrow L,id$ $L \rightarrow id$
Kathleen
asked
in
Compiler Design
Sep 13, 2014
by
Kathleen
2.4k
views
gate1992
compiler-design
syntax-directed-translation
normal
descriptive
16
votes
1
answer
1860
GATE CSE 1992 | Question: 03,ii
Mention the pass number for each of the following activities that occur in a two pass assembler: object code generation literals added to literal table listing printed address resolution of local symbols
Kathleen
asked
in
Compiler Design
Sep 13, 2014
by
Kathleen
3.4k
views
gate1992
compiler-design
assembler
easy
match-the-following
Page:
« prev
1
...
57
58
59
60
61
62
63
next »
Subscribe to GATE CSE 2023 Test Series
Subscribe to GO Classes for GATE CSE 2023
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
GATE CSE 2023 Paper & Analysis - Memory Based
From GATE to Australia
DRDO Previous Year Papers
From Rank 4200 to 64: My Journey to Success in GATE CSE Exam
What are the key things to focus on during the final 10-15 days before the GATE exam to improve performance?
Subjects
All categories
General Aptitude
(2.5k)
Engineering Mathematics
(9.3k)
Digital Logic
(3.3k)
Programming and DS
(5.9k)
Algorithms
(4.6k)
Theory of Computation
(6.7k)
Compiler Design
(2.3k)
Operating System
(5.0k)
Databases
(4.6k)
CO and Architecture
(3.8k)
Computer Networks
(4.6k)
Non GATE
(1.3k)
Others
(2.4k)
Admissions
(649)
Exam Queries
(842)
Tier 1 Placement Questions
(17)
Job Queries
(75)
Projects
(9)
Unknown Category
(853)
Recent questions tagged compiler-design
Recent Blog Comments
1200/1000 = 1.2
Aptitude- 1- there was a question, Like in a...
Suppose typing happens at 1 keystroke per second....
The algorithm for graph colouring was to pick...
@Aakash_Bhardwaj all the best bro . For your...