Tokens and Lexical Analyzers questions

Q37

GATE CS 2018 CSLexical AnalysisMCQ2 marks−2/3 if wrong
A lexical analyzer uses the following patterns to recognize three tokens T1,T2T_1, T_2, and T3T_3 over the alphabet {a,b,c}\{a, b, c\}.

T1T_1: a?(b∣c)∗aa? (b|c)^* a
T2T_2: b?(a∣c)∗bb? (a|c)^* b
T3T_3: c?(b∣a)∗cc? (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.

If the string bbaacabcbbaacabc is processed by the analyzer, which one of the following is the sequence of tokens it outputs?
Show answer without attempting

Answer: D

0/10 correct0 marks