Chapter 1. Introduction to KET

KET is based on the JET [1] [2] engine enhanced by the syntax of Kermeta for the model navigation. It is also very similar to Velocity or JSP. This is a user-friendly text-based template engine wich generate text from a KET template and a model. Templates are composed of two main elements: text that should be written in the output and tags that are interpreted to generated string values from some computation. Once templates are ready to be compiled, they are interpreted by the template engine. It creates a new Kermeta file that declares a generator as a generate(params) method.

[Warning]Warning

Using KET is efficient when templates contains more text that expressions (i.e. a text with holes). If you need more computation than text, you should consider writing a pretty printer directly in Kermeta [3] .

[Tip]Tip

Since everything goes down to a kermeta code, you can also combine the approaches KET/kermeta pretty printer



[1] http://www.eclipse.org/modeling/m2t/?project=jet#jet

[2] http://help.eclipse.org/ganymede/index.jsp?nav=/27

[3] Writing a pretty printer is a kind of visitor which is quite ease to write thanks to kermeta aspects.