[ragel-users] Anchoring to the EOF

Julian Morrison julian.morrison at gmail.com
Fri Jan 23 23:59:52 UTC 2009


It certainly does help, thanks.

OK, next, I wasn't able to figure out how to do an error recovery. That is,
when one of the (line*) starts to match, then fails, the error action should
log the error, jump to another regex that matches (any*) :>> '\n', jump back
and pick right back up trying to match more lines. It's plainly obvious that
Ragel can do that, but the wizardry level is a bit above me. Please
elucidate?

2009/1/23 Adrian Thurston <thurston at complang.org>

> In short, there isn't!
>
> Ragel does not make any assumption about the input, and this includes
> not assuming line-based input. If you want to anchor to something you
> just put that something into the grammar at the end. If you want to see
> if the machine finished in a final state (and thus consumed that
> something) you test cs against machine_first_final.
>
> Hope this helps,
>  Adrian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20090123/249e7c6f/attachment-0001.html>


More information about the ragel-users mailing list