On 11/08/2011 16:15, [email protected] wrote:
Hi Luis,

my Maya colleague next door believes that "-3456781203" refers to a date
in December instead of May. Could he be right?

Given the fixed format of your date strings, the question is not really
whether you can scan it with Ragel (or flex, or what else), but whether
such a tool is the right tool to do that. Somehow you always need to
extract the last 2+2 chars and validate them, but this essentially makes
you going backwards in your machine (or using further memory) which is
not within the realm of a "pure" FSM
(http://en.wikipedia.org/wiki/Finite_state_machine). However, Ragel
allows you to easily add the necessary "counting".

It depends on how you get your date strings whether using Ragel is
benficial or not. If you have just isolated strings (i.e. the entire
string, so you know where it ends) it probably doesn't. If you need to
extract the date from a stream of other tokens that can easily described
by a FSM, then it will.

jg


_______________________________________________
ragel-users mailing list
[email protected]
http://www.complang.org/mailman/listinfo/ragel-users

Hi jg,

of course your Maya colleague is of course right. The reason why I like
to be able to do the parsing with ragel is, that all other things I have are perfectly fine working and I'm really happy with it. The only thing remaining are this 'ugly' date strings with arbitrary number of years ... As it is nice to use a single tool for a set of 'equal' kind of things, it would be nice to be able to do it. And it'll be only part
of a stream ...

Luis



--
                             \\\\\\
                             (-0^0-)
--------------------------oOO--(_)--OOo-----------------------------

 Luis Kornblueh                           Tel. : +49-40-41173289
 Max-Planck-Institute for Meteorology     Fax. : +49-40-41173298
 Bundesstr. 53
 D-20146 Hamburg                   Email: [email protected]
 Federal Republic of Germany

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
ragel-users mailing list
[email protected]
http://www.complang.org/mailman/listinfo/ragel-users

Reply via email to