From: Daniel Berlin (dan_at_[hidden])
Date: 2000-10-14 17:54:03
Jan Dries <jdries_at_[hidden]> writes:
> David Abrahams wrote:
> > > Now to something more concrete. About this C++ parser. What exactly
> > > do you want? I really dont know much about this kind of stuff. Would
> > > it be possible to create a c++ parser in python or does it have to be
> > > in c++? Python would be the easiest to code, right?
> > Well, maybe, but there are surely many existing parsers out there already in
> > C/C++ using YACC and BISON. I think you'll find a BISON-based parser in the
> > Doxygen sources.
> Somewhere early 1999 I spent quite some effort to find a good parser for
> C++. Unless things have changed since then, you will find it extremely
> hard to find one that is reasonably complete and up to date with the C++
> standard. The last time I looked at Doxygen, it didn't even have a Yacc
> (Bison) based parser, but solved all in a lexer with states. The same by
> the way holds for just about all these doc and related tools that
> process C++ code, and they all choke on perfectly valid code at one
> point or another. One of the reasons I was looking for such a parser was
> because I wanted a better doc tool, one that would understand more of
> the language.
> I think that one of the only Yacc grammers that you can really trust
> (and that is freely available) is the one you find in the GCC sources.
> And I fear, as you also pointed out at the end of your mail, that if you
> want something that really understands C++ well, you will end up needing
> a much larger part from GCC than just the .y and .l files.
I did the same in-depth research.
The only actual good C++ parser, besides the one in the gcc sources,
which is horrendous to integrate into anything else, is the one in
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk