The Gateway to Computer Science Excellence
0 votes

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

in Compiler Design by | 334 views
If a SDT is S-attributed, it definitely is L-attributed but the reverse is not true
But if options are:-

a) S-attributed

b) L-attributed

c) Both.

d) None

then which is the right answer?
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

+4 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.

+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 

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.
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
52,315 questions
60,430 answers
95,244 users