Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following regular expressions: R1 = b+c+d+e+f R2 = a+b+c+d+e+f R3 = (a* +b* )(a+b) R4 = (a+b)* R1 (a+b) R5 = a.a R0

Consider the following regular expressions:

R1 = b+c+d+e+f

R2 = a+b+c+d+e+f

R3 = (a* +b* )(a+b)

R4 = (a+b)* R1 (a+b)

R5 = a.a R0 * (a+b)*

R6 = R3 * R2 * a.a.a

Let getToken() be a function that returns the next token in the input. If its called repeatedly it will return one token after another. When all the input is consumed, geToken() returns EOF (end of file). Assume that longest prefix-matching rule is used, also assume that ties are broken in favor of the regular expression listed first in the list.

- Give an example of input for which getToken() returns R0

- Give an example of input for which getToken() returns R1

- Give an example of input for which getToken() returns R2

- Give an example of input for which getToken() returns R3

- Give an example of input for which getToken() returns R4

- Give an example of input for which getToken() returns R5

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 Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago