1 #ifndef GUI_OBJUTILS___MACRO_EX__HPP
2 #define GUI_OBJUTILS___MACRO_EX__HPP
100 switch (GetErrCode()) {
101 case eParseKeywordExpected:
return "eKeywordExpected";
102 case eParseAsnSelectorExpected:
return "eSelectorExpected";
104 case eParseMacroNameExpected:
return "eMacroNameExpected";
106 case eParseVariableDefined:
return "eVarDefined";
107 case eParseVarDefinitionExpected:
return "eVarDefinitionExpected";
108 case eParseUndefinedVariable:
return "eUndefinedVar";
109 case eParseIdentifierNameExpected:
return "eIdentifierNameExpected";
110 case eParseWrongVariableUsage:
return "eWrongVariableUsage";
112 case eParseAssignmentExpected:
return "eAssignmentExpected";
113 case eParseAssignmentToConst:
return "eWrongVarAssignment";
116 case eParseLeftBraceExpected:
return "eLeftBraceExpected";
117 case eParseCommaOrRightBraceExpected:
return "eCommaOrRightBraceExpected";
118 case eParseLeftParenthesisExpected:
return "eLeftParanthExpected";
119 case eParseRightParenthesisExpected:
return "eRightParanthExpected";
121 case eParseWhereClauseExpected:
return "eWhereSectionExpected";
122 case eParseWhereClauseInvalid:
return "eInvalidWhereSection";
124 case eParseFunctionOrObjectNameExpected:
return "eFncOrObjectexpected";
125 case eParseFunctionExpected:
return "eFncNameExpected";
126 case eParseFunctionOrDoneExpected:
return "eFncOrDONEExpected";
127 case eParseEndOfFunction:
return "eEndOfFunction";
129 case eParseNothingExpected:
return "eNoTokenExpected";
130 case eParseSemicolonExpected:
return "eSemicolonExpected";
131 case eParseSeparatorExpected:
return "eSeparatorExpected";
150 const CException* prev_exception, EErrCode err_code,
163 out <<
"Data context:" << endl;
217 const CException *prev_exception, EErrCode err_code,
218 const string &message,
unsigned lineNo = 0,
unsigned columnNo = 0,
EDiagSev severity =
eDiag_Error)
229 case eInternalError:
return "Internal error";
230 case eWrongArguments:
return "Wrong arguments";
231 case eIncorrectIdentifier:
return "Incorrect identifier";
232 case eFunctionNotImplemented:
return "Function was not implemented";
233 case eWrongFunctionScope:
return "Wrong function scope";
234 case eInvalidQuery:
return "Invalid query";
235 case eIncorrectNodeType:
return "Incorrect node type";
236 case eVarNotResolved:
return "Variable not resolved";
237 case eInvalidData:
return "Invalid data";
238 case eFileNotFound:
return "File not found";
239 case eMultipleEntries:
return "Multiple entries in the table file";
240 case eSynonymsNotFound:
return "Synonyms of a phrase not found";
247 unsigned GetLineNo(
void)
const throw() {
return m_LineNo; }
250 void SetLineNo(
unsigned lineNo)
throw() { m_LineNo = lineNo; }
255 void SetColumnNo(
unsigned columnNo)
throw() { m_ColumnNo = columnNo; }
259 out <<
"[Error] Line " << m_LineNo <<
", Pos " << m_ColumnNo << endl;
282 unsigned columnNo(0);
286 lineNo = loc.
line + 1;
287 columnNo = loc.
pos + 1;
Incapsulate compile time information such as __FILE__, __LINE__, NCBI_MODULE, current function.
class CMacroExecException
class CMacroExecException
definition of a Culling tree
std::ofstream out("events_result.xml")
main entry point for tests
EDiagSev
Severity level for the posted diagnostics.
@ eDiag_Error
Error message.
TErrCode GetErrCode(void) const
Get error code.
virtual void x_Assign(const CException &src)
Helper method for copying exception data.
#define NCBI_EXCEPTION_DEFAULT_IMPLEMENTATION(exception_class, base_class)
Helper macro for default exception implementation.
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
#define EXCEPTION_VIRTUAL_BASE
Do not use virtual base classes in exception declaration at all, because in this case derived class s...
CException(void)
Constructor with no arguments.
virtual void x_Assign(const CException &src) override
virtual void ReportExtra(ostream &out) const override
virtual void ReportExtra(ostream &out) const override
Constructor.
void ThrowCMacroExecException(const CDiagCompileInfo &info, CMacroExecException::EErrCode code, const string &message, const CQueryParseTree::TNode *treeNode, const CException *previous=nullptr)
Throws CMacroExecException with the specified message and error location from the TNode.
CConstRef< CSerialObject > GetData() const
Returns the ASN.1 data that caused the error.
void SetColumnNo(unsigned columnNo)
Sets the column number where error occurred.
unsigned GetColumnNo(void) const
Returns the column number where error occurred.
virtual const char * GetErrCodeString(void) const override
virtual const char * GetErrCodeString(void) const override
virtual void x_Assign(const CException &src) override
void SetLineNo(unsigned lineNo)
Sets the line number where error occurred.
unsigned GetLineNo(void) const
Returns the line number where error occurred.
NCBI_EXCEPTION_DEFAULT(CMacroParseException, CException)
string GetDataAsString() const
Returns the text encoded ASN.1 data that caused the error.
unsigned m_ColumnNo
Column where the error occured.
unsigned m_LineNo
Line where the error occured.
CConstRef< CSerialObject > m_Data
@ eParseAsnSelectorExpected
@ eParseRightParenthesisExpected
@ eParseWhereClauseExpected
@ eParseAssignmentToConst
@ eParseCommaOrRightBraceExpected
@ eParseSeparatorExpected
@ eParseFunctionOrDoneExpected
@ eParseMacroNameExpected
@ eParseWhereClauseInvalid
@ eParseThreadCountInvalid
@ eParseNamedAnnotExpected
@ eParseVarDefinitionExpected
@ eParseUndefinedVariable
@ eParseIdentifierNameExpected
@ eParseWrongVariableUsage
@ eParseLeftParenthesisExpected
@ eParseRightBracketExpected
@ eParseFunctionOrObjectNameExpected
@ eParseLeftBraceExpected
@ eParseAssignmentExpected
@ eParseLeftBracketExpected
@ eParseSemicolonExpected
@ eFunctionNotImplemented
#define MSerial_AsnText
I/O stream manipulators –.
unsigned pos
Position in the src line.
unsigned line
Src line number.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
const TValue & GetValue(void) const
Return node's value.
#define NCBI_GUIOBJUTILS_EXPORT
Defines to provide correct exporting from DLLs in Windows.
Defines NCBI C++ exception handling.
Query string parsing components.
Source location (points to the position in the original src) All positions are 0 based.