[ragel-users] Parsing date strings
luis.kornblueh at zmaw.de
Thu Aug 11 07:26:19 PDT 2011
On 11/08/2011 16:15, ragel-user at jgoettgens.de 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.
> ragel-users mailing list
> ragel-users at complang.org
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 Kornblueh Tel. : +49-40-41173289
Max-Planck-Institute for Meteorology Fax. : +49-40-41173298
D-20146 Hamburg Email: luis.kornblueh at zmaw.de
Federal Republic of Germany
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5998 bytes
Desc: S/MIME Cryptographic Signature
More information about the ragel-users