search
Log In

Recent questions tagged parsing

0 votes
0 answers
1
If a non deterministic CFL is not inherently ambiguous can it be parsed by some LR(1) parser??
asked Aug 28, 2017 in Compiler Design sushmita 131 views
1 vote
1 answer
2
Remove left recursion from the below grammar S->Aa / b A->Ac / Aad / bd / epsilon
asked Aug 22, 2017 in Compiler Design Vicky rix 201 views
2 votes
2 answers
3
1 vote
1 answer
4
Is this statement true:- If Grammar is unambiguous must be LL(1) if not LL(1) it does not mean ambiguous.
asked Aug 16, 2017 in Compiler Design learner_geek 1.5k views
2 votes
2 answers
5
which of the following statements is true? A) right recursion is needed for termination in predictive parser B) left recursion is required more stack space than right recursion C) left recursion works fine in BUP 1)A & B 2) A & C 3) B & C 4) All
asked Aug 15, 2017 in Compiler Design Hira Thakur 562 views
5 votes
1 answer
6
As I know that LL(1) and LALR(1) grammars are incomperable ,but if a grammar is LL(1) then, it may be LALR(1) if the following conditions hold. 1.A ε-free LL(1) grammar is also a SLR(1) grammar and thus LALR(1) too. 2. A LL(1) grammar with ... only the empty derivation may or may not be LALR(1). can anyone explain each point with example. and what is this "non-empty derivation/empty derivation"?
asked Aug 15, 2017 in Compiler Design reena_kandari 739 views
1 vote
1 answer
7
An unambiguous grammar has same leftmost and rightmost derivation. True or False and how??
asked Aug 14, 2017 in Compiler Design jason33 108 views
1 vote
0 answers
8
Find the closure of S $\rightarrow$ .A ,dollar for the grammar S --> A A --> AB | $\varepsilon$ B --> aB | b // I'm getting S --> .A , dollar A --> .AB, dollar A --> . $\varepsilon$ , a,b
asked Aug 8, 2017 in Compiler Design just_bhavana 348 views
6 votes
6 answers
9
Every LL(1) grammer is LALR(1) TRUE OR FALSE Every LL(1) grammer is CLR(1) TRUE OR FALSE AS I think 2nd is True and 1st is False if I am wrong please let me correct.
asked Aug 5, 2017 in Compiler Design learner_geek 5k views
4 votes
0 answers
10
Here what will we do check intersection of follow(S) and follow(B) if common find then declare SR CONFLICT or As S production finish but it's Intersection is only possible with terminal(which is after dot in unfinished production) Please help what to do????
asked Aug 5, 2017 in Compiler Design learner_geek 340 views
1 vote
1 answer
11
Is the following statement is true or false? top down parsing is implemented using the set of recursive procedures and implementation of bottom up parsing is done using the stack and input buffer. My doubt: - According to me this is false because TDP in case of LL(1) is implemented using stack and input buffer but given answer is true
asked Jul 30, 2017 in Compiler Design akb1115 216 views
0 votes
2 answers
12
S -> (L) | a L -> L . S | S Question: Make necessary changes to make it suitable for LL(1) parsing and Construct FIRST and FOLLOW sets.
asked Jun 13, 2017 in Compiler Design kyrierose 4.7k views
1 vote
3 answers
13
consider the grammer E->E+E / E*E / (E) /a THE NUMBER OF RIGHT MOST DERIVATION FOR THE SENTENCE (a) is ___________________________
asked Apr 25, 2017 in Compiler Design akankshadewangan24 254 views
0 votes
1 answer
14
what is backpatching?????????????/ plz explain with an example.
asked Apr 22, 2017 in Compiler Design akankshadewangan24 303 views
18 votes
10 answers
15
Which of the following statements about parser is/are CORRECT? Canonical LR is more powerful than SLR SLR is more powerful than LALR SLR is more powerful than Canonical LR I only II only III only II and III only
asked Feb 14, 2017 in Compiler Design Arjun 4k views
44 votes
8 answers
16
Consider the following grammar: stmt $\rightarrow$ if expr then expr else expr; stmt | $0$ expr $\rightarrow$ term relop term | term term $\rightarrow$ id | number id $\rightarrow$ a | b | c number $\rightarrow [0-9]$ where relop is a relational operator (e.g.. $<$ ... example. the program if $e_1$ then $e_2$ else $e_3$ has $2$ control flow paths. $e_1 \rightarrow e_2$ and $e_1 \rightarrow e_3$.
asked Feb 14, 2017 in Compiler Design Arjun 10.7k views
17 votes
8 answers
17
Consider the following grammar: $P\rightarrow xQRS$ $Q\rightarrow yz\mid z$ $R\rightarrow w\mid \varepsilon$ $S\rightarrow y$ What is FOLLOW($Q$)? $\left \{ R \right \}$ $\left \{ w \right \}$ $\left \{ w,y \right \}$ $\left \{ w,\$ \right \}$
asked Feb 14, 2017 in Compiler Design Arjun 3.4k views
1 vote
0 answers
18
Can every left recursive grammar be converted to right recusrive grammar? We have rules for that. So I think the ans is YES. Do every DCFL has LL(1) grammar?? If a language is DCFL implies it is unambiguous and deterministic. Thus we can define a grammar for it and ... . Just as DCFL has one to one correspondence with LR(1) grammar why does it not have one to one correspondence with LL(1) ?
asked Feb 8, 2017 in Compiler Design yg92 211 views
1 vote
0 answers
19
If in the state table of a LR parser, in some row, we have more than one SR or RR conflict, then is it considered a single conflict? Reference:- https://gateoverflow.in/113114/slr-parsing-table#c113505
asked Feb 4, 2017 in Compiler Design Samujjal Das 203 views
1 vote
0 answers
20
The number of states in SLR parser for G is _______. for this type of question , Do we consider augmented entry state like S'->S. ????
asked Feb 3, 2017 in Compiler Design sanyam53 342 views
1 vote
2 answers
21
ARE NUMBER OF SHIFT ENTRIES / ACTIONS IN PARSING TABLE OF SLR(1) AND LALR(1) SAME ALWAYS??
asked Feb 3, 2017 in Compiler Design sushmita 1.4k views
0 votes
2 answers
24
Consider the grammar- $S \rightarrow BB$ $B \rightarrow aB/bB/a/b$ How many shift-reduce conflicts will occur when we try to make SLR parsing table for the above grammar? A. 0 B. 1 C. 2 D. None
asked Jan 29, 2017 in Compiler Design Samujjal Das 1k views
0 votes
1 answer
25
First(P) = {+, *, t, epsilon, id} AND Follow(P) = {dollar,id} according to me. In that case M[P, DOLLAR] should have P -> QR
asked Jan 26, 2017 in Compiler Design sidsunny 163 views
2 votes
3 answers
26
GATE 2010 Question The grammar S→aSa∣bS∣c is LL(1) but not LR(1) LR(1) but not LL(1) Both LL(1) and LR(1) Neither LL(1) nor LR(1) I have 2 small doubt First Doubt:-If a grammer is LL(1) then it is always LR(0) ? Is there any grammer which is LL(1) and cannot ... operator presedence,LL(1) LR(0) SLR(1) LALR(1) CLR(1).So what is the difference between LR(0) AND LR(1) and which one is more powerfull ?
asked Jan 24, 2017 in Compiler Design Himanshu Goyal 1.1k views
...