Print Email Facebook Twitter Fusing a Transformation Language with an Open Compiler Title Fusing a Transformation Language with an Open Compiler Author Kalleberg, K.T. Visser, E. Faculty Electrical Engineering, Mathematics and Computer Science Department Software Technology Date 2007-12-31 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 halfcompleted 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. This paper is a pre-print of: K. T. Kalleberg and E. Visser. Fusing a Transformation Language with an Open Compiler. In A. Sloane and A. Johnstone, editors, Seventh Workshop on Language Descriptions, Tools, and Applications (LDTA’07), pages 18–31, Braga, Portugal, March 2007. To reference this document use: http://resolver.tudelft.nl/uuid:e7b28cd5-2589-40c3-a1fc-0b0e458de235 Publisher Delft University of Technology, Software Engineering Research Group ISSN 1872-5392 Source Technical Report Series TUD-SERG-2007-025 Part of collection Institutional Repository Document type report Rights (c) 2007 The authors. Software Engineering Research Group, Department of Software Technology, Faculty of Electrical Engineering, Mathematics and Computer Science, Delft University of Technology. Files PDF TUD-SERG-2007-025.pdf 211.01 KB Close viewer /islandora/object/uuid:e7b28cd5-2589-40c3-a1fc-0b0e458de235/datastream/OBJ/view