Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: CodeEditor, Assist++, Topic++ » C++ Parser
C++ Parser [message #33939] Wed, 28 September 2011 14:03 Go to next message
unodgs is currently online  unodgs
Messages: 1355
Registered: November 2005
Location: Poland
Senior Contributor

Qt developers wrote today (http://labs.qt.nokia.com/2011/09/28/qt-creator-editor-news/) that they're experimenting with clang as a parser for intellisense. It seems to be a good idea because clang supports "fuzzy parsing". Maybe we should follow the same way?
Re: C++ Parser [message #33940 is a reply to message #33939] Wed, 28 September 2011 14:11 Go to previous messageGo to next message
unodgs is currently online  unodgs
Messages: 1355
Registered: November 2005
Location: Poland
Senior Contributor

Here is a plugin for vim that uses clang for autocompletion
https://github.com/Rip-Rip/clang_complete
Re: C++ Parser [message #33941 is a reply to message #33940] Wed, 28 September 2011 14:16 Go to previous messageGo to next message
unodgs is currently online  unodgs
Messages: 1355
Registered: November 2005
Location: Poland
Senior Contributor

This vim plugin seems to be very accurate:
http://zwiener.org/vimautocomplete.html
Re: C++ Parser [message #33942 is a reply to message #33941] Wed, 28 September 2011 23:14 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12106
Registered: November 2005
Ultimate Member
Is it as fast as we need too?
Re: C++ Parser [message #33943 is a reply to message #33942] Wed, 28 September 2011 23:27 Go to previous messageGo to next message
unodgs is currently online  unodgs
Messages: 1355
Registered: November 2005
Location: Poland
Senior Contributor

mirek wrote on Wed, 28 September 2011 17:14

Is it as fast as we need too?

I'm gonna find out Smile (just built the newest version..)
Re: C++ Parser [message #33947 is a reply to message #33940] Thu, 29 September 2011 16:30 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 890
Registered: December 2006
Experienced Contributor
unodgs wrote on Wed, 28 September 2011 08:11

Here is a plugin for vim that uses clang for autocompletion
https://github.com/Rip-Rip/clang_complete


Thanks for a hint. Wink


Regards,
Novo
Re: C++ Parser [message #34157 is a reply to message #33947] Tue, 25 October 2011 14:27 Go to previous messageGo to next message
unodgs is currently online  unodgs
Messages: 1355
Registered: November 2005
Location: Poland
Senior Contributor

I did some further work on integration of clang and code editor. Here's the result Smile
index.php?t=getfile&id=3480&private=0
When I fix some bugs I will upload binaries here so everybody could see how it works.
I'm also trying to parse all the upp project functions/methods. When it's ready I'll publish the results about accuracy and speed of parsing. Anyway for now clang seems to be quite promising.
Re: C++ Parser [message #34159 is a reply to message #34157] Tue, 25 October 2011 17:36 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12106
Registered: November 2005
Ultimate Member
unodgs wrote on Tue, 25 October 2011 08:27

I did some further work on integration of clang and code editor. Here's the result Smile
index.php?t=getfile&id=3480&private=0
When I fix some bugs I will upload binaries here so everybody could see how it works.
I'm also trying to parse all the upp project functions/methods. When it's ready I'll publish the results about accuracy and speed of parsing. Anyway for now clang seems to be quite promising.


I believe that the real trouble is not C++ parser alone, working on single file, but how to make all files work together (with all macros and headers and such).

E.g. for Alt+J (jump to definition) to work, you need to keep track of all files...

Is this somehow solved in clang?

Mirek
Re: C++ Parser [message #34160 is a reply to message #34157] Tue, 25 October 2011 17:46 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1298
Registered: November 2005
Location: London, UK
Senior Contributor
Administrator
I have been also working on the ide upp Cpp code parsing and browsing improvement alternative and also using GridCtrl Smile. I tried to use clang for compiling upp on mac but it didnt work. Are you able to compile upp with clang?
Re: C++ Parser [message #34161 is a reply to message #34159] Tue, 25 October 2011 17:53 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 890
Registered: December 2006
Experienced Contributor
mirek wrote on Tue, 25 October 2011 11:36


I believe that the real trouble is not C++ parser alone, working on single file, but how to make all files work together (with all macros and headers and such).



AFAIK, clang is a real compiler, so, it has to parse all included files. The difference with gcc is that internal data structure is more high level and it stores more info for each parsed element. As a result you can use it not just to jump/navigate among files but also to regenerate file back (or to do some refactoring and generate files after that). It is a real parser an you have real type info about each node. The only question is performance. But XCode is based on clang and seems to work fine.


Regards,
Novo
Re: C++ Parser [message #34162 is a reply to message #34159] Tue, 25 October 2011 18:48 Go to previous messageGo to next message
unodgs is currently online  unodgs
Messages: 1355
Registered: November 2005
Location: Poland
Senior Contributor

Quote:

I believe that the real trouble is not C++ parser alone, working on single file, but how to make all files work together (with all macros and headers and such).

I had also #include <Core/Core.h> in the sample file and the speed was more than acceptable (especially the second time when files were cached by the system I guess). Besides clang supports precompiled headers what should make parsing fast enough even if lots of headers and macros are involved.
Integrating clang with upp is also very easy. It's only one file libclang.dll (4.7 MB) that has to be distributed with the rest of the framework.
Anyway I'll try to finish the demo and add the whole upp library with windows headers and see what the speed will be.
Re: C++ Parser [message #34163 is a reply to message #34160] Tue, 25 October 2011 18:52 Go to previous message
unodgs is currently online  unodgs
Messages: 1355
Registered: November 2005
Location: Poland
Senior Contributor

fudadmin wrote on Tue, 25 October 2011 11:46

I have been also working on the ide upp Cpp code parsing and browsing improvement alternative and also using GridCtrl Smile.

That's a great news! Could you share your sources?
Quote:

I tried to use clang for compiling upp on mac but it didnt work. Are you able to compile upp with clang?

On win64 clang exploded during compilation one of the upp's package (I used svn version not a stable one). But I'll keep on trying Smile
Previous Topic: Navigator buttons don't highlight very well
Next Topic: Change font color in tpp editor doesn't works
Goto Forum:
  


Current Time: Fri Nov 22 22:07:03 CET 2019

Total time taken to generate the page: 0.01336 seconds