Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

parser library: ELL is quite simple and useful

<< < (2/3) > >>

ollydbg:

--- Quote from: oBFusCATed on April 29, 2010, 02:40:25 pm ---
--- Quote from: ollydbg on April 29, 2010, 02:20:39 pm ---Thanks for the hint. I just remembered that we have discussed clang some months ago. Eran (the author of Codelite IDE) said that Clang is not fully support C++. see here Re: modify codecompletion plugin to macro parser.

--- End quote ---
Yes, it doesn't have full support, but there is great progress...
See here: http://clang.llvm.org/cxx_status.html


--- End quote ---

Ok, I have see that webpage. It seems the C++ grammar is quite complex, and for Clang there are still a lot of thing to do. I just learned that Clang is a "full c/c++ compiler front end", so, I'm not sure the parsing performance is still good enough.(As the official clang site said is is 3X faster than GCC/G++).

Also, For parser a C++ source, Clang still need a separate "preprocessor" stage. (Macro expansion, header file including). So, this is still not the best parser for an IDE. Because in my mind, a good parser for CodeCompletion plugin should have "simultaneously preprocessor handling when parsing".

oBFusCATed:

--- Quote from: ollydbg on April 29, 2010, 03:43:24 pm ---Ok, I have see that webpage. It seems the C++ grammar is quite complex, and for Clang there are still a lot of thing to do. I just learned that Clang is a "full c/c++ compiler front end", so, I'm not sure the parsing performance is still good enough.(As the official clang site said is is 3X faster than GCC/G++).

--- End quote ---
The only way to tell if it is fast enough is to test it...


--- Quote from: ollydbg on April 29, 2010, 03:43:24 pm ---Also, For parser a C++ source, Clang still need a separate "preprocessor" stage. (Macro expansion, header file including). So, this is still not the best parser for an IDE. Because in my mind, a good parser for CodeCompletion plugin should have "simultaneously preprocessor handling when parsing".

--- End quote ---
Why?
Also you can contact the clang guys and they can improve things, here and there... or explain to you why they've done something the way it is done.

ollydbg:

--- Quote from: oBFusCATed on April 29, 2010, 08:28:33 pm ---
--- Quote from: ollydbg on April 29, 2010, 03:43:24 pm ---Also, For parser a C++ source, Clang still need a separate "preprocessor" stage. (Macro expansion, header file including). So, this is still not the best parser for an IDE. Because in my mind, a good parser for CodeCompletion plugin should have "simultaneously preprocessor handling when parsing".

--- End quote ---
Why?
Also you can contact the clang guys and they can improve things, here and there... or explain to you why they've done something the way it is done.


--- End quote ---
aha, yesterday, I have contact the author of ELL library. We have a discussion about parsers for CodeCompletion. He also mentioned using clang to parse the C++ source code.

The author of Ell library said

--- Quote ---Yes, or perhaps have a look at LLVM C++ frontend. But, the problem of parsing for an IDE is suitable different than the one of parsing for a compiler, because unparsing must be non-intrusive. The main problem at parsing C/C++ is the presence of C preprocessor. I'm convinced that parsing the result of preprocessing is not the right approach for code-completion or code-refactoring tools.

To work around this problem, last year I plan to implement a C/C++ event-oriented parser (using libELL) whose grammar would embed the grammar of C preprocessor. Maybe this is what you need, and we could work together on it.
--- End quote ---

These days Loaden and I was discussing adding the "handling conditional preprocessor" in the CC plugin. Even though it it not a FULL preprocessor,  it can still solve a lot of problems. I think the testing stage should begin after the "stable release".

Also, the ELL library is a light and fast compare to the Boost spirit library. So, if we use ELL, we don't need to let CB depend on Boost libraries.

ollydbg:
reminder:
seems all C++ stuff in the "parser" stage was finished.

see :

http://clang.llvm.org/cxx_status.html

I'm not sure how to use Clang library in MinGW... I need at least to build Clang under msys/mingw.

oBFusCATed:
Yes you need to do that, at least :)

You can install some linux that has it as a package :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version