It is not a generator, but @tonberg's framework might be useful for someone looking for a code generator.