Am I misinterpreting the purpose of fbreak?

David Waite dwa... at gmail.com
Sat Jan 5 23:52:58 UTC 2008


I don't know if advancing p is the correct option all the time though,
because (in the example, and unfortunately in the actual machine I'm
trying to create) I trigger multiple breaking actions on a single
transition. For example, the two character JSON document "[]"
currently should have the following actions triggered by my machine:

main:
  StartDocument - fbreak; (returns Event.Document)
  ParseArray - fcall array;
  StartArray - fbreak; (returns Event.Array)
  EndArray - fbreak; (returns Event.EndArray)
  Return - fret;
  EndDocument (eof) - fbreak; (returns Event.EndDocument)

If I remove the StartDocument fbreak, would incrementing p on break
work?

-DW

On Jan 5, 3:56 pm, Adrian Thurston <thurs... at cs.queensu.ca> wrote:
> 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).
>



More information about the ragel-users mailing list