Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Grammar: S -> 0 T 0 S -> 1 T 1 T -> 00 T -> 11 a) Draw the Table containing the right side

Grammar:

S -> 0 T 0

S -> 1 T 1

T -> 00

T -> 11

a) Draw the Table containing the right side of the Grammar Rules

0 1

--------------------

S |

T |

If the top of the stack is a non-terminal, replace it with the table entry

(based on the next char).

If the top of the stack is a terminal, match the stack and pop.

go to the next char.

Right now S is on the stack.

Each snap shot you draw will be made of the remaining string and the stack.

b) Parse the string 0 1 0 0 1 0 using the table.

Each time the stack changes, draw a new snap shot.

String: 0 1 0 0 1 0 $

Stack: $S

Write success or reject.

c) Parse the string 1 0 1 using the table.

Each time the stack changes, draw a new snap shot.

String: 1 0 1 $

Stack: $S

Write success or reject.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago