refactor generation so that in-memory and to-source code paths are the same
create a new instance of the lexer on each parse
make a copy of shared state on each parse