5.
Define Syntax directed definition. Construct annotated parse tree for the input expression (5*3+2)*5 according to the following syntax directed definition.
$\[\begin{array}{|l|l|}\hline \text{Production} & \text{Semantic Rule} \\ \hline L \to E\text{n} & \text{Print } E.\text{val} \\ \hline E \to E_1 + T & E.\text{val} \to E_1.\text{val} + T.\text{val} \\ \hline E \to T & E.\text{val} \to T.\text{val} \\ \hline T \to T_1 * F & T.\text{val} \to T_1.\text{val} * F.\text{val} \\ \hline T \to F & T.\text{val} \to F.\text{val} \\ \hline F \to (E) & F.\text{val} \to (E.\text{val}) \\ \hline F \to \text{digit} & F.\text{val} \to \text{digit.lexval} \\ \hline \end{array}\]$
[6]