The Gateway to Computer Science Excellence
0 votes
232 views

Is it Possible that any SDT can be L-attributed and S-attributed both in the same question?

in Compiler Design by (85 points) | 232 views
+1
If a SDT is S-attributed, it definitely is L-attributed but the reverse is not true
0
But if options are:-

a) S-attributed

b) L-attributed

c) Both.

d) None

then which is the right answer?
0
If there are only synthesized attributes, answer will be both. If there are both synthesized and inherited attribs, ans would be L-attrib. Else, none

3 Answers

+3 votes

S-attribute : it uses synthsized attribute .

L-attribure ; it uses both synthesized attributes as well as inherited attributes.

in this example it is S-attribute as well as L-attribure hence option c is true.

by Boss (35.6k points)
+1 vote

You can see the Venn diagram 

If SDT is S-attributed, it is definitely L-attributed but if it is L attributed then it may or may not be S attributed 

by Loyal (5.7k points)
0 votes
yes , it is possible that any sdt can have both L-attributed and S-attributed.

since L-attributed sdt uses only synthesized attributes but L-attributed sdt uses both synthesized and inherited both.
by (27 points)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,648 questions
56,439 answers
195,264 comments
100,041 users