1 2 3 4 5 6 7 8 9 10 11
#!/usr/bin/perl -w use Gfsm; $fsmfile = @ARGV ? shift : '-'; $fsm = Gfsm::Automaton->new(); die("$0: load failed for '$fsmfile': $!") if (!$fsm->load($fsmfile)); foreach $qid (0..($fsm->n_states-1)) { print $qid, "\t", $fsm->out_degree($qid), "\n"; }