On 05 Aug 2001 12:24:12 +0100, Nix wrote:
On Sun, 05 Aug 2001, Valdis Kletnieks said:
> On Sat, 04 Aug 2001 11:22:29 BST, Nix said:
>> Fast hardware doesn't help. I use lazy-lock because I use an extremely
>> heavy-duty C and C++ fontification regexp by Chris Holt, and it takes
>> more than half an hour to fontify e.g. `src/eval.c'. I'm not willing to
>
> Tell us more? ;)
The work of obsessive genius heavy-duty fontification regexp? Here it
is:
This is sick :-) But reading it a bit the comments in the file, I
wonder if we shouldn't abandon the idea of using regexps for
fontification completely. Sure, you can get away with 90% correct
result with some reasonable sized regexps, but to get the last 10%
makes the regexps so complicated and slow, that maybe another aproach
would be better.
JDE, the emacs java environment, uses the semantic package to construct
a real parser to get to the semantic meaning of the code. Building such a
parser with semantic seems to be a doable work if one has the BNF grammar
of language in question.
Of course this would be slower than some easy regexps, but judging from
jde, perfectly doable on a modern machine. While this overhead is
bound, introducing more and more complex regexps will make fontlocking
as slow as one wants to have it.
just some thoughts,
jtl