getSerializedATN() wasn't properly overwritten.

This commit is contained in:
Mike Lischke 2016-06-26 11:10:24 +02:00
parent a6699eac34
commit 2352ff03e1
4 changed files with 5 additions and 6 deletions

View File

@ -263,13 +263,12 @@ void Lexer::recover(const LexerNoViableAltException &/*e*/) {
}
}
void Lexer::notifyListeners(const LexerNoViableAltException &e) {
void Lexer::notifyListeners(const LexerNoViableAltException & /*e*/) {
std::string text = _input->getText(misc::Interval(tokenStartCharIndex, (int)_input->index()));
std::string msg = std::string("token recognition error at: '") + getErrorDisplay(text) + std::string("'");
ProxyErrorListener &listener = getErrorListenerDispatch();
listener.syntaxError(this, nullptr, tokenStartLine, tokenStartCharPositionInLine, msg,
std::make_exception_ptr(e));
listener.syntaxError(this, nullptr, tokenStartLine, tokenStartCharPositionInLine, msg, std::current_exception());
}
std::string Lexer::getErrorDisplay(const std::string &s) {

View File

@ -83,7 +83,7 @@ namespace antlr4 {
/// For interpreters, we don't know their serialized ATN despite having
/// created the interpreter from it.
/// </summary>
virtual std::vector<uint16_t> getSerializedATN() {
virtual const std::vector<uint16_t> getSerializedATN() const {
throw "there is no serialized ATN";
}

View File

@ -26,7 +26,7 @@ public:
virtual const std::vector<std::string>& getTokenNames() const override; // deprecated, use vocabulary instead
virtual const dfa::Vocabulary& getVocabulary() const override;
virtual const std::vector<uint16_t> getSerializedATN() const;
virtual const std::vector<uint16_t> getSerializedATN() const override;
virtual const atn::ATN& getATN() const override;
virtual void action(Ref<RuleContext> const& context, int ruleIndex, int actionIndex) override;

View File

@ -68,7 +68,7 @@ public:
virtual const std::vector\<std::string>& getTokenNames() const override; // deprecated, use vocabulary instead
virtual dfa::Vocabulary& getVocabulary() const override;
virtual const std::vector\<uint16_t> getSerializedATN() const;
virtual const std::vector\<uint16_t> getSerializedATN() const override;
virtual const atn::ATN& getATN() const override;
<if (actionFuncs)>