rewrite scanner only when needed
rewrite parser only when needed