Back to the 2023 paper

Module 3: Semantic Analysis, Symbol Table, Run-time environment

20232m

A shift reduce parser carries out the actions specified within braces immediately after reducing with the corresponding rule of grammar:
SxxWS \to xxW {print "1"}, SyS \to y {print "2"}, SSzS \to Sz {print "3"}
What is the translation of xxxxyzzxxxxyzz using the syntax directed translation scheme described by the above rules?
(i) 23131
(ii) 11233
(iii) 11231
(iv) 33211

Similar questions