Program transformation

Program transformations may be specified as automated procedures that modify compiler data structures (e.g. abstract syntax trees) representing the program text, or may be specified more conveniently using patterns or templates representing parameterized source code fragments.

This usually requires integration of a full front-end for the programming language of interest, including source code parsing, building internal program representations of code structures, the meaning of program symbols, useful static analyses, and regeneration of valid source code from transformed program representations.

The problem of building and integrating adequate front ends for conventional languages (Java, C++, PHP etc.)

may be of equal difficulty as building the program transformation system itself because of the complexity of such languages.

To be widely useful, a transformation system must be able to handle many target programming languages, and must provide some means of specifying such front ends.