VhdlParserErrorHandler.hpp
Go to the documentation of this file.
1 #ifndef VHDLPARSERERRORHANDLER_H
2 #define VHDLPARSERERRORHANDLER_H
3 
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <exception>
7 #include "VhdlParser.h"
8 #include "ErrorHandler.h"
9 #include "vhdlstring.h"
10 
11 namespace vhdl { namespace parser {
12 
14  {
15  virtual void handleUnexpectedToken(int expectedKind, JAVACC_STRING_TYPE expectedToken, Token *actual, VhdlParser *parser)
16  {
17  fprintf(stderr,"\n\n syntax error at line: %d : %s\n", actual->beginLine,actual->image.data());
18  error_count++;
19  throw std::exception();
20  }
21 
22  virtual void handleParseError(Token *last, Token *unexpected, JAVACC_SIMPLE_STRING production, VhdlParser *parser)
23  {
24  fprintf(stderr,"\n\n unexpected token at line: %d %s\n", last->beginLine,unexpected->image.data());
25  error_count++;
26  throw std::exception();
27  }
28 
30  {
31  fprintf(stderr, "\n\n unexpected error: %s\n", (char*)message.c_str());
32  error_count++;
33  throw std::exception();
34  }
35  };
36 }
37 }
38 
39 #endif
40 
virtual void handleOtherError(JAVACC_STRING_TYPE message, VhdlParser *parser)
#define JAVACC_STRING_TYPE
Definition: JavaCC.h:16
JAVACC_STRING_TYPE image
Definition: Token.h:38
#define JAVACC_SIMPLE_STRING
Definition: JavaCC.h:19
virtual void handleParseError(Token *last, Token *unexpected, JAVACC_SIMPLE_STRING production, VhdlParser *parser)
virtual void handleUnexpectedToken(int expectedKind, JAVACC_STRING_TYPE expectedToken, Token *actual, VhdlParser *parser)
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33