Doxygen
Loading...
Searching...
No Matches
vhdl::parser::VhdlErrorHandler Class Reference

#include <vhdlparser/VhdlParserErrorHandler.hpp>

+ Inheritance diagram for vhdl::parser::VhdlErrorHandler:
+ Collaboration diagram for vhdl::parser::VhdlErrorHandler:

Public Member Functions

 VhdlErrorHandler (const char *fileName)
 
virtual void handleUnexpectedToken (int, const JJString &, Token *actual, VhdlParser *)
 
virtual void handleParseError (Token *last, Token *unexpected, const JJSimpleString &, VhdlParser *)
 
virtual void handleOtherError (const JJString &message, VhdlParser *)
 
- Public Member Functions inherited from vhdl::parser::ErrorHandler
virtual int getErrorCount ()
 
virtual ~ErrorHandler ()
 
 ErrorHandler ()
 

Private Attributes

QCString m_fileName
 

Additional Inherited Members

- Protected Attributes inherited from vhdl::parser::ErrorHandler
int error_count
 

Detailed Description

Definition at line 16 of file VhdlParserErrorHandler.hpp.

Constructor & Destructor Documentation

◆ VhdlErrorHandler()

vhdl::parser::VhdlErrorHandler::VhdlErrorHandler ( const char * fileName)
inline

Definition at line 19 of file VhdlParserErrorHandler.hpp.

References m_fileName.

Member Function Documentation

◆ handleOtherError()

virtual void vhdl::parser::VhdlErrorHandler::handleOtherError ( const JJString & message,
VhdlParser *  )
inlinevirtual

Reimplemented from vhdl::parser::ErrorHandler.

Definition at line 35 of file VhdlParserErrorHandler.hpp.

36 {
37 warn(m_fileName, -1, "unexpected error: '%s'", (char*)message.c_str());
39 throw std::exception();
40 }
#define warn(file, line, fmt,...)
Definition message.h:59

References vhdl::parser::ErrorHandler::error_count, m_fileName, vhdl::parser::ErrorHandler::VhdlParser, and warn.

◆ handleParseError()

virtual void vhdl::parser::VhdlErrorHandler::handleParseError ( Token * last,
Token * unexpected,
const JJSimpleString & ,
VhdlParser *  )
inlinevirtual

Reimplemented from vhdl::parser::ErrorHandler.

Definition at line 28 of file VhdlParserErrorHandler.hpp.

29 {
30 warn(m_fileName,last->beginLine,"unexpected token: '%s'", unexpected->image.data());
32 throw std::exception();
33 }

References vhdl::parser::Token::beginLine, vhdl::parser::ErrorHandler::error_count, vhdl::parser::Token::image, m_fileName, vhdl::parser::ErrorHandler::VhdlParser, and warn.

◆ handleUnexpectedToken()

virtual void vhdl::parser::VhdlErrorHandler::handleUnexpectedToken ( int ,
const JJString & ,
Token * actual,
VhdlParser *  )
inlinevirtual

Reimplemented from vhdl::parser::ErrorHandler.

Definition at line 21 of file VhdlParserErrorHandler.hpp.

22 {
23 warn(m_fileName,actual->beginLine,"syntax error '%s'",actual->image.data());
25 throw std::exception();
26 }

References vhdl::parser::Token::beginLine, vhdl::parser::ErrorHandler::error_count, vhdl::parser::Token::image, m_fileName, vhdl::parser::ErrorHandler::VhdlParser, and warn.

Member Data Documentation

◆ m_fileName

QCString vhdl::parser::VhdlErrorHandler::m_fileName
private

The documentation for this class was generated from the following file: