A High-Level IR Transformation System
- Cite this paper as:
- Jordan H., Thoman P., Fahringer T. (2014) A High-Level IR Transformation System. In: an Mey D. et al. (eds) Euro-Par 2013: Parallel Processing Workshops. Euro-Par 2013. Lecture Notes in Computer Science, vol 8374. Springer, Berlin, Heidelberg
The development and implementation of source-to-source code transformations based on high-level intermediate representations (IRs) is a labor-intensive, error-prone task. It tends to result in large code bases which are hard to read and maintain. Although not encountered within widely used source-to-source compiler infrastructures, transformation systems tackle this issue by utilizing declarative descriptions of unification-based term rewriting rules. However, unification lacks the ability of (arbitrarily) deep term inspection and is limited to tree nodes exhibiting a fixed arity – a property not generally satisfied by high-level IRs or programming languages.
In this paper we present a declarative tree transformation system which exceeds the expressiveness of conventional unification based systems by operating on arbitrary tree structures.We define its formal foundation, describe its implementation within the Insieme compiler project and provide real-world code examples. The latter demonstrate the expressive power, usability and intuitiveness of our solution.
KeywordsCompiler Program Transformation Term Rewriting Pattern Matching Regular Expressions
Unable to display preview. Download preview PDF.