Implement error reporting in parser