in Compiler Design
3,673 views
4 votes
4 votes

image

How to solve this question?

Attributes calculated from children are synthesized, while attributes calculated from parents and/or siblings is inherited. And S-attributed are purely synthesized, while L-attributed are synthesized+inherited, is this right?

in Compiler Design
by
3.7k views

4 Comments

how could it be none ??? i dont know to the extent i know its option c
0
0
I missed that point (inherited attributes are to be derived from its left sibling)
2
2
thats the requirement for L-attirbuted grammar. Otherwise inheritance can be even right.
1
1

2 Answers

14 votes
14 votes
Best answer
Answer is D.

In S-attribute grammar we can have only synthesized attributes.

In L-attribute grammar we can have both synthesized as well as inherited attributes, but the inherited attributes must come from left side (not from right side) only. Here, $R_i = T_i, F_i = R_i, E_i = F_i$ violate this making this not L-attributed grammar,
selected by
by

2 Comments

Oh, so it means, F should be calculated from E only, and R should be calculated from E or F, and so on... Thanks..
1
1
yes. Or from S which is the parent.
1
1
0 votes
0 votes
Answer is D.

Related questions

1 vote
1 vote
2 answers
3
1 vote
1 vote
1 answer
4