A Tutorial on Using JET for Model to Text transformations

JET is an plug-in for Eclipse that is used to implement a "code generator".
It uses JSP-like template files that can be edited to any kind of source code to which a given model is to be transformed.
For this tutorial we will be transformning a model represented as a set of prolog facts.

The following are useful links to help you get started:

JET plugin

You can also run an instance of Eclipse using a feature that we developed to implement the model to text transformation with fewer steps.
These are the steps to get started with the plugin:

Install JET


This video illustrates the above steps

Create a JET project


Consider downloading the project for this tutorial here. This is to make it easier for you to copy the code instead of writing it from what we show in the videos. This video illustrates the above steps
This video illustrates the above steps

Create the parser for the input model file


This video illustrates the above steps

Convert the project to a JET project


This video illustrates the above steps
This video illustrates the above steps

Create the JET Template


This video illustrates the above steps

Run the JET template and Generate Source Code


To run our template and generate the source code from the prolog model, we need to create a Java class that will contain a main method. It is recommended that you watch the videos since they contain explanations of the code and its meaning. This video illustrates the above steps
This video illustrates the above steps

Run Eclipse with plugin


This video illustrates the above steps

Create a JET project (plugin eclipse version)


Use the eclipse instance that was creating in the previous step (Run Eclipse with plugin).

Convert the project to a JET project (plugin eclipse version)

This video illustrates the above steps

Edit Template (plugin eclipse version)


This video illustrates the above steps

Run project (plugin eclipse version)


This video illustrates the above steps