Use Astah software and design your model through one or
more UML class diagrams.
You can add custom stereotypes or
constraints to flag particular
classes, operations, attributes. The
latter will act as
transformation rules.

Write as many templates as you need. A template consists in 2 groovy files that let you customize
both the name and
the content of target files. NEW! It receives a UML
model or each class as parameter so
that you can turn it into text.

Code generation process iterates over UML model and each UML class and
each custom template. Any textual language can be generated !
To make code generation faster and easier, you can take advantage of
built-in functions and macros.