On 12-10-15 02:27 AM, Nick Parker wrote:
1) Doesn't the intersection "(any | anytime_events)* & talk_sm" (with all anytime_events removed from talk_sm's states) just effectively result in "talk_sm" with no anytime_events at all? Tried the example against graphviz output. It also sorta makes sense when thought of as sets being unioned/intersected: (any | anytime_events) & talk_sm -> any & talk_sm -> talk_sm. Or am I misunderstanding what you meant?
The strings matched will be those from talk_sm, but the actions from the any* machine will be overlaid upon it. It's a consequence of ragel's NFA -> DFA semantics wrt embedded actions.
3) The tricky thing is allowing the "eating" submachine to exit to either of the parent states "hungry" or "not_hungry", depending on whether the "eating" machine was internally successful. Or another way of putting it is that the eating submachine effectively has multiple final states which each map to a different state in the parent machine. Having said it this way makes me think it may indeed be easiest to just move/merge the submachine into the parent machine.
You may want to try using !eating alongside eating to specify what happens when the submachine fails.
-Adrian _______________________________________________ ragel-users mailing list ragel-users@complang.org http://www.complang.org/mailman/listinfo/ragel-users