CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Let G be the LALR(1) gramar. Then which of the following is always correct when same G is used to construct LR(0) and SLR(1) parser?

A
LR(0) and SLR(1) table contain same number of shift entries
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
LR(0) table and LALR(1) table contain same number of reduced entries
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
None of these
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
SLR(1) table and LALR(1) table contain same number of reduced entries
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is A LR(0) and SLR(1) table contain same number of shift entries
We know number of states in LR(0), SLR (1) and LALR(1) are always equal.
The following entries are always same in LR(0), SLR(1) and LALR(1):
  1. Shift entries in action part of parsing tables
  2. State entries in go to part of parsing tables
But reduced entries may differ in their parsing tables. So, LR(0) and SLR(1) table contain same number of shift entries for the given LALR(1) grammar.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Introduction
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon