Public Member Functions | Protected Attributes | Friends | List of all members
vhdl::parser::ErrorHandler Class Reference

#include <ErrorHandler.h>

Inheritance diagram for vhdl::parser::ErrorHandler:
vhdl::parser::VhdlErrorHandler

Public Member Functions

virtual void handleUnexpectedToken (int expectedKind, JAVACC_STRING_TYPE expectedToken, Token *actual, VhdlParser *parser)
 
virtual void handleParseError (Token *last, Token *unexpected, JAVACC_SIMPLE_STRING production, VhdlParser *parser)
 
virtual int getErrorCount ()
 
virtual void handleOtherError (JAVACC_STRING_TYPE message, VhdlParser *parser)
 
virtual ~ErrorHandler ()
 
 ErrorHandler ()
 

Protected Attributes

int error_count
 

Friends

class VhdlParserTokenManager
 
class VhdlParser
 

Detailed Description

Definition at line 16 of file ErrorHandler.h.

Constructor & Destructor Documentation

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

Definition at line 45 of file ErrorHandler.h.

45 {}
vhdl::parser::ErrorHandler::ErrorHandler ( )
inline

Definition at line 46 of file ErrorHandler.h.

Member Function Documentation

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

Definition at line 39 of file ErrorHandler.h.

39  {
40  return error_count;
41  }
virtual void vhdl::parser::ErrorHandler::handleOtherError ( JAVACC_STRING_TYPE  message,
VhdlParser parser 
)
inlinevirtual

Reimplemented in vhdl::parser::VhdlErrorHandler.

Definition at line 42 of file ErrorHandler.h.

42  {
43  fprintf(stderr, "Error: %s\n", (char*)message.c_str());
44  }
virtual void vhdl::parser::ErrorHandler::handleParseError ( Token last,
Token unexpected,
JAVACC_SIMPLE_STRING  production,
VhdlParser parser 
)
inlinevirtual

Reimplemented in vhdl::parser::VhdlErrorHandler.

Definition at line 35 of file ErrorHandler.h.

35  {
36  error_count++;
37  fprintf(stderr, "Encountered: %s at: %d:%d while parsing: %s\n", addUnicodeEscapes(unexpected->image).c_str(), unexpected->beginLine, unexpected->beginColumn, production.c_str());
38  }
JAVACC_SIMPLE_STRING addUnicodeEscapes(JAVACC_STRING_TYPE str)
virtual void vhdl::parser::ErrorHandler::handleUnexpectedToken ( int  expectedKind,
JAVACC_STRING_TYPE  expectedToken,
Token actual,
VhdlParser parser 
)
inlinevirtual

Reimplemented in vhdl::parser::VhdlErrorHandler.

Definition at line 27 of file ErrorHandler.h.

27  {
28  error_count++;
29  fprintf(stderr, "Expecting %s at: %d:%d but got %s\n", addUnicodeEscapes(expectedToken).c_str(), actual->beginLine, actual->beginColumn, addUnicodeEscapes(actual->image).c_str());
30  }
JAVACC_SIMPLE_STRING addUnicodeEscapes(JAVACC_STRING_TYPE str)

Friends And Related Function Documentation

friend class VhdlParser
friend

Definition at line 18 of file ErrorHandler.h.

friend class VhdlParserTokenManager
friend

Definition at line 17 of file ErrorHandler.h.

Member Data Documentation

int vhdl::parser::ErrorHandler::error_count
protected

Definition at line 20 of file ErrorHandler.h.


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