Factor out parse() and apply() to make the srparser and lexparser interfaces a little more similar