-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparsererrorlistener.cpp
31 lines (26 loc) · 1.43 KB
/
parsererrorlistener.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "parsererrorlistener.h"
#include <Exceptions.h>
#include <sstream>
ParserErrorListener::ParserErrorListener() {}
ParserErrorListener::~ParserErrorListener() {}
void ParserErrorListener::syntaxError(Recognizer *, Token *, size_t line,
size_t charPositionInLine,
const std::string &msg,
std::exception_ptr) {
std::stringstream stm;
stm << "error line " << line << ":" << charPositionInLine << " " << msg
<< std::endl;
throw antlr4::RuntimeException(stm.str());
}
void ParserErrorListener::reportAmbiguity(Parser *, const dfa::DFA &, size_t,
size_t, bool,
const antlrcpp::BitSet &,
atn::ATNConfigSet *) {}
void ParserErrorListener::reportAttemptingFullContext(Parser *,
const dfa::DFA &, size_t,
size_t,
const antlrcpp::BitSet &,
atn::ATNConfigSet *) {}
void ParserErrorListener::reportContextSensitivity(Parser *, const dfa::DFA &,
size_t, size_t, size_t,
atn::ATNConfigSet *) {}