| 145 | } |
| 146 | |
| 147 | void 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 | |
| 175 | void SLaddMLErrorContext(SV3_1aPythonListener* prog, |
| 176 | antlr4::ParserRuleContext* context1, |
no test coverage detected