Thanks for the tips. Over the weekend I had a look at the source code of the cpp parser and the tests for it (which helped me a lot). I have it all working pretty well at the moment. I still need to look into preprocessing files. And it's a bit of work to make it all available in QtScript files