[ragel-users] Exit action
yogieric at mac.com
Tue Feb 23 10:50:25 PST 2010
Thanks. I'd missed the longest-match kleene star documentation.
Sorry if this is a stupid question -- I'm looking for the best of both worlds. How do I get a longest-match kleene star machine to start over if there is an error?
For example, a document of "mailto:email1 at x ... mailto:email2 at y ... mailto:invalid_email ... mailto:email4 at z" will find the first two but will exit on the third invalid_email when I really want it to keep going and find email4 at z.
On Feb 21, 2010, at 11:42 , Adrian Thurston wrote:
> mail := (any | mailto)**;
> For the answer why, please see chapter four of the manual.
> Eric Brown wrote:
>> If I have two ORed machines, is there a leaving action I can get when a machine is finally exiting?
>> For example, I believe this is a simplified form of my parser:
>> host = [A-Za-z0-9\-.]+;
>> mailto = (/mailto:/i sender_chars+ '@' (host %mailto_end)) $mailto;
>> mail := (any | mailto)*;
>> The %mailto_end will get executed on every single character of host. I just want it to pick up the last character of host. Is there a way?
>> ragel-users mailing list
>> ragel-users at complang.org
> ragel-users mailing list
> ragel-users at complang.org
More information about the ragel-users