engineering recuitment NIC NIELIT Scientist B 2023 Mock Test Compiler Design Lexical Analysis Regular Expression
Consider the below given table in which regular expression is mapped to unique token:
| Regular Expression | Token |
| p*(p | q)p* | 3 |
| qp* | 1 |
| p+(r | q) pq | 2 |
What will be the output when the string ''pppqppqprpqp" is scanned by the lexical analyzer if the analyzer outputs the token that matches the longest possible prefix if it is mandatory to use all the tokens at least once?
1
3121
2
3213
3
2133
4
3123