support DFA on-the-fly construction