Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The tool should be able to perform simple tasks like renaming a class or functio

ID: 661201 • Letter: T

Question

The tool should be able to perform simple tasks like renaming a class or function. It should be usable by cross-platform open source projects, so that rules out anything Visual Studio based. However, proprietary software that is free to use by open source projects is okay, as long as there's a release for all the important platforms(windows, GNU/linux, mac OS X).

The tool should ensure that the refactoring is semantically correct, i.e. it shouldn't just do a plaintext find/replace.

The clang project is working on an API suited for the creation of such tools,

Explanation / Answer

The Eclipse CDT tool would seem to match your requirements.

It has rename facilities, and a number of other refactoring operations.

It is open source itself, so you can use it as you like on open (or closed source).

I doubt its refactoring is semantically correct in a narrow sense. C++ is an extremely complex language and changing it is difficult to do accurately under all circumstances (consider renaming of some templated class whose definition depends on a complex template instantiation). That said, I think the CDT refactoring machinery is based on carefully constructed progam parsing, analysis and transformations implemented using compiler-like methods; it is not "a plaintext find/replace".

I have no personal experience with this tool. However, I do build program transformation tools as a living, including those that transform C++ (but would not be a legitimate answer to the "available refactoring tool" or "free to use on open source" requirements). Having a keen interest in the technology behind such tools, I have personally visited and talked to the people that work on the refactoring aspects of the CDT (Peter Sommerlad's team), and have great respect for their skills in building such tools.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote