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

#include <vhdlparser/ErrorHandler.h>

+ Inheritance diagram for vhdl::parser::ErrorHandler:

Public Member Functions

virtual void handleUnexpectedToken (int expectedKind, const JJString &expectedToken, Token *actual, VhdlParser *parser)
 
virtual void handleParseError (Token *last, Token *unexpected, const JJSimpleString &production, VhdlParser *parser)
 
virtual int getErrorCount ()
 
virtual void handleOtherError (const JJString &message, VhdlParser *parser)
 
virtual ~ErrorHandler ()
 
 ErrorHandler ()
 

Protected Attributes

int error_count
 

Friends

class VhdlParserTokenManager
 
class VhdlParser
 

Detailed Description

Definition at line 17 of file ErrorHandler.h.

Constructor & Destructor Documentation

◆ ~ErrorHandler()

virtual vhdl::parser::ErrorHandler::~ErrorHandler ( )
inlinevirtual

Definition at line 46 of file ErrorHandler.h.

46{}

◆ ErrorHandler()

vhdl::parser::ErrorHandler::ErrorHandler ( )
inline

Definition at line 47 of file ErrorHandler.h.

References error_count.

Member Function Documentation

◆ getErrorCount()

virtual int vhdl::parser::ErrorHandler::getErrorCount ( )
inlinevirtual

Definition at line 40 of file ErrorHandler.h.

40 {
41 return error_count;
42 }

References error_count.

◆ handleOtherError()

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

Reimplemented in vhdl::parser::VhdlErrorHandler.

Definition at line 43 of file ErrorHandler.h.

43 {
44 fprintf(stderr, "Error: %s\n", (char*)message.c_str());
45 }

References VhdlParser.

◆ handleParseError()

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

Reimplemented in vhdl::parser::VhdlErrorHandler.

Definition at line 36 of file ErrorHandler.h.

36 {
38 fprintf(stderr, "Encountered: %s at: %d:%d while parsing: %s\n", addUnicodeEscapes(unexpected->image).c_str(), unexpected->beginLine, unexpected->beginColumn, production.c_str());
39 }
JJSimpleString addUnicodeEscapes(const JJString &str)

References vhdl::parser::addUnicodeEscapes(), vhdl::parser::Token::beginColumn, vhdl::parser::Token::beginLine, error_count, vhdl::parser::Token::image, and VhdlParser.

◆ handleUnexpectedToken()

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

Reimplemented in vhdl::parser::VhdlErrorHandler.

Definition at line 28 of file ErrorHandler.h.

28 {
30 fprintf(stderr, "Expecting %s at: %d:%d but got %s\n", addUnicodeEscapes(expectedToken).c_str(), actual->beginLine, actual->beginColumn, addUnicodeEscapes(actual->image).c_str());
31 }

References vhdl::parser::addUnicodeEscapes(), vhdl::parser::Token::beginColumn, vhdl::parser::Token::beginLine, error_count, vhdl::parser::Token::image, and VhdlParser.

Friends And Related Symbol Documentation

◆ VhdlParser

◆ VhdlParserTokenManager

friend class VhdlParserTokenManager
friend

Definition at line 18 of file ErrorHandler.h.

References VhdlParserTokenManager.

Referenced by VhdlParserTokenManager.

Member Data Documentation

◆ error_count


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