Consider the following S-attributed SDT scheme used to calculate the value of an expression. The grammar generates simple arithmetic additions and is suitable for an LR parser.
\[
\begin{array}{ll}
\text{Production} & \text{Semantic Rules} \\
E \rightarrow E_1 + T & E.\text{val} = E_1.\text{val} + T.\text{val} \\
E \rightarrow T & E.\text{val} = T.\text{val} \\
T \rightarrow \mathbf{id} & T.\text{val} = \mathbf{id}.\text{lexval}
\end{array}
\]
If the input string is $3+5+2$, what is the sequence of values stored on the semantic stack for the attribute val immediately after each reduction of the type $E \rightarrow E_1+T$ occurs?
- $8,10$
- $3, 5, 2$
- $3, 8, 10$
- $5,2$