User forums > Announcements

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

<< < (2/3) > >>

takeshimiya:
I have tried to compile Elsa on mingw32, it compiles smbase right, but the rest fails, mostly because of flex/bison stuff.

And I've tried another C++ parser which seems very complete, called ANTLR C++ (or CodeStore modified version).

It compiles fine on mingw32 (in fact I've compiled it successfully from C::B), and almost out-of-the-box.

Michael:

--- Quote from: Takeshi Miya on December 12, 2005, 11:34:55 am ---I have tried to compile Elsa on mingw32, it compiles smbase right, but the rest fails, mostly because of flex/bison stuff.

--- End quote ---

The Elsa website says:


--- Quote ---mingw32: Elsa has not been ported to mingw32, though smbase has limited support for it.

--- End quote ---

This is probably why you can compile smbase, but not the rest. May be it would be for further release...

I have found this website that could be of interest despite it is a bit old:

Michael

takeshimiya:
According to that article:

"ANTLR is a parser generator which works on predicated LL(k) grammars.
PCCTS is a C++ grammar for ANTLR (actually, a modified version of ANTLR) supports all C++ features except namespaces.

and

Elsa:
If you are thinking of writing a C++ parser yourself, then use a GLR parser generator such as Elkhound and you'll save yourself lots of hassle. The guy who wrote Elkhound is also writing a C++ parser (including semantic analysis) called Elsa, which can parse everything except STL headers it seems. If you're interested in C++ parsing, it'd be good to have a long look at this project."


That's from 2001. I don't know if ANTLR C++ support namespaces now.
But Elsa can parse them, and it's tested with parsing Mozilla, Qt, ACE, STL source code.


So:
ANTLR C++ can be compiled right now in GCC, Mingw32, MSVC 6 & 7. It's written only using STL code so it's very portable.
Can it parse namespaces?

Elsa seems more complete and better overall, and can be compiled in GCC/cygwin. It's written using portable code also.
The fact that it doesn't work out-of-the-box yet on mingw32 is because the build system (it requieres flex, perl, bison).

So far I would choose Elsa if it worked right now on mingw32.

Michael:

--- Quote from: Takeshi Miya on December 12, 2005, 01:00:28 pm ---According to that article:

"ANTLR is a parser generator which works on predicated LL(k) grammars.
PCCTS is a C++ grammar for ANTLR (actually, a modified version of ANTLR) supports all C++ features except namespaces.

and

Elsa:
If you are thinking of writing a C++ parser yourself, then use a GLR parser generator such as Elkhound and you'll save yourself lots of hassle. The guy who wrote Elkhound is also writing a C++ parser (including semantic analysis) called Elsa, which can parse everything except STL headers it seems. If you're interested in C++ parsing, it'd be good to have a long look at this project."


That's from 2001. I don't know if ANTLR C++ support namespaces now.
But Elsa can parse them, and it's tested with parsing Mozilla, Qt, ACE, STL source code.

--- End quote ---

Yes, the article is a bit old, but there are some good links (e.g., Edward Willink's "Meta-Compilation for C++" PhD thesis).


--- Quote from: Takeshi Miya on December 12, 2005, 01:00:28 pm ---So:
ANTLR C++ can be compiled right now in GCC, Mingw32, MSVC 6 & 7. It's written only using STL code so it's very portable.
Can it parse namespaces?

--- End quote ---

It seems yes: ANTLR Options


--- Quote from: Takeshi Miya on December 12, 2005, 01:00:28 pm ---Elsa seems more complete and better overall, and can be compiled in GCC/cygwin. It's written using portable code also.
The fact that it doesn't work out-of-the-box yet on mingw32 is because the build system (it requieres flex, perl, bison).

So far I would choose Elsa if it worked right now on mingw32.

--- End quote ---

May be it would not be very difficult to make it works with mingw32.

Michael

takeshimiya:
About ANTLR:

There are 2 versions of it, PCCTS 1.33 is the previous version of ANTLR, which was written in C. It is not maintained anymore.

And ANTLR 2.75 is the latest version and actively mantained. It supports templates and it's better overall than PCCTS.
The downside is that is written in Java. But don't run away, remember that ANTLR is a parser generator, not a parser.
Because it can generate a C++ parser (among many other languages) written in C++ code.

About Elsa on mingw32:
I don't think it would be difficult making it work on mingw32, but someone with *nix expertise is needed, because the build system uses the utils I've described above (flex, bison, perl) which I don't understand what they do.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version