The generator used when generating code from UML models with AGX is also modeled and generated using UML and AGX.
Click on this image for a larger view.
The following model is used as a template when you use the wizard to build your own generator.
There are comments in the model to guide your way:
For an explanation of the terms scope and handler see Components of the transformation chain.