> On Dec 15, 2004, at 7:04 AM, Tim Bunce wrote:
> > - I'd suggest renaming check() to
> > attempt_transition() and have it return
> > the new state or undef (not croak) if it can't
> > transition at the moment.
>
> How 'bout I borrow DFA::Simple's
> Check_For_NextState()"? No?
> "attempt_transition()" is a bit long. Maybe
> "eval_rules()"? Right now check() returns the
> object itself and croaks on failure.
>
"- get_next_state() returns a new DFA object, which
is in the next state. If there is no next state, it
returns undef."
Examples:
if ( $state1->get_next_state() )
{
$state1->next_state;
}
else
{
die "no next state";
}
if ( $state2 = $state1->get_next_state() )
{
$state1 = $state2;
}
else
{
die "no next state";
}
- Flavio S. Glock