MCPcopy Create free account
hub / github.com/Nic30/hdlConvertor / syntaxError

Method syntaxError

src/syntaxErrorLogger.cpp:35–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void SyntaxErrorLogger::syntaxError(antlr4::Recognizer *recognizer,
36 antlr4::Token *UNUSED(offendingSymbol), size_t line, size_t charPositionInLine,
37 const string &msg, exception_ptr UNUSED(e)) {
38
39 ErrorData err;
40 // use offsets and overrides from file_line_map if available
41 if (file_line_map && !file_line_map->empty()) {
42 const auto &lm = file_line_map->back();
43 assert(line >= lm.line);
44 err.line = lm.line_override + (line - lm.line);
45 err.filename = lm.file_override;
46 } else {
47 err.line = line;
48 err.filename = recognizer->getInputStream()->getSourceName();
49 }
50 err.charPosition = charPositionInLine;
51 err.message = msg;
52
53 _errors.push_back(err);
54 //cerr << line << ":" << charPositionInLine << ":SyntaxError:" << msg << "\n";
55}
56
57void SyntaxErrorLogger::reportAmbiguity(antlr4::Parser *UNUSED(recognizer),
58 const antlr4::dfa::DFA &UNUSED(dfa), size_t UNUSED(startIndex),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected