Good error detection and handling is one of the hardest parts of writing the front end to a compiler. "Parse error" basically means "uh, the syntax of the language don't do that"; it's more fundamental than even "undeclared variable".
Usually such errors are pretty obvious and easy to fix.