search
Log In
0 votes
148 views

in Compiler Design 148 views

1 Answer

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
1 answer
1
277 views asked Jan 25, 2017 in Compiler Design reena_kandari 277 views
0 votes
1 answer
2
49 views asked Oct 24, 2018 in Compiler Design Balaji Jegan 49 views
0 votes
1 answer
3
75 views asked Oct 24, 2018 in Compiler Design Balaji Jegan 75 views
0 votes
0 answers
4
...