Code Generation, or the ability to automatically write code from some set of static data is done through the SRecode library. SRecode is a template manager that uses the semantic infrastructure to support common concepts across multiple languages.
To effectively create a code-generation library, you need to configure semantic. Read see Semantic Configuration. for more.
Secondly, you will need to configure SRecode. Read see SRecode Manual;
Once installed, you can jump right in to writing your Lisp and see Template Writing.