Hello. I would like to parse a date which can be in one of
several forms and I want to get the number of a month in a variable.
My problem is that for some input, the month is parsed by both
alternatives, but I need to get the correct value. If I could
detect which "thread" I am in, I could throw away the other
values in an @lerr handler.
This machine demonstrates what I want:
%%{
machine test;
action in { puts("mon begins", fpc); }
action out { puts("mon ends", fpc); }
action fail { puts("thread failed", fpc); }
i = digit+;
day = i " ";
mon = i >in %out " ";
time = (i ":" i) @lerr(fail);
stamp
= day mon time
| mon time
;
main := stamp "\n" >{ puts("done"); };
}%%
Is there another way to do this?
Thanks,
Devin Bayer
_______________________________________________
ragel-users mailing list
[email protected]
http://www.complang.org/mailman/listinfo/ragel-users