Hi everybody, I'm having some little trouble trying to wire up some tokenizing state machines I wrote for feng ( http://www.lscube.org/ ) from one side branch to the master one, and I start to wonder if it only worke dout of luck before.
Basically this is used during RTSP requests parsing (RFC822-compatible),
it's autogenerated (yes, autogenerating ragel code that generates C
code, I know it sounds silly at first), so that it only identifies the
headers that we _actually_ use and skip all the rest.
The autogenerated machine can be reduced to
Header_Name = (
'Transport'i % { hdr_code = RTSP_Header_Transport; } |
'Unsupported'i % { hdr_code = RTSP_Header_Unsupported; } |
'User-Agent'i % { hdr_code = RTSP_Header_User_Agent; } |
( unreserved+ ) % { hdr_code = RTSP_Header_Unknown; }
);
and then I wire it up in
Header = Header_Name :>
':' . SP . print+ > hdr_val_start;
main := ( (Header % save_header) :> CRLF )** :> CRLF . 0;
By the time it calls save_header, though, hdr_code is always
RTSP_Header_Unknown if not for the last User-Agent one.
I'm sincerely at a bit of a loss.. or maybe I tried to bang my head on
this too much for now...
--
Diego Elio Pettenò — “Flameeyes”
http://blog.flameeyes.eu/
If you found a .asc file in this mail and know not what it is,
it's a GnuPG digital signature: http://www.gnupg.org/
signature.asc
Description: This is a digitally signed message part
_______________________________________________ ragel-users mailing list [email protected] http://www.complang.org/mailman/listinfo/ragel-users
