Here is the diagram for your machine, BTW: http://bit.do/stackoverflow-19621544 (created with Erdos).
With "abxc" the ("b" | "x" "c")+
machine first matches the "b" and then the "xc". When transitioning from "b" (to "x") it calls the leaving actions (e
and captured
) for the first time, and when transitioning from "xc" (to EOF) it calls the leaving actions (e
and captured
) for the second time.
I guess the e
action is supposed to set the end pointer in order to capture the string between start s
and end e
. If so, then Ragel calling the e
action multiple times isn't really a problem, you just advance the end pointer like you already do.