The Gateway to Computer Science Excellence
0 votes
51 views

in Compiler Design by Active (4.9k points) | 51 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
by Active (1.7k points)

Related questions

0 votes
1 answer
1
asked Jan 25, 2017 in Compiler Design by reena_kandari Loyal (8.1k points) | 213 views
0 votes
1 answer
2
asked Oct 24, 2018 in Compiler Design by Balaji Jegan Active (4.9k points) | 35 views
0 votes
1 answer
3
asked Oct 24, 2018 in Compiler Design by Balaji Jegan Active (4.9k points) | 29 views
0 votes
0 answers
4
asked Oct 24, 2018 in Compiler Design by Balaji Jegan Active (4.9k points) | 18 views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,648 questions
56,429 answers
195,216 comments
99,944 users