avoid copys in state parser and generator and allow successful parsing