MCPcopy Create free account
hub / github.com/chipsalliance/Surelog / SLaddErrorContext

Function SLaddErrorContext

src/API/SLAPI.cpp:147–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147void SLaddErrorContext(SV3_1aPythonListener* prog,
148 antlr4::ParserRuleContext* context,
149 const char* messageId, const char* objectName,
150 bool printColumn) {
151#ifdef SURELOG_WITH_PYTHON
152 SV3_1aPythonListener* listener = prog;
153 antlr4::ParserRuleContext* ctx = context;
154 ErrorContainer* errors =
155 listener->getPythonListen()->getCompileSourceFile()->getErrorContainer();
156 ParseUtils::LineColumn lineCol =
157 ParseUtils::getLineColumn(listener->getTokenStream(), ctx);
158 ErrorDefinition::ErrorType type = ErrorDefinition::getErrorType(messageId);
159
160 Location loc(
161 listener->getPythonListen()->getParseFile()->getFileId(lineCol.first),
162 listener->getPythonListen()->getParseFile()->getLineNb(lineCol.first),
163 printColumn ? lineCol.second : 0,
164 listener->getPythonListen()
165 ->getCompileSourceFile()
166 ->getSymbolTable()
167 ->registerSymbol(objectName));
168 Error err(type, loc);
169 errors->addError(err, false, false);
170#else
171 std::cerr << "SLaddErrorContext(): Python support not compiled in\n";
172#endif
173}
174
175void SLaddMLErrorContext(SV3_1aPythonListener* prog,
176 antlr4::ParserRuleContext* context1,

Callers 8

enterModule_ansi_headerFunction · 0.85
enterModule_ansi_headerFunction · 0.85
enterModule_ansi_headerFunction · 0.85
enterModule_ansi_headerFunction · 0.85

Calls 9

getParseFileMethod · 0.80
getErrorContainerMethod · 0.45
getCompileSourceFileMethod · 0.45
getTokenStreamMethod · 0.45
getFileIdMethod · 0.45
getLineNbMethod · 0.45
registerSymbolMethod · 0.45
getSymbolTableMethod · 0.45
addErrorMethod · 0.45

Tested by

no test coverage detected