ragel 5.23 released

Steve Horne stephenhorne... at aol.com
Sat Aug 4 04:09:37 UTC 2007



On Aug 3, 6:15 pm, Adrian Thurston <thurs... at cs.queensu.ca> wrote:
> You can make such a machine like this:
>
> later = start: "", "" -> final;
>
> Though using this machine will be difficult. It will create unreachable
> states that Ragel removes during compilation.

That actually works almost perfectly - certainly it solves the
immediate problem.

I tested it with the following...

%%{  machine  test_null;

     h = 1;
     j = 2;
     k = 3;

     X = start: "", "" -> final;

     A = h j k;
     B = h h X k;
     C = k k X h;
     D = k j h;

     main := A | B | C | D;
}%%

I get an FSM that clearly accepts the A and D alternatives as it
should, and does not accept the B and C variants or any unwanted
sequences. The only extremely minor issue (non-issue, really) is that
one state is kept that perhaps should be eliminated - a state that is
reachable, but which is not an end state and which has no outward
transitions. OTOH, keeping this dead-end state might be a good thing -
I can test cases B and C as far as they are defined if I need to.

Thanks.



More information about the ragel-users mailing list