in Compiler Design retagged by
297 views
0 votes
0 votes
What is actual difference between in LALR(1) and CLR(1).

please explain this by taking one example.
in Compiler Design retagged by
297 views

1 Answer

0 votes
0 votes
  • No. of states in CLR(1) is greater than or equal to LALR(1) parser.
  • If grammar is CLR(1), it may or may not be LALR(1), because conflict may arise when you will merge the states for constructing LALR(1) table.
  • If grammar is not CLR(1), it will not be LALR(1), because already conflict happened in CLR(1) so the conflict will always present in LALR(1).
  • If there is no SR conflict in CLR(1), there will be no SR conflict in LALR(1).
  • If there is no RR conflict in CLR(1), we can't say about RR conflict in LALR(1) because there is a chance that when we merge the states, RR conflict may arise.

Related questions