Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Refactoring tool?

(1/4) > >>

Ptomaine:
Maybe it is time to implement the Refactoring plug-in?
Maybe it has to be an additional functionality of the "code completion" plug-in?
Maybe it has to be a separate plug-in based on the code of the "code completion" plug-in?

What do you think?

tiwag:
Be patient!
You'll get it it when it is implemented ...

Game_Ender:
Its been time for that in the C++ world forever, no one will disagree.  C++ is just not a langauge that likes to be parsed so its difficult.

byo:
Making refactoring tools for c++ could take years in company where everybody works 8 hours (or more) a day. And I guess we don't have such possibilities ;)
C++ from parser-point-of-view is really a nightmare (I've been working on such parser some time ago but it took to much time).  And such tool can not be done to work just for some easy cases. You have to take care of scopes / types / templates (it's even hard to say whether statement is declaration or not,even standard says so, and #if... #else blocks - I can't even imagine what cases should be taken into consideration here).
Without precise parsing, you can forget about stl and other nice thigs. Refactoring tool would simply mess up your code.
Because of such problems, other languages (like D, java or C#) were created. They are really easy to parse and modify.
Maybe refactoring tool for c++ is just a matter of time (after reading svn logs I'm more optimistic about that ;)). But if we could make refactoring tool we could also be able to create our own c++ compiler (wow, that would be something :D)

takeshimiya:

--- Quote from: byo on September 11, 2006, 11:42:41 pm ---Making refactoring tools for c++ could take years in company where everybody works 8 hours (or more) a day. And I guess we don't have such possibilities ;)
C++ from parser-point-of-view is really a nightmare (I've been working on such parser some time ago but it took to much time).  And such tool can not be done to work just for some easy cases. You have to take care of scopes / types / templates (it's even hard to say whether statement is declaration or not,even standard says so, and #if... #else blocks - I can't even imagine what cases should be taken into consideration here).
Without precise parsing, you can forget about stl and other nice thigs. Refactoring tool would simply mess up your code.
Because of such problems, other languages (like D, java or C#) were created. They are really easy to parse and modify.
Maybe refactoring tool for c++ is just a matter of time (after reading svn logs I'm more optimistic about that ;)). But if we could make refactoring tool we could also be able to create our own c++ compiler (wow, that would be something :D)

--- End quote ---
What makes you think that such precise parser doesn't exists yet? :)

The ANTLR parser generator (C++ binary and C++ grammar) is the best - most correct I could find.
There are lot's of programs using it for C++ refactoring, code coverage, code analysis, etc.

This parser generator is so powerful that is being used for language translations (ie. from Java to C and viceversa).
If you wonder what parser the IntelliJ IDEA guys are using for one of the best existing refactoring tools, you guessed right, it's ANTLR too.

So yes, refactoring C++ is not only possible but doable without "taking years in company where everybody works 8 hours (or more) a day"  :wink: That is, if you choose the right parser instead of creating your own (ANTLR took 15 years :D).

Navigation

[0] Message Index

[#] Next page

Go to full version