wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the following grammar and their syntax Directed Translation (SDT) rules.
S S * A {S.val = S.val × A.val}S A {S.val = A.val}A A + B {A.val = A.val - B.val}B (S) {B.val = 2}A B {A.val = B.val}B id {B.val = id.val}

S1:Given SDT is L- attributed and using L- attributed evaluation the value of the expression4*6+3 * 7 is 84.S2:Given SDT is S- attributed and using S-attributed evaluatin value of the expression46+37 is 84.
Which of the above statements are true with respect to above SDT.

A
Only S2
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
Only S1
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
None of the above
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Both S1 and S2
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
Open in App
Solution

The correct option is D Both S1 and S2
Given SDT is L-attributee and S-attributee both, all the translation rules are written at the rightend and there is no inherited attribute.Expression46+37


Value of teh expression is 84.So both S1 and S2 is correct

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