[ragel-users] Nested parsing

Adrian Thurston thurston at complang.org
Sun Feb 21 11:34:50 PST 2010


Hi Eric,

For base64 I would not recommend using getkey to decode. I think your 
best bet is to write one decoder that writes into a buffer, that when 
filled, is flushed to the email parser.

There is a permissively licensed base64 decoder here.

http://svn.complang.org/dsnp/trunk/dsnpd/base64.rl

Note that this is a modified base64 that uses "-_" instead of "+/".

-Adrian

Eric Brown wrote:
> Hi,
> 
> I'm trying to look for URLs embedded in email messages. However, the email messages themselves may be base64 or quoted-printable encoded. I could just decode the base64 or quoted-printable into one buffer and then search for URLs. Email messages can be large and I could do it in blocks of data intermittently resuming parsers, etc. I also thought of using the getkey statement and decoding the base64 or quoted-printable that way, but documentation says this could be called more than once per character. Is there any easier way to chain 2 parsers like this?
> 
> Thanks,
> Eric
> 
> 
> _______________________________________________
> ragel-users mailing list
> ragel-users at complang.org
> http://www.complang.org/mailman/listinfo/ragel-users




More information about the ragel-users mailing list