@inproceedings{KV08.pom, author = {Karl Trygve Kalleberg and Eelco Visser}, title = {Fusing a Transformation Language with an Open Compiler}, booktitle = {Proceedings of the Seventh Workshop on Language Descriptions, Tools, and Applications (LDTA 2007)}, pages = {21-36}, year = {2008}, editor = {A. Sloane and A. Johnstone}, volume = {203}, number = {2}, series = {Electronic Notes in Theoretical Computer Science}, issn = {1571-0661}, location = {Braga, Portugal}, month = {April}, publisher = {Elsevier}, project = {Stratego and XT and TFA and MoDSE}, urldoi = {http://dx.doi.org/10.1016/j.entcs.2008.03.042}, urlpdf = {http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2007-025.pdf}, urlldta = {http://www.di.uminho.pt/ldta07/}, abstract = {Program transformation systems provide powerful analysis and transformation frameworks as well as concise languages for language processing, but instantiating them for every subject language is an arduous task, most often resulting in half-completed frontends. Compilers provide mature frontends with robust parsers and type checkers, but solving language processing problems in general-purpose languages without transformation libraries is tedious. Reusing these frontends with existing transformation systems is therefore attractive. However, for this reuse to be optimal, the functional logic found in the frontend should be exposed to the transformation system - simple data serialization of the abstract syntax tree is not enough, since this fails to expose important compiler functionality, such as import graphs, symbol tables and the type checker. In this paper, we introduce a novel and general technique for combining term-based transformation systems with existing language frontends. The technique is presented in the context of a scriptable analysis and transformation framework for Java built on top of the Eclipse Java compiler. The framework consists of an adapter automatically extracted from the abstract syntax tree of the compiler and an interpreter for the Stratego program transformation language. The adapter allows the Stratego interpreter to rewrite directly on the compiler AST. We illustrate the applicability of our system with scripts written in Stratego that perform framework and library-specific analyses and transformations.}, keywords = {compiler scripting; strategic programming; program transformation}, group = {SE}, researchcode = {I-ISS-07}, }