search
Log In
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
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users 2021 Jun 14 - 20
  1. mtech_student

    60 Points

  2. Subhajit Panday

    6 Points

  3. Sambhrant Maurya

    4 Points

Weekly Top User (excluding moderators) will get free access to GATE Overflow Test Series for GATE 2021

Recent questions and answers in Compiler Design

0 votes
0 answers 13 views
In the following gate 2021 question from compiler design, https://gateoverflow.in/357425/gate-cse-2021-set-1-question-26 suppose option C is modified as : The actions can be used to type-check syntactically correct boolean variable declarations BUT NOT boolean expressions. ... separate semantic rule using the production D → bool ID. Then, will option C be correct in addition to option B ?
asked Jun 1 in Compiler Design debendra2021 5 points 13 views
0 votes
1 answer 21 views
S → S + S {S.val = S1.val - S2.val} S → S * S {S.val = S1.val + S2.val} S → S – S {S.val = S1.val * S2.val} S → (S) {S.val = S1.val +2 } S → id The value of the attribute at the root when the following expression is evaluated using the above SDT is _____. ( (5 + 4) – 8) + 12
answered Jun 1 in Compiler Design bg_kenZ 5 points 21 views
0 votes
0 answers 5 views
Consider the basic block given below: a=10 b=4*a t1=i*j c=t1+b t2=15*a d=t2*c e=i t3=e*j t4=i*a c=t3+t4 The minimum number of nodes present in the DAG representation of the above basic block is _____.
asked May 28 in Compiler Design bg_kenZ 5 points 5 views
0 votes
0 answers 10 views
0 votes
0 answers 7 views
Draw the canonical collection of lr(0) item s-->da|ab a-->ba|c B-->bB|c. Find out whether the grammar is LR(0) or not and SLR(1) or not.
asked Apr 3 in Compiler Design Prubhtej_9 5 points 7 views
0 votes
0 answers 21 views
Caption
asked Mar 12 in Compiler Design Pradeep Verma 5 points 21 views
8 votes
6 answers 3.1K views
Consider the following $\text{ANSI C}$ program: int main () { Integer x; return 0; } Which one of the following phases in a seven-phase $C$ compiler will throw an error? Lexical analyzer Syntax analyzer Semantic analyzer Machine dependent optimizer
asked Feb 18 in Compiler Design Arjun 257 points 3.1K views
0 votes
3 answers 1.2K views
In the context of compilers, which of the following is/are $\text{NOT}$ an intermediate representation of the source program? Three address code Abstract Syntax Tree $\text{(AST)}$ Control Flow Graph $\text{(CFG)}$ Symbol table
asked Feb 18 in Compiler Design Arjun 257 points 1.2K views
3 votes
2 answers 1K views
Consider the following $\text{ANSI C}$ code segment: z=x + 3 + y->f1 + y->f2; for (i = 0; i < 200; i = i + 2) { if (z > i) { p = p + x + 3; q = q + y->f1; } else { p = p + y->f2; q = q + x + 3; } } Assume that the variable $y$ points to ... the form $\textsf{ y ->f1}$ or $\textsf{y ->f2}$) in the optimized code, respectively, are: $403$ and $102$ $203$ and $2$ $303$ and $102$ $303$ and $2$
asked Feb 18 in Compiler Design Arjun 257 points 1K views
1 vote
3 answers 458 views
For a statement $S$ in a program, in the context of liveness analysis, the following sets are defined: $\text{USE}(S)$ : the set of variables used in $S$ $\text{IN}(S)$ : the set of variables that are live at the entry of $S$ $\text{OUT}(S)$ : the set of variables that are live at the ... $) }\cup \text{ OUT ($S_2$)}$ $\text{OUT ($S_1$)} = \text{USE ($S_1$)} \cup \text{IN ($S_2$)}$
asked Feb 18 in Compiler Design Arjun 257 points 458 views
0 votes
1 answer 553 views
Consider the following augmented grammar with $\{ \#, @, <, >, a, b, c \}$ ... $I_0 = \text{CLOSURE}(\{S' \rightarrow \bullet S\})$. The number of items in the set $\text{GOTO(GOTO}(I_0<), <)$ is ___________
asked Feb 18 in Compiler Design Arjun 257 points 553 views
2 votes
2 answers 561 views
Consider the following statements. $S_1:$ The sequence of procedure calls corresponds to a preorder traversal of the activation tree. $S_2:$ The sequence of procedure returns corresponds to a postorder traversal of the activation tree. Which one of the following options is correct? $S_1$ is true and ... $S_2$ is true $S_1$ is true and $S_2$ is true $S_1$ is false and $S_2$ is false
asked Feb 18 in Compiler Design Arjun 257 points 561 views
1 vote
2 answers 754 views
Consider the following statements. $S_1:$ Every $\text{SLR(1)}$ grammar is unambiguous but there are certain unambiguous grammars that are not $\text{SLR(1)}$. $S_2:$ For any context-free grammar, there is a parser that takes at most $O(n^3)$ time to parse a string of length $n$. ... $S_2$ is false $S_1$ is false and $S_2$ is true $S_1$ is true and $S_2$ is true $S_1$ is false and $S_2$ is false
asked Feb 18 in Compiler Design Arjun 257 points 754 views
1 vote
2 answers 1.1K views
Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation $\text{(SDT)}$ ... The actions can be used to type-check syntactically correct boolean variable declarations and boolean expressions. The actions will lead to an infinite loop
asked Feb 18 in Compiler Design Arjun 257 points 1.1K views
3 votes
2 answers 477 views
Consider the following context-free grammar where the set of terminals is $\{a,b,c,d,f\}$ ... $\boxed{1}\;\text{blank} \qquad \boxed{2}\;\text{S} \rightarrow \text{R}f \qquad \boxed{3}\; \text{blank} \qquad \boxed{4}\;\text{blank} $
asked Feb 18 in Compiler Design Arjun 257 points 477 views
1 vote
2 answers 537 views
Consider the following $C$ code segment: a = b + c; e = a + 1; d = b + c; f = d + 1; g = e + f; In a compiler, this code segment is represented internally as a directed acyclic graph $\text{(DAG)}$. The number of nodes in the $\text{DAG}$ is _____________
asked Feb 18 in Compiler Design Arjun 257 points 537 views
1 vote
0 answers 21 views
Can we generate different parsing table for grammar
asked Feb 14 in Compiler Design SHWETA RAO 9 points 21 views
0 votes
0 answers 18 views
char c = ‘a’; How many tokens the above statement has. My doubt is about the single quote.'a' is taken as 1 token or 3?
asked Feb 11 in Compiler Design rahul65 5 points 18 views
0 votes
0 answers 19 views
Consider the following grammar S → S ; T | T T → s Construct DFA of LR(1) Items Show the parsing stack for the input string s;s;s
asked Feb 10 in Compiler Design ruqyya 5 points 19 views
0 votes
1 answer 32 views
Identify lexical, syntax and semantic errors from the following C program. Write line number, error message, and type of the error for each error in the program 01: float Factorial(int N) { 02: float F; 03: F==1; 04: while(i<F) 05: F*=i; 06: return F 07: } 08: Void mane() 09: integer r; 10: r=Factorial(5); 11: IF(r>0) 12: PrintResult(r); 13: }
answered Feb 10 in Compiler Design zxy123 3.6k points 32 views
1 vote
0 answers 37 views
How to solve it?
asked Jan 29 in Compiler Design Parth27 163 points 37 views
0 votes
0 answers 50 views
(i) if a non token were in the code would it be counted in the lexical analysis? (ii) and will it generate an error in the lexical analysis phase or simply ignore that and count rest of the tokens? like, in this code : ifx = 12*54; what would be the output from lexical analysis phase?
asked Jan 26 in Compiler Design 5andy 5 points 50 views
0 votes
0 answers 28 views
what are the minimum number of registers required without any register splitting in following case c=a+b; d=a+b; as we can see at instruction 1, a and b are live c is dead at instruction 2 also a and b are live d is dead how many min register are required? ... required only. so according to that only 2 variable at max are live at any point so 2 register should be required..what would be the answer
asked Jan 23 in Compiler Design Sneha negi 9 points 28 views
0 votes
1 answer 14 views
Consider the basic block given below. u=u+v v=v+w x=v-w y=v-x z=u+v Find the sum of the minimum no of edges and nodes present in the DAG representation of the basic block given above.
answered Jan 22 in Compiler Design zxy123 3.6k points 14 views
0 votes
1 answer 30 views
Choose the correct output when the lexical analyzer scans the following input: “cabacccab”.
answered Jan 22 in Compiler Design SarathBaswa 849 points 30 views
0 votes
0 answers 15 views
asked Jan 18 in Compiler Design val_pro20 2 points 15 views
0 votes
0 answers 17 views
Can anyone provide me good reference for solving Directed Acyclic Graphs(DAG) problems?
asked Jan 15 in Compiler Design nikhil856 13 points 17 views
0 votes
0 answers 19 views
Answer will 8 or 9? i got 9 (according to me no optimization should be done in Intermediate representation form)
asked Jan 13 in Compiler Design Nitinkumar.097 13 points 19 views
0 votes
0 answers 22 views
I know A,B,C are valid answer But can anyone confirm if D is also valid..We have epsilon in RHS it should not be Operator Grammer so D should be also valid???...can i get help
asked Jan 9 in Compiler Design vipin.gautam1906 9 points 22 views
0 votes
0 answers 82 views
The question on madeasy test: find out number of temp variables in the 3AC generated for this expression x = (-b + sqrt(b^2 - 4*a*c)) / (2*a) The answer on madeasy makes sense (screenshot below), but in this nptel video - (1 min 30th second) https://www.youtube.com/watch?v ... ) or the 2nd (nptel and wikipedia method): 1. ** 2. **where Tn-1 is √(b^2 - 4ac), and Tn is the nth temporary variable
asked Dec 30, 2020 in Compiler Design rish-18 9 points 82 views
0 votes
1 answer 18 views
https://gateoverflow.in/141809/ambiguous-to-unambiguous what will be the unambiguous grammar …...
answered Dec 29, 2020 in Compiler Design zxy123 3.6k points 18 views
0 votes
1 answer 31 views
The number of 1's in the binary representation of (3*4046+15*256+5*16+3) is
answered Dec 29, 2020 in Compiler Design zxy123 3.6k points 31 views
0 votes
0 answers 17 views
S->AB A->a B->b is ambiguous or not ? i think not ambiguous becz not having two same left most derivation tree or not hab=ving two same RMD tree…...is it correct
asked Dec 28, 2020 in Compiler Design eyeamgj 29 points 17 views
0 votes
0 answers 24 views
https://gateoverflow.in/284952/madeeasy-series-compiler-design-static-single-assignment what is the correct answer i am getting 6 after doing simplification 7 without minimization ….
asked Dec 27, 2020 in Compiler Design eyeamgj 29 points 24 views
0 votes
1 answer 43 views
can someone tell why is First(B)={b,a,ε} here?? why ‘c’ is not included
answered Dec 24, 2020 in Compiler Design saurabh111 11 points 43 views
1 vote
1 answer 31 views
(1)S->AA/ab A->Bd/null B->SB/d (2) S->AB/a A->SA/null B->AB/d doubt 1--->i can’t able to remove indirect left recursion from both the questions,what is grammar after removing left recursion?? doubt 2--->what is the FIRST and FOLLOW ?
answered Dec 16, 2020 in Compiler Design zxy123 3.6k points 31 views
0 votes
0 answers 21 views
came across this question on gate overflow. please help with solution
asked Dec 16, 2020 in Compiler Design Bgupta 5 points 21 views
1 vote
1 answer 25 views
x=x*x y=y*y x=x*y y=y*x Minimum number of total variables in single static assignment for above code?
answered Dec 15, 2020 in Compiler Design Sahil91 683 points 25 views
To see more, click for all the questions in this category.
...