[ragel-users] Am I misinterpreting the purpose of fbreak?

Adrian Thurston thurs... at cs.queensu.ca
Sat Jan 5 22:56:03 UTC 2008


The problem is that fbreak does not advance p when it breaks out of the
loop. This is a choice I made a long time ago and I think I was taking
the "do as little as possible on behalf of the user" approach. But not
advancing p while advancing cs is clearly wrong and confusing. This is
something that will change in 6.0 (it's in the TODO already).

In the meantime you can do p++ just before the break.

Adrian

David Waite wrote:
> (Simple sample attached for C and Java)
>=20
> My hope is to make a pull parser for a document format (JSON), which
> will update the parser object to represent a new 'state' after
> processing some atom of information from the input source. It thus is
> almost like an enumeration of events that you iterate over by calling a=

> 'next()' style method. Examples would include Java stream xml (STAX)
> interfaces (see  http://tinyurl.com/2urbsy ) or the .Net Framework's
> XmlReader (see http://tinyurl.com/34mg5h ). To do this, I am trying to
> break out everytime I process a feature in my document, but I quickly
> realized this was not working for me every-time.
>=20
> It appears the main problem is in having multiple breaking actions off
> of a single character transition. The system doesn't appear to be able
> to recover from such behavior, instead immediately exiting the executio=
n
> loop when you attempt to resume processing. The end result for the C an=
d
> Java examples supplied is that the pointer never moves forward, eof is
> never reached and the sample infinitely outputs its message.
>=20
> Is it possible to do what I want to do?
>=20
> -David Waite
>=20
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "ragel-users" group.
> To post to this group, send email to ragel-users at googlegroups.com
> To unsubscribe from this group, send email to
> ragel-users-unsubscribe at googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/ragel-users?hl=3Den
> -~----------~----~----~----~------~----~------~--~---
>=20

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20080105/f6a8e434/attachment-0001.sig>


More information about the ragel-users mailing list