Code generation framework