Modify parser to use mutable state