The Gateway to Computer Science Excellence
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 by Active (3.1k points) | 9.5k views

1 Answer

+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 Active (1.4k points)
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?
@Warlock lord yes
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.
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,666 questions
56,157 answers
93,740 users