Implemented error reporting in parser