User forums > Announcements

I'm afraid I don't have much time to work on C::B....

<< < (3/3)

That something is designed only to be compiled on *nix systems does not preclude modifying it to be compiled with MinGW32/GCC. :)
I indeed failed to mention ANTLR, for which there is a C++ grammar available for download from the website (no modifications necessary to ANTLR itself). If the grammar and associated constructs were written right, it could be a leaner and meaner option than the three I already mentioned; but getting a semantically viable C++ grammar and parser going is a ton of work.

To expand a bit on the original three --

Synopsis was my first choice. It includes a C++ API out-of-the-box (Synopsis' primary design is as a Python module, but the C++ API does not require it) that would (IMHO) be fairly simple to drop into a code completion / visual assist framework. Also, it is ADVERTISED as being compilable by Windows compilers using the Python build system. Unfortunately, this is incorrect; various *nix shell commands are invoked throughout the build process and I *think* I remember some inexplicable crashes even when I hacked through it with MSys (originating from the garbage collector IIRC, so the non-garbage-collection version is an option). Some code modifications *might* be necessary.

Elsa was my second choice. Unfortunately it explicitly DOESN'T compile out-of-the-box on MinGW32 (there is pthreads code throughout, and the build system requires a *nix shell), and it is also designed to be a full C++ parser, which means it carries a lot of extra baggage we don't need that would slow it down. The build system is of course entirely *nix; you need a shell and Perl and there were some weird invocations in the script that were incompatible with MSys (we can't use Cygwin for obvious reasons).

OpenC++ was my third choice, but it also is designed entirely for *nix systems at this point (as nearly as I can tell, because the documentation is poor). I didn't try very hard to get it working.

Parser generators were my last choice, because building a parser by hand is a lot of hard and unrewarding work. Computers and other people DON'T think about C++ the same way you do.

Hope some of that helps. Cheers,
Twilight Dragon

I ended with your conclussions more or less:

-Synopsis: Great and light parser but not so tested on win32.
-Elsa: Advanced parser based on a parser generator. Doesn't compile on ming32.
-OpenC++: Discarded because is not actively mantained.
-PCCTS 1.33: It was original ANTLR, written in C, not mantained anymore.
-ANTLR C++ 3.1: Almost the best solution, a C++ parser generated from ANTLR. Very actively mantained. Works out-of-the-box on mingw32, MSVC, GCC, etc.
-CodeStore: This is what we need.

So, what is CodeStore? From VCF Builder site:
The C++ parser is based on the ANTLR parser generator project. The C++ grammar is based on the work done by Terrence Parr, Sumana Srinivasan, and Russell Quong in PCCTS, then modified for ANTLR by Jianguo Zuo and David Wigg. I've made a few minor modifications myself as well. This grammar expects pre-processed C++, so I had to find a C pre-processor library. For that I used the ucpp library by Thomas Pornin. I've made some more modifications to this as well, mainly in the form of adding the ability for callbacks to be invoked at various times during the pre-processing.

All of this work is being made into a generic library I call the CodeStore. This is being done so that there exists a usable (hopefully) C++ parser that exists in library form that people can use to deal with parsing C++ and generating an AST from this.

So it's what we need, because it's a library with the purpose of serving to a codecompletion or symbols browser thing.
It's being used in VCF Builder, another open-source IDE, written using VCF, which is an advanced C++ GUI framework (like wxWidgets) which is completely cross-platform.

So far, I've tried to compile CodeStore from Code::Blocks using ming32 and it compiles almost out-of-the-box.
You only need to import the MSVC workspace and it's ready to use.

Here's an screenshoot of CodeStore working on VCF Builder:

So, what do you think?

Looks good :-)


[0] Message Index

[*] Previous page

Go to full version