C++ NFA to DFA conversion