From: Stefan S. <se...@sy...> - 2005-10-13 20:23:13
|
Maciej Leks wrote: > Hi All, > > I’ve made the latest version of OpenC++ based on the snapshot given by > some of this list expert on Cygwin 1.5.18-1 (gcc 3.4.4.). > > Then, I was trying to compile one of the example that is injected with > the distribution, as follows: > > $ occ2 BeforeClass.mc > occ2: command failed: /usr/local/bin/occ --private--external-driver -E > <BeforeClass.ii --private--output BeforeClass.occ.tmp > 2>BeforeClass.feedback > > ..and the content of the BeforeClass.feedback is: 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. Regards, Stefan |