A shift-reduce parser carries out the actions specified within braces immediately after reducing with the corresponding rule of the grammar.
S --> x x W [ print “1”]
S --> y [print “2”]
W --> S2 [print “3”],
what is the translation of “x x x x y z z” ?
(A) 1 1 2 3 1
(B) 1 1 2 3 3
(C) 2 3 1 3 1
(D) 2 3 3 2 1