Next: Warning
Up: Basic Algorithms
Previous: Warning
Remember
is the set of the transitions :
. Some algorithms require to access sequentially the set of all
transitions. You will find in the file dfa_iterator.hh the class
trans_iterator implementing a forward iterator on
whose value type
is a triple
. Here is how to print
on
standard output:
#include "dfa_matrix.hh"
#include "dfa_iterator.hh"
#include "tag.hh"
#include "alphabet.hh"
#include <iostream.h>
main()
{
typedef DFA_matrix<Range_alphabet<char, 'a', 'z'>, STag> DFA_type;
DFA_type dfa;
// Construct the automaton
// .....
// Then declare a transition iterator on dfa
trans_iterator<DFA_type> trans(dfa), trans_end(dfa);
trans_end = dfa.end();
for (trans = dfa.begin(); trans != trans_end; ++trans)
{
triple<DFA_type::State, DFA_type::Alphabet, DFA_type::State> t = *trans;
cout << t.first << " " << t.second << " " << t.third << endl;
}
}
Vincent Lemaout
12/9/1997