Trap and handle ANTLR parsing errors instead of crashing.