You see this is what the color higlighting is doing.
You type and in parallel it is trying to colorize the text.
After I'm not sure that you need agents running all the time
(reacting to each characters you type).
I would be you I would
�- prototype a hierarchy of classes whose instances have a kind of
patterns to know if they should be kick in
�- at the end of each line, I would send the line to a list of such
"agent" and react
��
- then only then, I would consider to fork the behavior of the
agents. why? because when you can avoid concurrency this is simpler
:)