Consider the following grammar along with translation rules. 

S → S1 # T {S•val = S1val * Tval}
S → T {Sval = Tval}
T → T1 % R {Tval = T1val ÷ Rval}
T → R {Tval = Rval}
R → id {Rval = idval}

Here # and % are operators and id is a token that represents an integer and id•val represents the corresponding integer value. The set of non-terminals is {S, T, R, P} and a subscripted non-terminal indicates an instance of the non-terminal.

Using this translation scheme, the computed value of S•val for root of the parse tree for the expression 20#10%5#8%2%2 is _____________. 

Correct Answer:

80

Solution:

Parse tree for the  20#10%5#8%2%2