A lexical analyzer uses the following patterns to recognize three tokens , , and over the alphabet .
: a? (b|c)* a
: b? (a|c)* b
: 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.
If the string bbaacabc is processed by the analyzer, which one of the following is the sequence of tokens it outputs?
- (A)
- (B)
- (C)
- (D)
