You could do worse than starting out reading this book:
http://www.cs.wustl.edu/~schmidt/POSA/POSA2/[
^]
It will not give you the answer, but it will enable you to understand how these things are usually done. Since you are writing a thesis, I would guess that you will have to understand the why of things, much more than the how.
You can also take a long look at
ACE[
^]
Good luck :)
Regards
Espen Harlinn