A shift-reduce parser carries out the actions specified within braces…

GATE · 1995 · CS · Question 2 subparts

A shift-reduce parser carries out the actions specified within braces immediately after reducing with the corresponding rule of grammar. S → xxW {print “1”}; S → y {print “2”}; W → Sz {print “3”}. What is the translation of xxxxyzz using the syntax-directed translation scheme described by the above rules?

  1. A.

    23131

  2. B.

    11233

  3. C.

    11231

  4. D.

    33211

Attempted by 3 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…