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 ;)What makes you think that such precise parser doesn't exists yet? :)
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)
What makes you think that such precise parser doesn't exists yet? :)
The ANTLR (http://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 (http://www.refpp.com/), 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 (http://www.jetbrains.com/idea/training/demos/overview.html), 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).
ddiego has modified ANTLR a little for easier usage in CodeCompletion, along with ucpp, ctags and sqlite, see here: http://vcfbuilder.org/?q=node/139What makes you think that such precise parser doesn't exists yet? :)
The ANTLR (http://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 (http://www.refpp.com/), 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 (http://www.jetbrains.com/idea/training/demos/overview.html), 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).
:shock: Seems quite optimistic (it looks like my knowledge is outdated in c++ parsing). But why we don't use ANTLR for CodeCompletion parser? There's whole C++ grammar available for free, few small modifications could make it really usefl in codecompletion case. Ive looked into forums but haven't found real explanation why it is not used yet in C::B
a::b<c,d>::e<f,g> (h<i,j>::k) = reinterpret_cast<o>(l(--m++).n ...
Sounds great. But I hope it won't break in expressions like:You are more then welcome to download CodeLite and test it using the supplied demo.
Code:
a::b<c,d>::e<f,g> (h<i,j>::k) = reinterpret_cast<o>(l(--m++).n ...
Wink (Yop, I'm really waiting for some unbreakable tool)
Is there any estimated time when we could find out how these libraries work ?
ddiego has modified ANTLR a little for easier usage in CodeCompletion, along with ucpp, ctags and sqlite, see here: http://vcfbuilder.org/?q=node/139
and he's making it a standard library for using in any IDE. The repository is here: https://svn.sourceforge.net/svnroot/classdom
Of course a hybrid solution is possible (combining ctags & antlr), like what ddiego is doing with "ClassDOM".
The problem with ClassDOM is that its a pure iso c/c++ library, so no wxWidgets facilities.
Not for parsing, but for the GUI and crossplatform bits...
ddiego has modified ANTLR a little for easier usage in CodeCompletion, along with ucpp, ctags and sqlite, see here: http://vcfbuilder.org/?q=node/139
and he's making it a standard library for using in any IDE. The repository is here: https://svn.sourceforge.net/svnroot/classdom
Of course a hybrid solution is possible (combining ctags & antlr), like what ddiego is doing with "ClassDOM".
The problem with ClassDOM is that its a pure iso c/c++ library, so no wxWidgets facilities.
I personally think that you don't need wxWidgets at all for parsing.
Maybe some should write a wrapper to make it easier to access from wxWidgets.And that' is what is CodeLite for, it wraps everything in one library and gives you the parsed tree and GUI chores, for example as a derived wxTreeCtrl with all the symbols, or call tips strings for feeding your wxScintilla (or whatever) component.
crossplattform isn't only wxWidgets. Actually, for everything else then GUI you can use other libraries, withI personally think that you don't need wxWidgets at all for parsing.Not for parsing, but for the GUI and crossplatform bits...
The parsers itself (ctags and flex) doesn't even requieres a c++ compilers, since it's plain c.
Neither for sqlite3, it's plain c too. I hope you don't wonder why wxSQlite3 exists. :wink:
I've taken a look at it. Looks pretty nice :)Maybe some should write a wrapper to make it easier to access from wxWidgets.And that' is what is CodeLite for, it wraps everything in one library and gives you the parsed tree and GUI chores, for example as a derived wxTreeCtrl with all the symbols, or call tips strings for feeding your wxScintilla (or whatever) component.
But why isn't there a namespace for the lib?
And what license does it have?
I personally think that you don't need wxWidgets at all for parsing.CodeLite is more than pure C++ parser library, it provides many other facilities, which aimed for wxWidgets applications, such as:
what feature do you mean. Fact that all occurrences are highlighted, CB does that.
But in CB you can not set the minimum number of characters (I think it is 4, would be better if this is a setting). Like in the screenshot example above, 3.
By the way, what does the red underlining stand for ?