search
Log In
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users Sep 2019
  1. Satbir

    567 Points

  2. Bikram

    566 Points

  3. GAITONDE

    348 Points

  4. Vimal Patel

    87 Points

  5. Shaik Masthan

    38 Points

  6. BLACK_CLOUD

    14 Points

  7. sekhar_1621

    13 Points

  8. OgbeborBeatrice

    13 Points

  9. RAMYA.F

    9 Points

  10. vkw1111

    9 Points

Recent questions tagged compiler-design

0 votes
0 answers 9 views
Is following grammar has language which is inherently ambiguous? $S \rightarrow aaAb | aab | A$ $A \rightarrow aaAb | aAb | \epsilon$ I think that this grammar has unambiguous grammar as follow. Let's first rewrite the grammar as below such that this grammar has same ... have to perform $S \rightarrow A$. Please help me with this. I want to know whether this language is inherenly ambigous or not?
asked Sep 13 in Compiler Design Vimal Patel 199 points 9 views
0 votes
0 answers 9 views
0 votes
0 answers 12 views
Here it is mentioned top-down parsing, so shouldn’t I traverse the tree top-down left-right manner and perform the semantic actions? On traversing print * is encountered before print +, so shouldn’t the output be *+ ? Any help is appreciated. Thank you. :)
asked Sep 10 in Compiler Design DukeThunders 132 points 12 views
0 votes
1 answer 17 views
This is what I got: First(S)={b} First(A)={b} First(B)={b,e} First(C)={b,e,epsilon} Follow(S)={$,d} Follow(A)={a,b,e} Follow(B)={a,b,d,e,$} Follow(C)={a,b,e,$}
asked Sep 10 in Compiler Design DukeThunders 132 points 17 views
0 votes
1 answer 17 views
Hello all, I have been trying to understand how to add look aheads in cannonical collection of LR(1) items: This is my approach: It asked for the items in closure of S'→.S, ... $ I am unable to figure out how to get a, b in lookaheads, I am only getting $. Any help is appreciated. Thank you
asked Sep 10 in Compiler Design DukeThunders 132 points 17 views
0 votes
0 answers 14 views
Is there any lexical error in this program? According to me there is NONE, but according to MADE EASY there is a lexical error and the reason they provided is→ Shouldn’t it should be a semantic error ?
asked Sep 6 in Compiler Design GAITONDE 567 points 14 views
0 votes
1 answer 13 views
A grammar that has not any epsilon productions and also free from unit productions. The maximum number of reduce moves that can be taken during bottom up evaluation of 25 token string by bottom up parsers is ________. My ans is 24, but they have given ans as 49..which is right?
asked Sep 6 in Compiler Design GAITONDE 567 points 13 views
0 votes
1 answer 20 views
My ans is 30, but they have given ans as 29...which is correct?
asked Sep 6 in Compiler Design GAITONDE 567 points 20 views
0 votes
0 answers 10 views
0 votes
0 answers 5 views
Consider the following 'C' code main() { int i = 0 , n = 10; int a[n]; while (i < = (n - 1)) { a [i] = i * i ; i = i + 1 ; } return ; } The number of leaded statements in the above ' C ' code are _________
asked Sep 5 in Compiler Design GAITONDE 567 points 5 views
0 votes
0 answers 17 views
Ans given is D, but according to me it should be A.. Which is correct?
asked Sep 5 in Compiler Design GAITONDE 567 points 17 views
0 votes
0 answers 6 views
Consider the grammar shown below S → aBCd|dCBe B → bB|ϵ C → Ca|ac|ϵ In the predictive parsing table M of this grammar ,the entries M[B,c] and m[C,d] respectively
asked Sep 5 in Theory of Computation GAITONDE 567 points 6 views
0 votes
0 answers 3 views
S→ pSqS / qSpS / ε Is the given grammar ambiguous? If so draw the 2 distinct parse tree.
asked Sep 5 in Compiler Design GAITONDE 567 points 3 views
0 votes
0 answers 9 views
Sometimes I want to ask questions which have diagramatic representation. I don’t like psoting pics as I don’t receive answers on them. Do anyone know some online resources where I can do the tasks such as drawing DAGs, Syntax Tree, parse tree and state diagrams quickly without wasting much of time.
asked Sep 5 in Compiler Design `JEET 144 points 9 views
0 votes
1 answer 6 views
Consider the following block of three address statements a = c + d e = a + d d = c + d Then the number o nodes in the DAG constructed for the above block of statement is ______________.
asked Sep 5 in Compiler Design `JEET 144 points 6 views
0 votes
0 answers 2 views
I know the option is (b). I wanted to see the full triple table. Can someone please help in drawing that.
asked Sep 4 in Compiler Design `JEET 144 points 2 views
0 votes
0 answers 3 views
I know the option is (b). I wanted to see the full triple table. Can someone please help in drawing that.
asked Sep 4 in Compiler Design `JEET 144 points 3 views
0 votes
0 answers 4 views
Page no. 363 2nd edition Ulman In three-address code, there is at most one operator on the irght side ofan instruction; that is, no built-up arithmetic expressions are permitted. Can someone please explain the meaning of the highlighted line?
asked Sep 4 in Compiler Design `JEET 144 points 4 views
0 votes
0 answers 4 views
I read the following statements→ LR(1) parsers efficiently handles DCFL in guaranteed linear time. So every regular grammar is LR(1) grammar. Is this statement true?
asked Sep 4 in Compiler Design GAITONDE 567 points 4 views
1 vote
0 answers 19 views
0 votes
1 answer 17 views
I know the answer is D. Looking for some more clarification. My explanation is that “1y” won’t have any pattern matching by the lexical analyser. So, it will throw an error? Is this reasoning and logic correct???
asked Sep 4 in Compiler Design `JEET 144 points 17 views
0 votes
2 answers 15 views
Consider the following statements. S1: If G is a LL(k) grammar then G may or maynot be LL(k + 1) grammar (for k>=1) . S2: If G is a LL(1) grammar then G cannot be parse by LR(0)parser. Select the correct option. 1. Both S1 and S2 are true. 2. Both S1 and S2 are false. 3. S1 is true and S2 is false. 4. S1 is false and S2 is true.
asked Sep 3 in Compiler Design GAITONDE 567 points 15 views
0 votes
1 answer 7 views
Consider the following grammar. S-> SaSaS | ϵ For string “aaaaaa” , total number of possible parse tree are_____
asked Sep 3 in Compiler Design GAITONDE 567 points 7 views
0 votes
0 answers 6 views
Which of the following intermediate code helps in generating the efficient target code Three address code DAG Postfix Quadruples
asked Sep 3 in Compiler Design GAITONDE 567 points 6 views
0 votes
0 answers 10 views
0 votes
4 answers 7 views
Please clarify this doubt: suppose we have an SDT. In the syntax analysis phase the top-down parser generates the annotated parse tree. for the grammar. and in the semantic analysis phase this tree is parsed and the corresponding actions are performed. In ... phase and then in the semantic analysis phase we perform the actions corresponding to the reductions. Is this the way things are performed
asked Sep 2 in Compiler Design Doraemon 63 points 7 views
0 votes
0 answers 11 views
I want to know if there is some method for calculating first and follow directly for a left recursive grammar. I know how to remove left recursion and then calculate the first and follow but I want to know if there is some quick trick from speed point of view.
asked Aug 31 in Compiler Design `JEET 144 points 11 views
0 votes
1 answer 24 views
In the grammar S $\rightarrow$ TA A $\rightarrow$ +TA/$\epsilon$ T $\rightarrow$ a/$epsilon$ Follow(T) $\cap$ First(S) is Answer given is +. Please help me understand the steps. Getting answer is not the only objective.
asked Aug 30 in Compiler Design `JEET 144 points 24 views
1 vote
1 answer 9 views
S $ \rightarrow $ [SX] | a X $ \rightarrow $ $\epsilon$ | + SY | Y b Y $ \rightarrow $ $\epsilon$ | -SXc Then FOLLOW (S) is PS: The answr is {dollar, +, -, ], c, b} I just want to clarify each step. Getting just answre is not the objective. Please do mention the every step.
asked Aug 30 in Compiler Design `JEET 144 points 9 views
0 votes
0 answers 5 views
Que 1) When follow will not have dollar? Que 2) Why follow has to have dollar?
asked Aug 30 in Compiler Design `JEET 144 points 5 views
0 votes
1 answer 8 views
Find FOLLOW(B) In the following grammar A -> BCD B -> w | Bx C -> yCz | m D -> DB | a
asked Aug 30 in Compiler Design `JEET 144 points 8 views
0 votes
1 answer 31 views
The least number of total variables needed to create a three address code in static single assignment form for the following code segment is: q=3 r=10 s=q+r t=2*r+s t=q u=q+r v=q+t t=3+x
asked Aug 19 in Compiler Design Sambhrant Maurya 204 points 31 views
0 votes
1 answer 19 views
Consider the following grammar, where S and T are non-terminals and +, * and a are terminals. S→S∗S|S+S|T|a T→a The total number of possible parse trees for the string a∗a+a is?
asked Aug 19 in Compiler Design Sambhrant Maurya 204 points 19 views
0 votes
1 answer 18 views
“Any DCFL has an equivalent grammar that can be parsed by a SLR(1) parser with end string delimiter” True or False? What about LR(0) for the same?
asked Aug 18 in Compiler Design Sambhrant Maurya 204 points 18 views
0 votes
0 answers 6 views
For which of the following languages a LL(1) grammar does not exist? {$a^{n}ob^{n}$∣n≥1}∪{$a^{n}b^{n}$∣n≥1} {$a^{n}b^{m}$∣m,n≥0} {$a^{i}b^{j}$∣i≥j} {$a^{i}b^{j}$∣i=j} Why C is the answer here? Can anyone explain?
asked Aug 18 in Compiler Design Sambhrant Maurya 204 points 6 views
0 votes
1 answer 26 views
Consider the following two grammars G1: A → A1 | 0A1 | 01 G2: A → 0A | 1 Which of the following is True regarding above grammars? (a) L1 is LR(k) (b) L2 is LR(k) (c) Both L1 and L2 is LR(k) (d) None is LR(k)
asked Aug 18 in Compiler Design Sambhrant Maurya 204 points 26 views
0 votes
0 answers 8 views
a ( ) , $ a > > > ( < < = < ) > > > , < < > > $ < < How to construct the operator function graph for this operation relation table? I know the general procedure but here the “=” is causing troubles.
asked Aug 15 in Compiler Design Sambhrant Maurya 204 points 8 views
0 votes
1 answer 6 views
What are “sentential forms”,”left sentential form”, “right sentential form” and “rightmost sentential form”? Please explain with an example.
asked Aug 15 in Compiler Design Sambhrant Maurya 204 points 6 views
0 votes
0 answers 8 views
What is the grammar for generating strings like a=b=c? (A) right→leer=right|leer letter→a|b|..|z (B) right→leer=leer letter→a|b|..|z (C) right→leer=leer|leer letter→a|b|..|z (D) right→right=leer|leer letter→a|b|..|z
asked Jul 3 in Compiler Design Dmmodi 50 points 8 views
To see more, click for the full list of questions or popular tags.
...