From: Maciej L. <Mac...@be...> - 2005-10-14 21:39:25
|
> Stefan wrote: > Could you please post the actual code which occ complains about ? (Just > the surrounding lines will probably do.) > > Chances are indeed that occ is getting to its limits with modern C++ > code (such as the type traits). > > The problem stems from occ being a 'context-free' parser, > when the actual C++ grammar is not context-free. Specifically, a > conformant > parser has to consider a symbol's type when it attemps to decide on > a particular production. Depending on whether a given symbol corresponds > to a variable, type, or template, the token stream is interpreted > differently > (expression or type-id ? relational-expression or template-id ? Etc.) > > As occ builds its symbol table only after the parsing stage is over, it > has to rely on heuristics, which sometimes fail. > > I have been able to work with a (slightly enhanced) form of the OpenC++ > parser class for some time, but as I'm now trying to parse template-heavy > code, even my version fails. > In the context of the synopsis project (http://synopsis.fresco.org) I > have thus started to rewrite the Parser class from scratch. > Thanks to all for rescue me :) Scott are right it is a problem with template parameter identifier, i.e. the error message I’ve attached in the first post: /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/cpp_type_traits.h:83: parse error before `>' points at: // Compare for equality of type template<typename, typename> I’ve made change in Parser.cc file as Scott wrote, and now it’s working well. At least I can start working with OpenC++ :) P.S. It’s worth taking Scott’s patch and make a new snapshot. Sincerely, Maciek Leks |