how many Synthesized attributes are present in the given Syntax directed Definition?
(Answer key says only 2 Synthesized attributes are present. How to find them? Any idea?)
It has 4 synthesized attribute which are
E has the synthesized attributed E.val and T the synthesized attribute T.val
and F has the synthesized attribute F.val and digit has the synthesized attribute digit . lexval which is applied by the lexical analyzer .
Also , only semantic rule with side effect is print(E.val) .
see this line from that link "the value of a synthesized attribute is computed from the values of the attributes of the children of the node."
E -> E1+T
F ->(E) , in both cases it violating that rule. rt?
@Kapil Here the logic you are applying is not valid .
See this input string “ (3+4) * (5+6)" and parse tree.
i reconsidered your option of F.val=digit.val
For input "3*5+4n"
X->YZ , Y->XZ , ...