1 votes 1 votes Here a as well as c can be the answer based on the construction of the parse tree. So how to decide which one to choose? Compiler Design compiler-design syntax-directed-translation made-easy-booklet + – Xylene asked Sep 4, 2017 • retagged Jul 16, 2022 by Anjana5051 Xylene 707 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
2 votes 2 votes im getting A as answer. Note that + is left associative and left recursive. smelly indian answered Sep 6, 2017 smelly indian comment Share Follow See all 4 Comments See all 4 4 Comments reply Xylene commented Sep 6, 2017 reply Follow Share But the answer given is C ). Even I marked it A) 0 votes 0 votes smelly indian commented Sep 6, 2017 reply Follow Share I think answer is wrong. I will ask my batchmates and let you know if we can prove (a) answer wrong. 0 votes 0 votes Xylene commented Sep 7, 2017 reply Follow Share Actually we can construct parse tree for both a and c as well. We can get C as an answer by considering + as left associative. My doubt is can SDT be ambiguous ? Is it allowed ? 0 votes 0 votes smelly indian commented Sep 7, 2017 reply Follow Share SDT = Grammer + Semantic rules So we just apply semantic rules to grammer to do later phase work of compiler with early phase while parsing. (Like generating three address code while parsing). So i strongly think that it can't be ambiguous as the grammer upon which semantic rules are being applied can't be ambiguous. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes Ans seems to be C as R->R*R is left recursive OO7 answered Jul 12, 2018 OO7 comment Share Follow See all 0 reply Please log in or register to add a comment.