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

Consider the following translation rules for the grammer G:

What is the output produced for the input abebebe using the bottom-up parsing with above translation ?

S a (print ''C'') A
A b {print ''B''} B
C c {print ''R''}
A {print ''B''}
B e {print ''P''} A
B {print ''A''}

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

The correct option is A CBPBPBPB
For the input string abebebe

It will print CBPBPBPB.
So, option (c) is correct.

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