
See Our team
Wondering how we keep quality?
Got unsolved questions? Ask Questions
GATE
GMAT
CBSE
NCERT
Career
Interview
Railway
UPSC
NID
NIFT-UG
NIFT-PG
PHP
AJAX
JavaScript
Node Js
Shell Script
Research
A lexical analyzer uses the following patterns to recognize three tokens T1, T2, and T3 over the alphabet {a,b,c}. T1: a? (b|c) ∗a T2: b? (a|c) ∗b T3: c? (b|a) ∗ c Note that ‘x?’ means 0 or 1 occurrence of the symbol x. Note also that the analyzer outputs the token that matches the longest possible prefix.
String to be generated :- bbaacabc
The regular expressions :-
T1 : (b+c) * a + a ( b + c ) * a
T2 : (a+c)* b + b ( a + c ) * b
T3 : (b + a) * c + c ( b + a ) * c
lets see which regular expression generations the longest possible prefix
String = bbaacabc
T1 : bba
T2 : bb
T3 : bbaac
So , as we can see T3 is generating the longest possible prefix here
Now , again in the string (abc) also need to be generated , lets check which regular expression generates (abc).
T1 : end with a , but we want to end with c – so abc not possible
T2 : end with b , but we want to end with c – so abc not possible
T3:- (b + a ) * c – ending with c and also b and a can be generated inside the closure – so , yes T3 can generate abc.
Therefore total string (bbaacabc) is generated using T3T3.
So, Answer is option (D) T3T3
We made eduladder by keeping the ideology of building a supermarket of all the educational material available under one roof. We are doing it with the help of individual contributors like you, interns and employees. So the resources you are looking for can be easily available and accessible also with the freedom of remix reuse and reshare our content under the terms of creative commons license with attribution required close.
You can also contribute to our vision of "Helping student to pass any exams" with these. Answer a question: You can answer the questions not yet answered in eduladder.How to answer a question Career: Work or do your internship with us.Work with us Create a video: You can teach anything and everything each video should be less than five minutes should cover the idea less than five min.How to upload a video on eduladder