KDevelop 1.0beta3 patch - Objective-C support added
Ansley, Michael
Michael.Ansley at intec.co.za
Tue Sep 28 16:07:23 BST 1999
>> The _ideal_ fix is to remove '%option yylineno' from
>> tokenizer.l and to
>> make 'comment' a QString. This will allow for indefinitely large
>> comments and will, according to the flex docs, make a significantly
>> faster parser (will this offset the cost of the QString? Dunno).
It's not just as simple as that, unfortunately. You have to ensure that you
have no variable length trailing contexts (vltcs), to ensure that the buffer
can grow. If any vltcs exist, then flex will automatically #define
YY_USES_REJECT, even if you aren't using %reject. The purpose of this is to
prevent the buffer from growing with a vltc. Although I haven't looked at
the lex file yet, there is a good chance that there is at least one vltc
somewhere. The best way to find this is to use a command line switch (I
forget which one, check the man page) when calling flex to do an
optimization parse. It will warn you of any potential performance issues,
and vtlcs are one of those issues. There is also another condition which
causes YY_USES_REJECT to be defined, but I can't remember what it is. The
main thing is: RTFM, specifically about optimizing, and vltcs and related
de-optimizing 'features'.
PostgreSQL also has a thing about long comments. I'll go back and check it,
and see what it does, and if anything useful turns up, I'll let you know.
MikeA
More information about the KDevelop
mailing list