forked from jasder/antlr
getSerializedATN() wasn't properly overwritten.
This commit is contained in:
parent
a6699eac34
commit
2352ff03e1
|
@ -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) {
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)>
|
||||
|
|
Loading…
Reference in New Issue