Reconfiguring is a reasonable approach to this. If you, instead of having your parser rely on mutable data structures, make it so that it is recreated as a new parser with the new parameters instead, it will also feel less hacky.
Reconfiguring is a reasonable approach to this. If you, instead of having your parser rely on mutable data structures, make it so that it is recreated as a new parser with the new parameters instead, it will also feel less hacky.