implement walk_dfa()