1 votes 1 votes Either L attribute or S attributed . What kind of SDT it is ? S --->E# Out('#') E ---> E+E Out('+') E --->T T ---> T#F Out('*) T ---> F F ---> (E) F ---> a Out ('a') For the sentence a+a+a What will be the final Output of it ? Compiler Design syntax-directed-translation compiler-design + – shekhar chauhan asked Jun 5, 2016 • retagged Jun 5, 2016 shekhar chauhan 1.1k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes It is S attributed as the attributes are depending on their child Let me know if anything is wrong shivanisrivarshini answered Jun 5, 2016 shivanisrivarshini comment Share Follow See all 13 Comments See all 13 13 Comments reply Show 10 previous comments asu commented Jun 5, 2016 reply Follow Share @sekhar parse tree as per order of presedence.... 1 votes 1 votes srestha commented Jun 6, 2016 reply Follow Share @shekhar yes as the tree is evaluated from all it's children , so it is a S attributed , + is left associative, So, if the parse tree is evaluate from left to right it will be more accurate 1 votes 1 votes Vamsi Vamsi commented Aug 30, 2017 reply Follow Share if the string is in the form of a+a+a then we have to evaluate by using left associativity but u made this as right associativity i think thats why u got a diff ans i got ans as aa+a+# 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes S attribute....aaa++# ...every S attribute is L attribute ...but every L need not be S. Anup dogrial answered Jan 8, 2020 Anup dogrial comment Share Follow See all 0 reply Please log in or register to add a comment.