Code generation tool