Rewriting parser