retagged by
1,242 views

1 Answer

0 votes
0 votes
Shift-Reduce Parser also called as Bottom Up Parser

Input string : xxxxyz

So Draw the Annotated Parse tree for the input string.

S -> xxW                   [S -> xxW] pf{1}

   -> xxSz                   [W -> Sz] pf{3}

   -> xxxxWz              [S-> xxW] pf{1}

   -> xxxxSzz             [W ->Sz] pf {3}

   -> xxxxyzz             [S->y reduced ] pf{2}

So Bottom to top order : 23131, Option 3

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
3
Balaji Jegan asked Oct 23, 2018
225 views
0 votes
0 votes
1 answer
4
Balaji Jegan asked Oct 23, 2018
302 views