# Recent questions tagged parsing 1
If a non deterministic CFL is not inherently ambiguous can it be parsed by some LR(1) parser??
1 vote
2
Remove left recursion from the below grammar S->Aa / b A->Ac / Aad / bd / epsilon
3
is it correct please tell me its urgent!
1 vote
4
Is this statement true:- If Grammar is unambiguous must be LL(1) if not LL(1) it does not mean ambiguous.
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
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"?
1 vote
7
An unambiguous grammar has same leftmost and rightmost derivation. True or False and how??
1 vote
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
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.
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????
1 vote
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
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.
1 vote
13
consider the grammer E->E+E / E*E / (E) /a THE NUMBER OF RIGHT MOST DERIVATION FOR THE SENTENCE (a) is ___________________________
14
what is backpatching?????????????/ plz explain with an example.
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
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$.
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 \}$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) ? 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 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. ???? 1 vote 2 answers 21 ARE NUMBER OF SHIFT ENTRIES / ACTIONS IN PARSING TABLE OF SLR(1) AND LALR(1) SAME ALWAYS?? 1 vote 1 answer 22 0 votes 1 answer 23 0 votes 2 answers 24 Consider the grammar-$S \rightarrow BBB \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