use PDA::Simple;
use Data::Dumper; # for demonstration.
# create PDA::Simple object.
my $pda = PDA::Simple->new();
# add states
$pda->add_state('A');
$pda->add_state('B');
# add transition from initial state with stack ops
$pda->add_trans_from_init('A','a','push');
# add transition FROM and TO with stack ops
$pda->add_trans('A','A','a','push');
$pda->add_trans('A','B','b','pop');
$pda->add_trans('B','B','b','pop');
# add transition to final state with stack ops
$pda->add_trans_to_final('__INIT__','b','pop');
# define input array.
my $array = ['a','a','a','a','b','b','b','b'];