1 votes 1 votes How do we know when to execute which semmentic action? Compiler Design made-easy-test-series compiler-design syntax-directed-translation numerical-answers + – rahul sharma 5 asked Dec 29, 2016 edited Mar 6, 2019 by adeebafatima1 rahul sharma 5 1.1k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply junaid ahmad commented Oct 6, 2017 reply Follow Share Is it 11 ? 0 votes 0 votes rajoramanoj commented Oct 6, 2017 reply Follow Share yes 11 is correct ,explain plz 0 votes 0 votes Please log in or register to add a comment.
Best answer 5 votes 5 votes Always Observe the flow of information. junaid ahmad answered Oct 6, 2017 selected Oct 7, 2017 by rajoramanoj junaid ahmad comment Share Follow See all 3 Comments See all 3 3 Comments reply rajoramanoj commented Oct 6, 2017 reply Follow Share junaid ahmad can you pz explain the flow of information. how we proceed in this ques ??? 0 votes 0 votes rajoramanoj commented Oct 6, 2017 reply Follow Share @junaid ahmad see this solution in i am not able in which sequence they proceed can you plz tell me??? 0 votes 0 votes junaid ahmad commented Oct 6, 2017 reply Follow Share @ rajoramanoj Start from top to down and Left to Right,and while reducing and moving around keep eye on semantics to see that which attribute is taking value from which attribute it may be from left child or parent attribute 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes 3+4*2=11 Vineeta Garg answered Oct 6, 2016 Vineeta Garg comment Share Follow See 1 comment See all 1 1 comment reply User007 commented Oct 6, 2016 reply Follow Share Explanation please. 1 votes 1 votes Please log in or register to add a comment.
0 votes 0 votes build parse tree and at each node associate its attribute with definition. sachin! answered Dec 30, 2016 sachin! comment Share Follow See all 4 Comments See all 4 4 Comments reply rahul sharma 5 commented Dec 30, 2016 reply Follow Share In first production.Its is passsing data to child and also getting data from child,so first we need to pass data to child and then process and then get the modified child value?I mean the order in which it should be executed 0 votes 0 votes sachin! commented Dec 30, 2016 reply Follow Share evaluate in depth first search. 0 votes 0 votes rahul sharma 5 commented Dec 30, 2016 reply Follow Share that is ok,execution will be dfs only,what i am saying like when u make tree,then say for first production you have two rules,once is setting val attr and second is passing data to child,how we know which one to execute first?dfs is for node evaluation,i am asking if node has several rules,which is execute when like in this 0 votes 0 votes sachin! commented Dec 30, 2016 reply Follow Share as synthesize attribute and inherited attribute both belong to a node calculate inherited attribute when you going down the tree and calculate synthesize on coming up . 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes What's the asnwer?? Can u upload more clear pic. . The fonts r too small for some of the rules. Is 9 the answer? atul_21 answered Oct 6, 2017 atul_21 comment Share Follow See all 0 reply Please log in or register to add a comment.