hacked up a code generator - or at least the main bits of code that would be tedious to rewrite.