Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Compiler Design:
Recent questions tagged compiler-design
1
votes
1
answer
1291
Compiler Design #2
Consider translation rules : S → S1 * A {S. Val = S1. Val + A. Val} /A {S. Val = A. Val} A → A1 – B {A. Val = A1. Val – B. Val} /B {A. Val = B. Val} B → C | B1 {B. Val = C. Val / B1. Val} /C {B. Val = C. Val} C → id {C. Val = Id. Val} Let say output for input 8/4 * 2 – 6 * 4 is a1 and output for input 6 * 2 / 1 – 2 * 3 is a2, then a1 – a2 is ___________.
Consider translation rules : S → S1 * A{S. Val = S1. Val + A. Val}/A{S. Val = A. Val}A → A1 – B{A. Val = A1. Val – B. Val}/B{A. Val = B. Val}B → C | B1{B. Val =...
vishwa ratna
741
views
vishwa ratna
asked
Jan 18, 2017
Compiler Design
compiler-design
syntax-directed-translation
expression-evaluation
numerical-answers
+
–
5
votes
2
answers
1292
Compiler Design
How to do this type of QUESTIONS? Consider following grammar : S → S1 + A | A A → D – A | D D → D1 * B | B B → num The number of internal nodes for the parse tree for 5 * 4 + 10 * 6 – 7 – 8
How to do this type of QUESTIONS?Consider following grammar : S → S1 + A | A A → D – A | D D → D1 * B | B B → num The number of internal nodes for the parse tre...
vishwa ratna
2.7k
views
vishwa ratna
asked
Jan 18, 2017
Compiler Design
compiler-design
grammar
parsing
numerical-answers
+
–
0
votes
1
answer
1293
compilers syllabus doubt
is DAG in compiler syllabus?
is DAG in compiler syllabus?
sushmita
655
views
sushmita
asked
Jan 18, 2017
Compiler Design
compiler-design
gate2017
syllabus
+
–
1
votes
0
answers
1294
MEMORY ALLOCATION
HOW STATIC MEMORY ALLOCATION MANAGES FUNCTIONS CALL? WHERE ARE ACTIVATION RECORDS STORED IN STATIC MEMORY ALLOCATION?
HOW STATIC MEMORY ALLOCATION MANAGES FUNCTIONS CALL?WHERE ARE ACTIVATION RECORDS STORED IN STATIC MEMORY ALLOCATION?
sushmita
588
views
sushmita
asked
Jan 18, 2017
Compiler Design
compiler-design
memory-management
+
–
0
votes
0
answers
1295
CALL BY REFERENCE AND CALL BY NAME
foo(a, b, c) { b =b++; a = a++; c = a + b*10 } X=1; Y=2; Z=3; foo(X, Y+2, Z); CAN SOMEONE PLEASE TELL THE OUTPUTS FOR CALL BY REFERENCE AND CALL BY NAME. WHAT IS THE DIFERENCE BETWEEN CALL BY NAME AND CALL BY REFERENCE??
foo(a, b, c) { b =b++; a = a++; c = a + b*10 } X=1; Y=2; Z=3; foo(X, Y+2, Z);CAN SOMEONE PLEASE TELL THE OUTPUTS FOR CALL BY REFERENCE AND CALL BY NAME. WHAT IS THE DIFER...
sushmita
866
views
sushmita
asked
Jan 18, 2017
Compiler Design
programming
parameter-passing
compiler-design
+
–
0
votes
1
answer
1296
Activation Record
Activation Record can be known at A. Compile Time B. Run Time C. Loading Time D. None of these
Activation Record can be known atA. Compile TimeB. Run TimeC. Loading TimeD. None of these
Samujjal Das
1.5k
views
Samujjal Das
asked
Jan 17, 2017
Compiler Design
compiler-design
runtime-environment
+
–
1
votes
1
answer
1297
COMPILERS DOUBT
IS EVERY LL(1) GRAMMAR LALR(1)?? I DONT KNOW WHETHER ITS TRUE OR NOT? CAN SOMEONE EXPLAIN??
IS EVERY LL(1) GRAMMAR LALR(1)?? I DONT KNOW WHETHER ITS TRUE OR NOT?CAN SOMEONE EXPLAIN??
sushmita
482
views
sushmita
asked
Jan 17, 2017
Compiler Design
compiler-design
parsing
ll-parser
lr-parser
+
–
0
votes
0
answers
1298
Compiler Design
I have 3 doubts 1. How to check a grammar is LL(k) where k can be any positive number is it same as LL(1) and look ahead don't matter but it does matters in case of LR(k) where LR(0)⊆ LR(k) 2. are all DCFL's can be parsed? 3. what is the efficiency of different parsers best and worst case and average case. Is it true that top down does detect error faster?
I have 3 doubts1. How to check a grammar is LL(k) where k can be any positive number is it same as LL(1) and look ahead don't matter but it does matters in case of LR(k)...
Pankaj Joshi
149
views
Pankaj Joshi
asked
Jan 16, 2017
Compiler Design
compiler-design
+
–
2
votes
1
answer
1299
Test by Bikram | Mock GATE | Test 1 | Question: 47
For the given grammar consider the statements: $S' \rightarrow S$ $S \rightarrow aAd \mid bBd \mid aBe \mid bAe$ $A \rightarrow c$ $B \rightarrow c$ Which of the following statement is/are true? S1: The given grammar is LR(l). S2: On merger the grammar will generate reduce reduce conflict. Only S1 Only S2 Both S1 and S2 None of S1 and S2
For the given grammar consider the statements:$S' \rightarrow S$$S \rightarrow aAd \mid bBd \mid aBe \mid bAe$$A \rightarrow c$$B \rightarrow c$Which of the following...
Bikram
691
views
Bikram
asked
Jan 16, 2017
GATE
tbb-mockgate-1
grammar
compiler-design
+
–
1
votes
1
answer
1300
Test by Bikram | Mock GATE | Test 1 | Question: 35
What will be the resulting grammar after removal of left-recursion from the following grammar? $E$ $\rightarrow$ $Ea $|$ Eb $|$ a $|$ b$ $E$\rightarrow$ $aE'$|$ bE'$ ; $E$'$\rightarrow$ $aE'$ $|$ $bE'$ | $\epsilon$ $ ... ;$ |$\epsilon$ $E$\rightarrow$ $aE' $|$ bE'$; $E'$ $\rightarrow$ $a$ | $b$ $|$ $\epsilon$
What will be the resulting grammar after removal of left-recursion from the following grammar?$E$ $\rightarrow$ $Ea $|$ Eb $|$ a $|$ b$$E$$\rightarrow$ $aE'$|$ bE'$ ; ...
Bikram
315
views
Bikram
asked
Jan 16, 2017
GATE
tbb-mockgate-1
grammar
compiler-design
+
–
0
votes
1
answer
1301
Test by Bikram | Mock GATE | Test 1 | Question: 34
Consider the following grammar for Boolean expression: $E$ $\rightarrow$ $E$ OR $E$ $E$ $\rightarrow$ $E$ AND$E$ $E$ $\rightarrow$ NOT $E$ $E$ $\rightarrow$ $\left ( E \right )$ $E$ $\rightarrow$ TRUE $E$\rightarrow$ FALSE $E$ $\ ... grammar is Ambiguous Non-ambiguous $LL$ $\left ( 1 \right )$ Both$\left ( A \right )$ and $\left ( C \right )$
Consider the following grammar for Boolean expression:$E$ $\rightarrow$ $E$ OR $E$$E$ $\rightarrow$ $E$ AND$E$$E$ $\rightarrow$ NOT $E$$E$ $\rightarrow$ $\left ( E \right...
Bikram
393
views
Bikram
asked
Jan 16, 2017
GATE
tbb-mockgate-1
grammar
ambiguous
compiler-design
+
–
1
votes
1
answer
1302
Test by Bikram | Mock GATE | Test 1 | Question: 13
Match the following: List I List II A Backus Naur form 1 Regular expression B Lex 2 $\left ( I \right )$LALR$ C Yacc 3 $LL$\left ( 1 \right )$ D Recursive descent parsing 4 $CFG's$ ... $A-4; \: B-1 \: ; C-2; \: D-3;$ $A-1; \: B-4; \:C-2; \: D-3;$
Match the following:List IList IIABackus Naur form 1Regular expressionBLex2$\left ( I \right )$$LALR$CYacc3$LL$$\left ( 1 \right )$DRecursive descent parsing 4$CFG's$ $...
Bikram
380
views
Bikram
asked
Jan 16, 2017
GATE
tbb-mockgate-1
grammar
compiler-design
+
–
4
votes
2
answers
1303
Test by Bikram | Mock GATE | Test 1 | Question: 11
Consider following recursive functions: function fib(n : integer); integer begin if (n = 0) or (n = 1) then fib = 1 else fib = fib(n-l) + fib(n-2) end The above function is run on a computer with a stack of $x$ ... we can execute this function for maximum value $n = 10$ without overflowing the stack. Then the size of the stack is ______ $Bytes$.
Consider following recursive functions:function fib(n : integer); integer begin if (n = 0) or (n = 1) then fib = 1 else fib = fib(n-l) + fib(n-2) endThe above function is...
Bikram
1.4k
views
Bikram
asked
Jan 16, 2017
GATE
tbb-mockgate-1
numerical-answers
runtime-environment
compiler-design
+
–
8
votes
2
answers
1304
Test by Bikram | Mock GATE | Test 1 | Question: 9
Consider the following program fragment : int foo(int ,int ); int a; int ar[4] = { 1,0, 2,3}; main() { a = 0; foo(ar[a], ar[ar[a]]); printf("%d,%d ,%d,%d ", ar[0] , ar[1] ,ar[2] , ar[3]); } foo(int x, int y) { x= x+1; y ... be printed by the program if parameter passed by call by name? $1, 50, 2, 3$ $3, 50, 2, 3$ $3, 50, 3, 4$ $3, 2, 2, 3$
Consider the following program fragment :int foo(int ,int ); int a; int ar[4] = { 1,0, 2,3}; main() { a = 0; foo(ar[a], ar[ar[a]]); printf("%d,%d ,%d,%d ", ar[0] , ar ,a...
Bikram
1.6k
views
Bikram
asked
Jan 16, 2017
GATE
tbb-mockgate-1
parameter-passing
runtime-environment
compiler-design
+
–
0
votes
1
answer
1305
Test by Bikram | Mock GATE | Test 1 | Question: 7
A shift reduced parser carries out the actions specified within braces Immediately after reducing with the corresponding rule of grammar. S --> xxW (print 'a') S --> Y (print'b') W --> Sz ... is the translation of $xxxxyzz$ using the syntax directed translation scheme described by the above rules. bcaca aabcc aabca ccbaa
A shift reduced parser carries out the actions specified within braces Immediately after reducing with the corresponding rule of grammar.S xxW (print 'a') S Y (print'...
Bikram
724
views
Bikram
asked
Jan 16, 2017
Compiler Design
tbb-mockgate-1
compiler-design
parsing
syntax-directed-translation
+
–
0
votes
0
answers
1306
Self doubt
What is the difference between data flow graph and control flow graph, and in which phase these graphs are used?
What is the difference between data flow graph and control flow graph, and in which phase these graphs are used?
vaishali jhalani
293
views
vaishali jhalani
asked
Jan 15, 2017
Compiler Design
compiler-design
+
–
13
votes
2
answers
1307
LL(k) grammars
1. LL(k) grammars have one to one correspondance with DCFL's 2. LR(k) grammars have one to one correspondance with CFL's Which of them is True and explain it bit clearly?
1. LL(k) grammars have one to one correspondance with DCFL's2. LR(k) grammars have one to one correspondance with CFL'sWhich of them is True and explain it bit clearly?
Prajwal Bhat
5.2k
views
Prajwal Bhat
asked
Jan 15, 2017
Compiler Design
theory-of-computation
compiler-design
grammar
ll-parser
+
–
0
votes
1
answer
1308
geeks mock 2017 #56
Which of the following statements is correct about context sensitive grammar? I) In a context sensitive grammar, ε can't be the right hand side of any production II) In a context sensitive grammar, number of grammar symbols on the left hand side of a ... non-terminals on the right hand side Isn't (II) (non contracting grammar is also CSL) and (IV) both are correct
Which of the following statements is correct about context sensitive grammar?I) In a context sensitive grammar, ε can’t be the right hand side of any productionII) In ...
Pankaj Joshi
2.9k
views
Pankaj Joshi
asked
Jan 14, 2017
Compiler Design
geeksforgeeks-test-series
compiler-design
context-sensitive
+
–
0
votes
1
answer
1309
grammer
Ankita Shingala
524
views
Ankita Shingala
asked
Jan 14, 2017
Compiler Design
compiler-design
grammar
ambiguous-grammar
test-series
+
–
5
votes
1
answer
1310
Compiler: Viable Prefixes
Consider the following grammar: $S\rightarrow0S1 | 01$ How many of the following are the viable prefixes of the grammar? i. 01 ii. 001 iii. 00011 iv. 00S1 PS: given answers i, ii and iv , please explain!
Consider the following grammar:$S\rightarrow0S1 | 01$How many of the following are the viable prefixes of the grammar?i. 01 ii. 001iii. 00011iv. 00S1PS: given answers ...
Vijay Thakur
1.2k
views
Vijay Thakur
asked
Jan 13, 2017
Compiler Design
compiler-design
parsing
viable-prefix
+
–
0
votes
2
answers
1311
Number of Tokens
$/* abc */Printf("what's \ up \ \%d",++ \&\&***a);$
$/* abc */Printf("what's \ up \ \%d",++ \&\& *a);$
monty
526
views
monty
asked
Jan 13, 2017
Compiler Design
compiler-design
compiler-tokenization
+
–
0
votes
1
answer
1312
Parsing
Why in this I6 and I7 are not in same state??
Why in this I6 and I7 are not in same state??
kirtikanwar
302
views
kirtikanwar
asked
Jan 11, 2017
Compiler Design
compiler-design
parsing
lr-parser
test-series
+
–
0
votes
1
answer
1313
testbook
focus _GATE
381
views
focus _GATE
asked
Jan 11, 2017
Compiler Design
compiler-design
parsing
lr-parser
testbook-test-series
+
–
0
votes
0
answers
1314
testbook
focus _GATE
193
views
focus _GATE
asked
Jan 11, 2017
Compiler Design
testbook-test-series
test-series
compiler-design
+
–
0
votes
0
answers
1315
testbook
focus _GATE
216
views
focus _GATE
asked
Jan 11, 2017
Compiler Design
testbook-test-series
test-series
compiler-design
+
–
0
votes
2
answers
1316
Testbook test
some one pls tell why it is wrong?
some one pls tell why it is wrong?
mohit chawla
389
views
mohit chawla
asked
Jan 10, 2017
Compiler Design
compiler-design
syntax-directed-translation
ll-parser
testbook-test-series
+
–
0
votes
0
answers
1317
compiler
the need of heap allocation at runtime is a) to support dynamic data structure b)to support dynamic scoping c) to support recursion d) all of the above explain?
the need of heap allocation at runtime is a) to support dynamic data structure b)to support dynamic scoping c) to support recursiond) all of the above explain?
focus _GATE
201
views
focus _GATE
asked
Jan 10, 2017
Compiler Design
compiler-design
test-series
+
–
2
votes
4
answers
1318
Virtual Gate Test Series: Compiler Design - Stack Allocation
Consider the following two statements$:$ $S_{1}:$ Activation records can have a permanent lifetime in case of static allocation. $S_{2}:$ Activation records can have nested lifetime in case of stack allocation. Which of the option is correct regarding $S_{1}$ and $S_{2}$ respectively True, True True, False False, True False, False
Consider the following two statements$:$ $S_{1}:$ Activation records can have a permanent lifetime in case of static allocation.$S_{2}:$ Activation records can have neste...
ManojK
1.5k
views
ManojK
asked
Jan 9, 2017
Compiler Design
compiler-design
runtime-environment
activation-record
virtual-gate-test-series
+
–
0
votes
2
answers
1319
Virtual Gate Test Series: Compiler Design - Triples
Which of the following is an advantage of $\text{'Triples'}$ Statements can be moved around Wastage of too much space Space is not wasted Two memory access per operation
Which of the following is an advantage of $\text{'Triples'}$Statements can be moved aroundWastage of too much spaceSpace is not wastedTwo memory access per operation
ManojK
936
views
ManojK
asked
Jan 9, 2017
Compiler Design
compiler-design
intermediate-code
virtual-gate-test-series
+
–
2
votes
4
answers
1320
Directed acyclic graph
In questions like, when asked to find the edges or nodes in the DAG of following expression, a=a+b*c-(a+b)+(b*c) do we also consider "=" as a node and its related edges?
In questions like, when asked to find the edges or nodes in the DAG of following expression,a=a+b*c-(a+b)+(b*c)do we also consider "=" as a node and its related edges?
Shradha
2.6k
views
Shradha
asked
Jan 9, 2017
Compiler Design
compiler-design
code-optimization
directed-acyclic-graph
+
–
Page:
« prev
1
...
39
40
41
42
43
44
45
46
47
48
49
...
67
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register