a.
$X → X1 \ / \ Y $ { X.$val$ = X1.$val$ / Y.$val$ }
| $Y$ { X.$val$ = Y.$val$ }
$Y → Z \ – \ Y1 $ { Y.$val$ = Z.$val$ – Y.$val$ }
| Z { Y.$val$ = Z.$val$ }
$Z → 2 \ | \ 5 \ | \ 7 \ | \ 8 $ { Z.$val$ = digit.$lexval$ }
b. $ Annotated \ Parse \ Tree :$
Remember here, “$-$” has higher precedence than “$/$”
and “$-$” is Right Associative while “$/$” is Left Associative