1 #ifndef VHDLPARSERERRORHANDLER_H
2 #define VHDLPARSERERRORHANDLER_H
7 #include "VhdlParser.h"
8 #include "ErrorHandler.h"
9 #include "vhdlstring.h"
11 namespace vhdl { namespace parser {
13 class VhdlErrorHandler: public ErrorHandler
15 virtual void handleUnexpectedToken(int expectedKind, JAVACC_STRING_TYPE expectedToken, Token *actual, VhdlParser *parser)
17 fprintf(stderr,"\n\n syntax error at line: %d : %s\n", actual->beginLine,actual->image.data());
19 throw std::exception();
22 virtual void handleParseError(Token *last, Token *unexpected, JAVACC_SIMPLE_STRING production, VhdlParser *parser)
24 fprintf(stderr,"\n\n unexpected token at line: %d %s\n", last->beginLine,unexpected->image.data());
26 throw std::exception();
29 virtual void handleOtherError(JAVACC_STRING_TYPE message, VhdlParser *parser)
31 fprintf(stderr, "\n\n unexpected error: %s\n", (char*)message.c_str());
33 throw std::exception();