CSharp parser performance
roberto at kdevelop.org
Mon Aug 7 10:53:37 UTC 2006
On Sunday 06 August 2006 02:38, Jakob Petsovits wrote:
> > I've also determined that the C# parser suffers multi-threading problems.
> > When I run more than one parse at a time in multiple threads, I get
> > crashes. This probably has to do with the static variables. Especially
> > the
> > char *_G_contents;
> > variable.
please, can you send the me an example?
> I'll move that one away, but it's not the problem here (rather a symptom).
> The real problem is Flex, which is storing its state between subsequent
> calls of yylex(). So this is maybe the right time for me to try out Flex'
> "experimental" C++ class mode.
global functions are pretty bad, so you're right we don't want to use a
global "yylex()", but this isn't really a problem with flex :-) the trick is
to use the YY_DECL macro. For example,
// compile with flex -oscanner.cpp scanner.l && g++ scanner.cpp
#define YY_DECL int Scanner::yylex()
int yylex ();
return yytext ;
int main ()
while (scanner.yylex ())
> Your favorite parser guy,
Roberto Raggi - roberto at kdevelop.org
More information about the KDevelop-devel