Abstract. Data-flow transformations used in optimizing compilers are also useful in other programming tools such as code generators, aspect weavers, domain-and application-specific optimizers, and refactoring tools. These applications require source-to-source transformations rather than transformations on a low-level intermediate representation. In this paper we describe the composition of source-to-source dataflow transformations in the program transformation language Stratego. The language supports the high-level specification of transformations by means of rewriting strategy combinators that allow a natural modeling of data-and control-flow without committing to a specific source language. Data-flow facts are propagated using dynamic rewriting rules. In particular, we introduce the concept of dependent dynamic rewrite rules, for modeling the dependencies of data-flow facts on program entitities such as variables. The approach supports the combination of analysis and transformation, the combination of multiple transformations, the combination with other types of transformations, and the correct treatment of variable binding constructs and lexical scope to avoid variable capture.
Olmos et al. introduce "dynamic rewrite rules" to model run-time dataflow facts, which allow for context-sensitive transformations and the combination of transformations and analyses REF .
Composing source-to-source data-flow transformations with rewriting strategies and dependent dynamic rewrite rules
14TH INTERNATIONAL CONFERENCE ON COMPILER CONSTRUCTION (CC’05), VOLUME 3443 OF LECTURE NOTES IN COMPUTER SCIENCE
Computer Science