Metaprogramming
Metaprogramming describes the programming paradigm of writing programs that output programs. Metaprograms generate source code in some form and can also have the source code of other programs as their input. Code generation thus is one aspect of metaprogramming.