Recent questions tagged lr-parser

1 1 vote
5 5 answers
2.7k
2.7k views
Every LL(1) grammar is ______A.SLR(1)B.LALR(1)C.LR(1)D.Both B & C
0 0 votes
0 0 answers
375
375 views
Is LR(0) grammar can generate same languages as LR(1) grammar can generate?
0 0 votes
1 1 answer
578
578 views
Do every LR(1) grammar have DPDA?
0 0 votes
1 1 answer
585
585 views
Consider a Context Free Grammar GI - if G is not Suitable for Top Down Parser then it is also not suitable for LR parsers Family.II - if G is not Suitable for Top Dow...
0 0 votes
2 2 answers
668
668 views
8:14 AM37\%Deepali bansal's doubt7 hrsJaipurCompiler DesignCS \& IT EnggWhere €,; IF THEN and all capital letters are terminal and stmt, ifstmt, whilestmt and bexpr are n...
0 0 votes
0 0 answers
1.1k
1.1k views
$E \rightarrow E + T \hspace{5px} | \hspace{5px} T$$T \rightarrow TF \hspace{5px} | \hspace{5px} F $$F \rightarrow F^{*} \hspace{5px} | \hspace{5px} (E) \hspace{5px} | \...
0 0 votes
1 1 answer
418
418 views
How many states are there in CLR parsing table for the given grammar? $\qquad$\[\mathrm{S} \rightarrow \mathrm{~S} \mathrm{~S}+\left|\mathrm{S} \mathrm{~S}^{*}\right| \ma...
0 0 votes
1 1 answer
426
426 views
The given grammar is:\[\mathrm{G}=\{(\mathrm{S}),\{\mathrm{a}, \mathrm{~b}\},\{\mathrm{S} \rightarrow \mathrm{SaS}, \mathrm{~S} \rightarrow \mathrm{~b}\}, \mathrm{S}\}\]L...
2 2 votes
1 answers 1 answer
512
512 views
For the next 2 questions, consider the following grammar:\[\begin{array}{l}\mathrm{S} \rightarrow(\mathrm{~T} \\\mathrm{T} \rightarrow \mathrm{~S}) \mathrm{U} \\\mathrm{~...
0 0 votes
1 1 answer
581
581 views
Consider the grammar\[\begin{array}{l}\mathrm{S} \rightarrow \mathrm{AS} \mid \mathrm{b} \\\mathrm{~A} \rightarrow \mathrm{SA} \mid \mathrm{a}\end{array}\]The grammar is ...
0 0 votes
1 1 answer
743
743 views
Q69. Form a CLR parsing DFA of the following Grammar:\[\mathrm{S} \rightarrow \mathrm{SS}+|\mathrm{SS} *|_{\mathrm{a}}\]Which of the following state is a valid state of t...
2 2 votes
2 2 answers
2.1k
2.1k views
What is the difference between $SLR(1)$ and $LALR(1)$ parser ? Both parser have same parsing table then how $SLR$ is subset of $LALR$ ?
0 0 votes
2 2 answers
653
653 views
it is confirmed that every LL(1) is LR(1) i.e CLR(1),but i want to know that is every LL(1) grammar is also LALR????? becz LALR is subset of CLR(1).
0 0 votes
1 1 answer
717
717 views
Which of the following grammar is LR (1) ?(A) A a A b, A b A b, A a , A b(B) A a A a, A a A b, A c(C) A A + A, A a(D) Both (A) and (B)
0 0 votes
1 1 answer
546
546 views
#self_doubtWhile representing the canonical collection of LR(0) or LR(1) items why first augmented production is added in state diagram??
0 0 votes
2 2 answers
1.0k
1.0k views
Can the following grammar be parsed by LR(0) parser?E - E+id | idIs the accept state entry considered on all the terminal symbol columns for LR(0) parser?
1 1 vote
1 answers 1 answer
398
398 views
E >T+ET >ia)LR(0)b)SLRc)LALRdnone
1 1 vote
1 1 answer
1.4k
1.4k views
LL(1) parser cannot accept nondeterministic grammar at we have only single lookahead and there can be no predictable parsing in this case. Suppose we have LL(n) and we a...
0 0 votes
3 answers 3 answers
4.2k
4.2k views
Please anyone create a $LR(0)$ Parsing table on this grammar and show the working of each step:$S' \rightarrow S$$S \rightarrow S$;$A \mid A$$A \rightarrow E \mid id := ...
0 0 votes
1 1 answer
991
991 views
Can we have a grammar $G$ which is $LL(1)$ but not $SLR(1)$ ,If so given example grammar
1 1 vote
1 1 answer
610
610 views
ANSWER IS CORRECT BU I HAVE DOUBT IN A - .Ab, a/bI think it must be A - .Ab ,a
0 0 votes
1 1 answer
680
680 views
Consider the grammar given$S\rightarrow AA$$A\rightarrow aA / b$How many entries will be blank in the GOTO table for SR(0) items?
0 0 votes
0 0 answers
595
595 views
Consider the following grammar G:S->AB|dA->aA|bB->bB|c The grammar G isA LL (1) grammar and not LR (0)B LL (1) and LR (0)C Not LL (1) but LR (0) /*correct answer*/D Neith...
1 1 vote
1 1 answer
4.2k
4.2k views
The power of parsers is as follows:CLR(1) LALR(1) SLR(1) LR(0) LL(1)Can we say that if a language is not parsed by powerful parser then less powerful parsers can't pa...
3 3 votes
1 1 answer
524
524 views
If shift-reduce conflicts occur in LALR(1) parsers(like yacc,etc).Who gets the higher precedence?shift or reduce?
2 2 votes
1 1 answer
1.7k
1.7k views
Consider the grammar :$S\rightarrow SS+ | SS* | a$Which of the following is true:A) SLR(1) but not LL(1)B) LALR(1) but not SLR(1)C) LR(1) but not LALR(1)D) Neither LL(1)...
4 4 votes
1 1 answer
1.5k
1.5k views
If a grammar is LL(1) then it would be definitely CLR(1) i.e. LR(1) or LALR(1)
1 1 vote
1 1 answer
1.1k
1.1k views
According to my understanding, we LALR is constructed by reducing LR(1) automaton states. So I think it should be LR(1)However, we construct SLR(1) items from the LR(0) a...
3 3 votes
1 1 answer
908
908 views
1 1 vote
0 0 answers
1.2k
1.2k views
Consider the following grammar:$S \rightarrow A$$S \rightarrow xb$$A \rightarrow aAb$$A \rightarrow B$$B \rightarrow x$The average length of the stack used while parsing ...