Discussion
Consider the following statements about merging states in LALR construction.
1. It can introduce a reduce-reduce conflict.
2. It never introduces a shift-reduce conflict.
3. It always reduces the number of states below the SLR count.
Answer: C
Correct answer: 1 and 2 only
Statements 1 and 2 are correct: merging states with the same core unions their lookahead sets, which can put two reductions in competition on one lookahead, but it cannot affect the shift actions. Statement 3 misstates the comparison - LALR has exactly as many states as SLR, both being built on the LR(0) automaton. The saving is against canonical LR(1), not against SLR.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development