Next: Compact DFA
Up: Declaring a Container
Previous: Declaring a Container
Contents
ASTL provides eight DFA containers sharing the same
interface. They have homogeneous interfaces and behaviors but
heterogeneous implementations and complexities allowing to choose at
utilization time which one fits best the situation. The following
piece of code declares a variety of containers :
#include <astl.h>
#include <dfa.h>
#include <string>
int main()
{
DFA_map<> A1;
DFA_matrix<range<char, 'A', 'Z'> > A2;
DFA_tr<range<int, 0, 1023> > A3;
DFA_mtf<french, std::string> A4;
DFA_hash<std::char_traits<char> > A5;
DFA_bin<ASCII, int> A6;
}
The declaration of A1
uses the template default parameters, it
is equivalent to :
DFA_map<plain, empty_tag> A1;
A5
uses the standard character traits std::char_traits
as alphabet traits. It can be used to instanciate all containers
except DFA_matrix
and must only be used with builtin types
alphabets.
Vincent Le Maout
2003-07-08