Recent questions tagged lr-parser

0 0 votes
1 1 answer
20.0k
20.0k views
Could someone please help me check the conflicts in LALR parser. I never understand the difference between these CLR and LALR. and because of this i even forget the SLR p...
1 1 vote
3 3 answers
1.5k
1.5k views
Here what will be the lookahead for first state?Here is given answer:Q. 50Consider the following augmented grammar G.\[\begin{aligned}\boldsymbol{G}: & E \rightarrow E \\...
0 0 votes
1 1 answer
591
591 views
Perform a shift - reduce parser of the input aaa $+a^{*}+$ according to the grammar?\[\mathrm{A} \rightarrow \mathrm{AA}+\left|\mathrm{AA}^{*}\right| \mathrm{a}\]Show the...
0 0 votes
4 4 answers
1.3k
1.3k views
The grammar $E \to T + E \mid T$ is?$\text{LR}(0)$ and $\text{LL}(1)$Not an operator grammarAmbiguous$\text{SLR}(1)$ but not $\text{LL}(1)$As the question did not seem to...
0 0 votes
1 1 answer
695
695 views
I did in this way :There is conflict , right ? As A - g. and B - g. both going to $ and gConsider the following CFG.\[\begin{array}{l}\mathrm{S} \rightarrow \mathrm{aA}|a...
0 0 votes
1 answers 1 answer
1.8k
1.8k views
Will not there be 3 SR conflicts in CLR(1) reduction ?In fact their ans also says this :In the state I1 , will it not be SR conflict ?Consider the following augmented gra...
0 0 votes
1 1 answer
543
543 views
In the grammar given below, sum of number of error states and conflicting states is. $\qquad$Consider Non-recursive Predictive parsing table and 'S' as start symbol.\[\be...
0 0 votes
1 answers 1 answer
1.8k
1.8k views
Consider the following grammar. S $\rightarrow$ (S)S | ∊How many conflicts occur in LR (0) parser for the above grammar?
2 2 votes
1 1 answer
1.0k
1.0k views
S->aAb/aBc/bAd/bBeA->gB->gHow many states in slr(1)
2 2 votes
1 answers 1 answer
1.1k
1.1k views
If lalr(1) has no conflict then clr(1) never contain any conflictIt is true or falseIf it is false explain
0 0 votes
1 1 answer
461
461 views
Which of the following statement(s) is/are TRUE?S1: LR grammar can describe more number of languages than LL grammar.S2: In LR (K) grammar requirement is less stringent t...
0 0 votes
1 answers 1 answer
1.1k
1.1k views
0 0 votes
1 1 answer
736
736 views
Can a grammar which is not LL can be SLR?where will you fit LL in sequence below:LR(0) = SLR = LALR = LR * = stands for implies
0 0 votes
1 1 answer
724
724 views
Can anybody enumerate the similarities and dissimilarities between LL, SLR, LALR and LR parsers.
0 0 votes
1 answers 1 answer
2.3k
2.3k views
Which of the following set could result SR conflict in LALR(1)?a) A→ a.b, {b} B→ a. , {a}b) A→ a.a , {a} B→ a. , {b}c) A→ b.a , {b} B→ b.,{a}d) A→ b.b , {a} B→...
1 1 vote
2 answers 2 answers
856
856 views
Consider the following grammerS→ bAd /bBeA→aB→aThe above grammer is ________________1) SLR(1)2) LALR(1) but not SLR(1)3) CLR(1) but not LALR(1)d) Not LR(1)
1 1 vote
3 answers 3 answers
3.1k
3.1k views
Which of the following could result in Shift-Reduce conflict in LR(0) parser?1){ A→ b.c ,B→b. }2){A→a.b,B→b. }3) {A→∊. , B→.a}4)All of these
0 0 votes
2 answers 2 answers
1.1k
1.1k views
CLR
S'→SS→A/BA→fAi/nB→fBii/dFor the above augmented grammer , the number of states in LR(1) parser are_______________
0 0 votes
1 1 answer
830
830 views
Ques:- Check whether the following grammar is clr(1) grammar or not or lalr grammar or not.S - (S)S - aProblem-The work( for checking the given grammar is LR(1) or not) d...
18 18 votes
2 answers 2 answers
3.7k
3.7k views
Which of the following correctly describes $\text{LR}(k)$ parsing?The input string is alternately scanned left to right and right to left with $k$ reversals.Input string ...
1 1 vote
2 2 answers
2.6k
2.6k views
Hi , I am confused about this grammar .I can find there is one SR conflict , please clarify. S - Aa | bAc | dc | bdaA - d Here , it is not LL1 as A - bAc and S - bda both...
2 2 votes
3 3 answers
2.4k
2.4k views
SET OF VIABLE PREFIXES FOR A GIVEN SLR(1) GRAMMAR IS REGULAR LANGUAGE ?
2 2 votes
6 6 answers
14.3k
14.3k views
I know the parsing logic of bottom up parsers, that they start from the terminal and reduce it to the start symbol. But what really confuses me is the construction of LR(...
37 37 votes
2 answers 2 answers
13.6k
13.6k views
Among simple LR (SLR), canonical LR, and look-ahead LR (LALR), which of the following pairs identify the method that is very easy to implement and the method that is the ...
80 80 votes
6 6 answers
28.2k
28.2k views
Which one of the following is TRUE at any valid state in shift-reduce parsing?Viable prefixes appear only at the bottom of the stack and not insideViable prefixes appear ...
2 2 votes
1 answers 1 answer
1.5k
1.5k views
57 57 votes
7 answers 7 answers
48.9k
48.9k views
A canonical set of items is given below$S \to L . R $$Q \to R.$On input symbol $<$ the set hasa shift-reduce conflict and a reduce-reduce conflict.a shift-reduce conflict...
31 31 votes
2 answers 2 answers
16.4k
16.4k views
Which of the following statements is true?SLR parser is more powerful than LALRLALR parser is more powerful than Canonical LR parserCanonical LR parser is more powerful t...
69 69 votes
6 answers 6 answers
20.8k
20.8k views
Consider the following two sets of $\textsf{LR(1)}$ items of an $\textsf{LR(1)}$ grammar.$ $\begin{array}{l|l}X \rightarrow c.X, c∕d &X → c.X, \$\\X \rightarrow .cX, c∕ ...