Skip to content

Commit 5bda6a1

Browse files
committed
Warnings in case of a VHDL error
When having a vhdl construct like: ``` entity _H_ is ``` we get the, a bit unclear, warnings like: ``` Lexical error at: 16:8. Encountered: _ after: . ``` with version 1.8.17 we got the warning: ``` .../vhdl.vhd:16: warning: Lexical error, Encountered: '_' after: '' ``` not 100% clear either but at least clear which file is involved and what the meaning of the '16' is. Also the message didn't conform the doxygen style / place / handling of warnings / errors anymore (didn't go to the WARN_LOGFILE anymore). (The message is correct as a vhdl identifier cannot start or end with an underscore. Between the used javaCC versions (now 7.05) and the previously used version 6.xx apparently a small in the error handler prototypes has been introduces, and thus not finding the doxygen version anymore.
1 parent 80bcbbb commit 5bda6a1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: vhdlparser/VhdlParserErrorHandler.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ class VhdlErrorHandler: public ErrorHandler
1818
public:
1919
VhdlErrorHandler(const char *fileName) : m_fileName(fileName) {}
2020

21-
virtual void handleUnexpectedToken(int expectedKind, JAVACC_STRING_TYPE expectedToken, Token *actual, VhdlParser *parser)
21+
virtual void handleUnexpectedToken(int expectedKind, const JJString& expectedToken, Token *actual, VhdlParser *parser)
2222
{
2323
warn(m_fileName,actual->beginLine,"syntax error '%s'",actual->image.data());
2424
error_count++;
2525
throw std::exception();
2626
}
2727

28-
virtual void handleParseError(Token *last, Token *unexpected, JAVACC_SIMPLE_STRING production, VhdlParser *parser)
28+
virtual void handleParseError(Token *last, Token *unexpected, const JJSimpleString& production, VhdlParser *parser)
2929
{
3030
warn(m_fileName,last->beginLine,"unexpected token: '%s'", unexpected->image.data());
3131
error_count++;
3232
throw std::exception();
3333
}
3434

35-
virtual void handleOtherError(JAVACC_STRING_TYPE message, VhdlParser *parser)
35+
virtual void handleOtherError(const JJString& message, VhdlParser *parser)
3636
{
3737
warn(m_fileName, -1, "unexpected error: '%s'", (char*)message.c_str());
3838
error_count++;
@@ -48,12 +48,12 @@ class VhdlTokenManagerErrorHandler: public TokenManagerErrorHandler
4848
public:
4949
VhdlTokenManagerErrorHandler(const char *fileName) : m_fileName(fileName) {}
5050

51-
virtual void lexicalError(bool EOFSeen, int lexState, int errorLine, int errorColumn, JAVACC_STRING_TYPE errorAfter, JAVACC_CHAR_TYPE curChar, VhdlParserTokenManager* token_manager)
51+
virtual void lexicalError(bool EOFSeen, int lexState, int errorLine, int errorColumn, const JJString& errorAfter, JJChar curChar, VhdlParserTokenManager* token_manager)
5252
{
5353
warn(m_fileName,errorLine,"Lexical error, Encountered: '%c' after: '%s'",curChar, (EOFSeen? "EOF" : (const char*)errorAfter.c_str()));
5454
}
5555

56-
virtual void lexicalError(JAVACC_STRING_TYPE errorMessage, VhdlParserTokenManager* token_manager)
56+
virtual void lexicalError(const JJString& errorMessage, VhdlParserTokenManager* token_manager)
5757
{
5858
warn(m_fileName,-1,"Unknown error: '%s'", (char*)errorMessage.c_str());
5959
}

0 commit comments

Comments
 (0)