Many years ago I had to write a code transformation for a legacy programming language. It was orders of magnitude much easier to assume that the code was syntactically valid. And we could make that assumption because we had the legacy compiler being used to compile.