Next: Iteration on
Up: Iteration on Q
Previous: Iteration on Q
The type iterator is only exported by DFA_matrix and
DFA_compact classes. To be able to iterate through Q with the other
implementations you must use the adapter DFA_linked which exports the
iterator type.
#include "dfa_map.hh"
#include "dfa_linked.hh"
#include "tag.hh"
#include "alphabet.hh"
main()
{
typedef DFA_map<Range_alphabet<char, 'a', 'z'>, STag> DFA_type;
DFA_linked<DFA_type> dfa;
DFA_linked<DFA_type>::iterator q, last;
last = dfa.end();
for(q = dfa.begin(); q != finish; ++q)
if (dfa.tag(*q).final() == true)
f(*q);
}
Vincent Lemaout
12/9/1997