Finite automata library in C++