Tm is a preprocessor that takes a code template and some datastructure definitions, and generates source code for an arbitrary programming language. Thus, by using Tm you can have templates in any programming language. Tm is particularly useful for generating Abstract Syntax Trees (ASTs).
The kernel distribution package of Tm contains extensive C templates and a support library that have been tested and used extensively in the past decade. These templates have been used in more than ten medium-scale and large programming project, mainly to generate abstract syntax trees in various compiler projects.
Tm is flexible enough that useful templates can be written for any sufficiently powerful programming language. Pascal and Miranda templates are offered as separate downloadable packages, but templates have also been written for Lisp, the functional programming language Clean, C++, Java, and the Bourne shell, although these templates were specific to a particular project. Templates for other functional language, and languages such as Fortran 95, are also eminently possible.
By using templates, especially the standard templates, you can reap the usual benefits: the code is re-used more intensively, is therefore tested more intensively, better documented, and standardised.
Most Tm software is licensed under the GNU General Public License (GPL); the code templates and libraries are licensed under the GNU Library public license (LGPL). This means that the output of Tm can be used in any program, no matter what the license is.
Examples of Tm data structure definitions, templates and generated code are shown on the examples page. Tm software can be downloaded from this site, but please refer to the documentation page first.
Last modified Thursday 12 April 2007 14:11:41 UT by Kees van Reeuwijk.