| FLAT documentation | Contained in the FLAT distribution. |
FLAT::Transition - a transition base class.
Default implementation of the Transition class, used to manage transitions from one state to others. This class is meant for internal use.
used internally;
FLAT is written by Mike Rosulek <mike at mikero dot com> and Brett Estrade <estradb at gmail dot com>.
The initial version (FLAT::Legacy) by Brett Estrade was work towards an MS thesis at the University of Southern Mississippi.
Please visit the Wiki at http://www.0x743.com/flat
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| FLAT documentation | Contained in the FLAT distribution. |
package FLAT::Transition; use strict; use Carp; sub new { my ($pkg, @things) = @_; bless { map { $_ => 1 } @things }, $pkg; } sub does { my ($self, @things) = @_; return 1 if @things == 0; return !! grep $self->{$_}, @things; } sub add { my ($self, @things) = @_; @$self{@things} = (1) x @things; } sub delete { my ($self, @things) = @_; delete $self->{$_} for @things; } sub alphabet { my $self = shift; sort { $a cmp $b } keys %$self; } sub as_string { my $self = shift; join ",", map { length $_ ? $_ : "epsilon" } $self->alphabet; } 1; __END__