0 votes 0 votes Is it Possible that any SDT can be L-attributed and S-attributed both in the same question? Compiler Design syntax-directed-translation compiler-design parsing + – dixit bishwash asked Mar 28, 2018 dixit bishwash 1.6k views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Sukannya commented Mar 28, 2018 reply Follow Share If a SDT is S-attributed, it definitely is L-attributed but the reverse is not true 1 votes 1 votes dixit bishwash commented Mar 28, 2018 reply Follow Share But if options are:- a) S-attributed b) L-attributed c) Both. d) None then which is the right answer? 0 votes 0 votes Sukannya commented Mar 28, 2018 reply Follow Share 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 0 votes 0 votes Please log in or register to add a comment.
4 votes 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. abhishekmehta4u answered Mar 28, 2018 abhishekmehta4u comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes 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 Prince Sindhiya answered Jul 1, 2018 Prince Sindhiya comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 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. madhukar_dwivedi answered Mar 28, 2018 madhukar_dwivedi comment Share Follow See all 0 reply Please log in or register to add a comment.