Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CSE 340 Fall 2017 Homework 1 Assigned 8/30/2017. To be submitted electronically on Blackboard Due: 11:59 PM on 9/6/2017. Your solution can be handwritten or
CSE 340 Fall 2017 Homework 1 Assigned 8/30/2017. To be submitted electronically on Blackboard Due: 11:59 PM on 9/6/2017. Your solution can be handwritten or typed or a combination. In all cases, it should be neat. If it is handwritten, it should be clearly readable. The graders will not be able to grade what they cannot read Note in all problems, the dot operator of regular expressions is omitted Consider the following four regular expressions R1=(a+b)*c(a+D)"ca* R2 = (a+b)2(a-b)2(a+b)" Re = (a+b)2(a+b)*C*(a+b)* Ra = (a+b)"C"(a+b)*c(a+b)" . . Assuming we have a function getToken that returns a token which consists of two fields: a token_type and a lexeme. Assume that calling getToken) when the end of input is reached returns a token whose token type is EOF 1. Give an input for which two successive calls to getToken() returns two tokens whose 2. Given an input for which two successive calls to getToken) returns two tokens 3. Given an input for which two successive calls to getToken) returns two tokens 4. Given an input for which two successive calls to getToken() returns two tokens 5. Explain why there is no input for which getToken) returns a token whose token_type token_types are R1 and EOF respectively whose token_types are R2 and EoF respectively whose token_types are R3 and EoF respectively whose token_types are R4 and EOF respectively IS ll. Let R1 and R2, be two regular expressions. Is it always the case that L((R-*+R*)*) = L((R1+R2)? Explairn III Consider the following three regular expressions Assume the getToken) function is called twice on input aabcabbc. What tokens are returned? Show you work in a step by step execution (including MATCHED, VIABLE, MAXIMAL, and the token returned)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started