in Compiler Design retagged by
18,581 views
0 votes
0 votes
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 parser. please if someone can explain it easily?
in Compiler Design retagged by
18.6k views

1 Answer

6 votes
6 votes
  1. $LR(0)\subset SLR(1)\subset LALR(1) \subset CLR(1)$
  2. If there is no RR conflict in CLR(1) then there may or may not be RR conflict in LALR(1)
  3. If there is no SR conflict in CLR(1) then there is no SR conflicts in LALR(1)
  4. Number of states in SLR(1) and LALR(1) are same, goto moves are identical ,shift moves are identical, reduce moves may different else point 1 will never be satisfied.
  5. LALR(1) and CLR(1) both uses LR(1) items.
  6. LR(0) and SLR(1) both uses LR(0) items.
by

3 Comments

yes, LALR and SLR may have different reduce moves, so to satisfy point 1, number of reduce moves in LALR must be lesser or equal to SLR, am I right?
0
0
@Warlock lord yes
0
0
Hello erh

Don't mind but I doubt if your are really answering the question or just sharing what you know.

If would be of much help if you clear your each and every point with examples rather than  just putting statement in form of results.
0
0