| 173 | } |
| 174 | |
| 175 | void SLaddMLErrorContext(SV3_1aPythonListener* prog, |
| 176 | antlr4::ParserRuleContext* context1, |
| 177 | antlr4::ParserRuleContext* context2, |
| 178 | const char* messageId, const char* objectName1, |
| 179 | const char* objectName2, bool printColumn) { |
| 180 | #ifdef SURELOG_WITH_PYTHON |
| 181 | SV3_1aPythonListener* listener = prog; |
| 182 | antlr4::ParserRuleContext* ctx1 = context1; |
| 183 | antlr4::ParserRuleContext* ctx2 = context2; |
| 184 | ErrorContainer* errors = |
| 185 | listener->getPythonListen()->getCompileSourceFile()->getErrorContainer(); |
| 186 | ParseUtils::LineColumn lineCol1 = |
| 187 | ParseUtils::getLineColumn(listener->getTokenStream(), ctx1); |
| 188 | ParseUtils::LineColumn lineCol2 = |
| 189 | ParseUtils::getLineColumn(listener->getTokenStream(), ctx2); |
| 190 | ErrorDefinition::ErrorType type = ErrorDefinition::getErrorType(messageId); |
| 191 | |
| 192 | Location loc1( |
| 193 | listener->getPythonListen()->getParseFile()->getFileId(lineCol1.first), |
| 194 | listener->getPythonListen()->getParseFile()->getLineNb(lineCol1.first), |
| 195 | printColumn ? lineCol1.second : 0, |
| 196 | listener->getPythonListen() |
| 197 | ->getCompileSourceFile() |
| 198 | ->getSymbolTable() |
| 199 | ->registerSymbol(objectName1)); |
| 200 | |
| 201 | Location loc2( |
| 202 | listener->getPythonListen()->getParseFile()->getFileId(lineCol2.first), |
| 203 | listener->getPythonListen()->getParseFile()->getLineNb(lineCol2.first), |
| 204 | printColumn ? lineCol2.second : 0, |
| 205 | listener->getPythonListen() |
| 206 | ->getCompileSourceFile() |
| 207 | ->getSymbolTable() |
| 208 | ->registerSymbol(objectName2)); |
| 209 | Error err(type, loc1, loc2); |
| 210 | errors->addError(err, false, false); |
| 211 | #else |
| 212 | std::cerr << "SLaddMLErrorContext(): Python support not compiled in\n"; |
| 213 | #endif |
| 214 | } |
| 215 | |
| 216 | std::string SLgetFile(SV3_1aPythonListener* prog, |
| 217 | antlr4::ParserRuleContext* context) { |
nothing calls this directly
no test coverage detected