Rewriting with Layout

Mark van den Brand, Jurgen J. Vinju · 2012

Rewriting technology has proved to be an adequate and powerful mechanism to perform source code transformations. These transformations can not only be eciently implemented using rewriting technology, but it provides also a rmer grip on the source code syntax. However, an important shortcoming of rewriting technology is that source code comments and layout are lost during rewriting. We propose \\rewriting with layout" to solve this problem. We present a rewriting algorithm that keeps the layout of sub-terms that are not rewritten, and reuses the layout occurring in the right-hand side of the rewrite rules. 1 Introduction Rewriting technology has proved to be an adequate and powerful mechanism to tackle all kinds of problems in the eld of software renovation. Software renovation is to bring existing source code up to date with new requirements. One of the techniques applied in this eld is source code transformation. Source code transformations are simple syntactic transformat...

Read the paper · More papers on PaperTik