[ragel-users] Parsing date strings

Luis Kornblueh luis.kornblueh at zmaw.de
Thu Aug 11 14:26:19 UTC 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.
>
> jg
>
>
> _______________________________________________
> ragel-users mailing list
> ragel-users at complang.org
> 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: luis.kornblueh at zmaw.de
  Federal Republic of Germany

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5998 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20110811/434d35db/attachment-0001.bin>
-------------- next part --------------
_______________________________________________
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