retagged by
6,855 views
1 votes
1 votes
retagged by

5 Answers

Best answer
10 votes
10 votes
When LALR1 is constructed from CLR1

1)LALR can have shift reduce conflicts only if   CLR has shift reduce conflict

2)LALR may have reduce reduce conflict even if CLR  dont have any conflict(conflict arises due to merging of states where lookaheads are same)
selected by
0 votes
0 votes
The reason is in canonical set of clr(1) shift entries depend on look ahead symbol but reduce entries not depends on look ahead symbol i.e. depends on follow set of left side of  ->.
0 votes
0 votes

When creating LALR from CLR :

  1. Even if CLR doesn’t have RR conflict , LARL may have RR conflict.
  2. CLR have RR conflict , LARL will also have RR conflict.
  3. CLR has no SR conflict then LALR will also have no SR conflict
  4. CLR has SR conflict then LALR will also have  SR conflict

LALR can’t generate SR conflicts by its own but can generate RR conlict by its own.

0 votes
0 votes

 

  1. Even if CLR doesn’t have RR conflict , LARL may have RR conflict.
  2. CLR have RR conflict , LARL will also have RR conflict.
  3. CLR has no SR conflict then LALR will also have no SR conflict
  4. CLR has SR conflict then LALR will also have  SR conflict

LALR can’t generate SR conflicts by its own but can generate RR conflict by its own.

Related questions

0 votes
0 votes
2 answers
1
sripo asked Nov 1, 2018
2,378 views
S→(XS→E]S→E)X→E)X→E]E→ϵIs this grammar CLR(1)? The answer says it is but I find a shift reduce conflict for E- epsilon with lookup symbols ),]
2 votes
2 votes
1 answer
2
sripo asked Nov 10, 2018
3,247 views
Can you give an example which is not LL(1) but is CLR(1)
0 votes
0 votes
1 answer
3
sripo asked Nov 1, 2018
540 views
For given production for a LR(1) grammarB->b.C ,$|c here C is non terminalC->c. ,$|c and here c is terminal. $|c are lookup symbolsWill there be a shift reduce conflict...
8 votes
8 votes
3 answers
4
Parshu gate asked Nov 13, 2017
15,460 views
Suppose we are given a grammar and asked to find the type of that grammar , what is the algorithm which needs to be followed for each of them? LL(1), OR LR(0) , OR CLR(1...