Am I misinterpreting the purpose of fbreak?

David Waite dwa... at gmail.com
Sat Jan 5 07:55:42 UTC 2008


(Simple sample attached for C and Java)

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.

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 execution loop when you
attempt to resume processing. The end result for the C and Java examples
supplied is that the pointer never moves forward, eof is never reached and
the sample infinitely outputs its message.

Is it possible to do what I want to do?

-David Waite
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.colm.net/pipermail/ragel/attachments/20080105/42daecc9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: breaking-actions-test.zip
Type: application/zip
Size: 1599 bytes
Desc: not available
URL: <http://www.colm.net/pipermail/ragel/attachments/20080105/42daecc9/attachment.zip>


More information about the ragel-users mailing list