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

Consider the following grammer:
S aSB|d
B b

The number of reduction steps taken by a bottom-up parser while accepting the string aaadbbb is _____.

A
6
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
7
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
5
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
8
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B 7
Given string, aaadbbb
Bottom-up parser: rightmost derivation in reverse.
1. aaaSbbb {S d}
2. aaaSBbb {B b}
3. aaSBb {S aSB}
4. aaSBb {B b}
5. aSb {S aSB}
6. aSB {B b}
7. S {S aSB}

Therefore, total 7 steps required.







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