I am back on track! I have now implemented the changes to my parser. I have done a lot of tests and I think the parser works as wanted. I will however do some more tests to be sure. But it is nice to have most of the work out of the way. I think I will release the parsers (both the old and the new improved parser) together with the thesis later. The parser code is kind of ugly, but it works. The code is ugly because it is a one time fast implementation (I hope that I never need to do a fast hack like this again).
I release that I have not explained what the parser actually do. The parser is actually a type/mode checker for an expansion of the programming language Java. The expansion is a mode system for expressing that a reference to an object only can be used to read an object and not change the state of that object. This is the short version of what the parser do. If you are interested, you can always read the thesis when it is ready.