NOBRAINER: A Tool for Example-Based Transformation of C/C++ Code

Владимир Васильевич Савченко, K. S. Sorokin, И. Е. Бронштейн, Alexander Sergeevich Volkov, Vladimir Vladimirovich Kachanov, Georgiy Pankratenko, M.K. Ermakov, Sergey I. Markov, Alexander Vyacheslavovich Spiridonov, I. V. Aleksandrov · Programming and Computer Software · 2020

Abstract Refactoring is an integral part of the modern software development process. Often, the refactoring must be performed at the global level with modifications in a large number of files. Making these modifications is a long and painstaking work. However, users rarely employ automated tools for this purpose because they consider them unreliable and difficult to use. In this paper, a new tool for transforming the source code is described. It is based on the intuitively clear specification of transformation rules in the form of short code fragments in C or C++. These rules describe the code before and after the transformation. We believe that, due to the absence of additional abstractions (such as domain-specific languages), this approach can be easily used in practice. Even though the tool uses source code templates, it operates on the level of the abstract syntax tree. This enables the tool to better analyze the code and verify the validity of transformations.

Read the paper · More papers on PaperTik