Masters of informatics project utilising the "Rose" source to source compiler framework.
The tools developed take a c++ source file as input and produce a new file with the tools rejuvenation applied.
Finds variable declaration and when applicable replaces the type with c++11 keyword auto that allows the compiler to infer the type. The transformation makes ensure that type information that cannot be infered by auto is preserved.
This rejuvenation locates for-loops that operate over containers such as arrays, and if the for-loop body does not alter the tranversal over the array, replace the standard for-loop with a ranged-based for-loop added in c++11.
An installed version of rose (0.9.10.64 was used during development), as the tools are compiled to dynamically link the rose libraries.
To compile rose from source follow the instruction on the rose homepage or use this more direct guide which is used to install rose onto a clean Ubuntu VM.
Alternatively you can download the precompiled ROSE binary.
IN ALL CASES REMEMBER TO ADD THE ROSE LIBRARIES TO YOUR PATH SO IT IS VISABLE.
All the tools presented are experimental and could have undesired effects, i.e Rose does not always preserve orginal source code syntax used when transforming C++ code (Rose Maual section 5.9).
- Rose tutorial, has many examples of the different tools that can be build from rose.
- Rose user manual