Algorithm-ConstructDFA2
view release on metacpan or search on metacpan
lib/Algorithm/ConstructDFA2.pm view on Meta::CPAN
}
sub transitions_as_5tuples {
my ($self) = @_;
return $self->_dbh->selectall_array(q{
SELECT * FROM view_transitions_as_5tuples
});
}
sub backup_to_file {
my ($self, $schema_version, $file) = @_;
die unless $schema_version eq 'v0';
$self->_dbh->sqlite_backup_to_file($file);
}
# sub backup_to_dbh {
# my ($self, $schema_version) = @_;
#
# die unless $schema_version eq 'v0';
#
# require File::Temp;
#
# my ($fh, $filename) = File::Temp::tempfile();
#
# $self->_dbh->sqlite_backup_to_file($filename);
#
# my $dbh = DBI->connect('dbi:SQLite:dbname=:memory:');
#
# $dbh->sqlite_backup_from_file($filename);
#
# File::Temp::unlink0($fh, $filename);
#
# undef $fh;
#
# return $dbh;
# }
1;
lib/Algorithm/ConstructDFA2.pm view on Meta::CPAN
for my $transition ( $dfa->transitions_as_5tuples() ) {
my ($src_state, $src_vertex, $input, $dst_state, $dst_vertex) =
@$transition;
...
}
Note that unlike C<transitions_as_3tuples> this omits transitions
involving the main dead state.
=item $dfa->backup_to_file('v0', $file)
Create a backup of the database used to store input and computed data
into C<$file>. The first parameter must be C<v0> and indicates the
version of the database schema.
=back
=head1 TODO
=over
=item * It does not make sense for C<transitions_as_5tuples> and its
( run in 1.917 second using v1.01-cache-2.11-cpan-49f99fa48dc )