[PATCH] experimenting with new parsing rules

David Relson relson at osagesoftware.com
Mon Sep 15 14:11:10 CEST 2003


Matthias,

I've looked at the code generated by flex and compared the code
generated for "debug" and "nodebug".  One chunk of code is evaluated as
each rule is accepted (or the scanner backs up or end of buffer is
reached).  It's controlled by a single "if (yy_flex_debug)" statement. 
The speed penalty is nearly zero when BOGOTEST=0.  When BOGOTEST=2, the
amount of output is large!

Glad you like the idea. I've committed the BOGOTEST code to the
repository.

As to tagging of "Return-Path:" vs "Received", I dropped a few lines of
code.  I've fixed that.  Attached is the fix (as a patch).  I've also
attached the current lexer_v3.l (so you needn't worry about patch
conflicts).

David

P.S.  I've changed the meaning of the bits of BOGOTEST.  Since
bogtofilter is normally going to have the lexer rule tracing ability, it
makes sense to have BOGOTEST=1 enable it.  Since there won't usually be
an alternate rule set for testing, the code will use BOGOTEST=2 for
that.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.token.c.0915
Type: application/octet-stream
Size: 598 bytes
Desc: not available
URL: <https://www.bogofilter.org/pipermail/bogofilter-dev/attachments/20030915/a977ddd1/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lexer_v3.l
Type: application/octet-stream
Size: 11251 bytes
Desc: not available
URL: <https://www.bogofilter.org/pipermail/bogofilter-dev/attachments/20030915/a977ddd1/attachment-0001.obj>


More information about the bogofilter-dev mailing list