473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

C++ Refactoring Tool

Hello together,

just a year ago I was searching arround for a tool supporting refactoring
for c++.
I've seen implementations for java and was impressed how an IDE can help
with
such a feature.

Just rename classes / member / parameter with a mouse click.
reduce the size of a method by transforming parts of it into a seperate
function
(just by selection and 'do-refactor-out').

But than the bad news - no C++ IDE does support that. Can you imagine why ?
Two arguments I've seen during web search:

- "C++ syntax parsing is hard" I must say - yes it is. Parser
generators don't get it completly.
- "C++ has this nasty preprocessing" Am, yes that makes it a little bit
harder
- "c++ has these template things" Well, declaration constructs can
be a little bit more complex ;)

However, I finally found a project targeting the problem. It is called
"CppTool" on Sourceforge.
A name not very impressive and it started in late 2001. After one year
discussion about how to write
a full c++ parser. Some new members created an idea which convinced me.
Baptiste Lepilleur
(see CppUnit activities) created the idea of doing "lazy parsing". It is a
hand written parser, which is
able to parse only fragments of the code - this is great, since that enables
us to parse only these parts
which we need to know about. An example:

let's say, we know that we are inside a compound statement. that enables us
to seperate all
declaration and statements just by searching for ';' Next step is to decide
if it's a
declaration or statement.

Well, and what to say - after 3 month we have this parser can handle full
files. Not yet getting
all the details, but this is just a question of time.

You will ask - what is there now ?
Important thing first:
- we implemented some simple refactoring (e.g. local variable rename,
split declaration)
- we have an integration for Eclipse and Visual-Studio.
- we are open to any IDE (as long as the IDE is open for
plugin/extensions)

What about these nasty C++ things ?
- the parser does create an AST for C++ Sources
- templates in programs can be parsed
- preprocessing has solved for simple macro replacements
(we keep them as long as they do not conflict a refactoring)

After all, we are only two active programmers. Don't you want to take part
in this
important project ? Just read the mailing lists "cpptool-develop Archive" or
contact
me. I would like to send a first example of the plugins to you.
Check out the sources, well there's much. But just ask me to seperate
important things...

Don't you think that this will be worth ?

See you soon at CppTool: https://sourceforge.net/projects/cpptool/

André Baresel
(netmemberab)

----------------------------------------------------------------------------
-------
btw) if you scan through the net in todays time you will also see that the
eclipse project CDT is targeting refactoring, unfortunatly i don't see
progress
on this front and they have even not solved the basic problems. The mile
stones
tell that some very basic rename feature is planned for summer 2004.
However,
I have seen such point also on the time table for this year 2003 - ... I
really like
eclipse, however what is with all there programmers working with borland /
visual studio
because of this COM/ActiveX features.

Jul 22 '05 #1
0 1947

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Peter Dembinski | last post by:
I am trying to write Master Thesis on refactoring Python code. Where should I look for information? -- http://www.dembiński.prv.pl
0
by: Andre Baresel | last post by:
Hello together, just a year ago I was searching arround for a tool supporting refactoring for c++. I've seen implementations for java and was impressed how an IDE can help with such a feature....
2
by: Sachin Garg | last post by:
Hi, I was trying to find (like many others here) a tool for refactoring C++ code as I have lately been noticing that I spend most of my coding time doing refactoring and some refactoring which...
6
by: Dean Ware | last post by:
Hi, I am part way through developing a C++ application. I am developing it on my own and using VC++ 6.0. I am now at the stage where I wish to start tidying up my code. I have lots of...
15
by: Simon Cooke | last post by:
Does anyone know of any tools for refactoring header files? We're using a third party codebase at work, and pretty much every file includes a 50Mb precompiled header file. I'm looking for a tool...
2
by: HendrikLeder | last post by:
Hello everybody :-) Next year I`ll write my diploma in computer science for business (It`s a degree in Germany) and I`ve some questions about the topic. The diploma will handle about refactoring...
1
by: Spam Catcher | last post by:
Hi all, Do you guys have a suggestion on the best refactoring tool for VB.NET? I've briefly looked at MZ-Tools. I'm currently testing out Refactor! (free MSDN SE version). Any other tools I...
13
by: Richard | last post by:
What to do when the best laid plans change and mazes of legacy are abolished, simplified, or built anew for contemporary reality. A preliminary database was developed for tracking material...
9
by: Kowalski | last post by:
I want to move a class from one namespace to another. Do you know any refactoring tool with such a feature? -- BK
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.