22 #ifndef QMUPARSERERROR_H
23 #define QMUPARSERERROR_H
25 #include <qcompilerdetection.h>
26 #include <QCoreApplication>
127 return m_vErrMsg.value(a_iIdx).translate();
144 QmuParserError (
const QString &szMsg,
int iPos,
const QString &sTok = QString() );
149 void SetFormula (
const QString &a_strFormula );
150 const QString& GetExpr()
const;
151 const QString& GetMsg()
const;
153 const QString& GetToken()
const;
155 Q_NORETURN
virtual void raise()
const Q_DECL_OVERRIDE;
156 Q_REQUIRED_RESULT
virtual QmuParserError *clone() const Q_DECL_OVERRIDE;
173 m_sExpr = a_strFormula;
A class that handles the error messages.
QmuParserErrorMsg self_type
static const QmuParserErrorMsg & Instance()
QString operator[](int a_iIdx) const
QMap< int, QmuTranslation > m_vErrMsg
A map with the predefined error messages.
static const self_type m_Instance
The instance pointer.
Error class of the parser.
EErrorCodes GetCode() const
Return the error code.
virtual ~QmuParserError() Q_DECL_OVERRIDE
const QString & GetMsg() const
Returns the message string for this error.
int GetPos() const
Return the formula position related to the error.
const QString & GetToken() const
Return string related with this token (if available).
const QString & GetExpr() const
gets the expression related tp this error.
Namespace for mathematical applications.
@ ecDOMAIN_ERROR
catch division by zero, sqrt(-1), log(0) (currently unused)
@ ecUNDEFINED
Undefined message, placeholder to detect unassigned error messages.
@ ecTOO_FEW_PARAMS
Too few function parameters. (Example: "ite(1<2;2)")
@ ecMISSING_PARENS
Missing parens. (Example: "3*sin(3")
@ ecUNEXPECTED_OPERATOR
Unexpected binary operator found.
@ ecOPRT_TYPE_CONFLICT
binary operators may only be applied to value items of the same type
@ ecINVALID_NAME
Invalid function, variable or constant name.
@ ecLOCALE
Conflict with current locale.
@ ecGENERIC
Generic error.
@ ecUNEXPECTED_STR
A string has been found at an inapropriate position.
@ ecINVALID_INFIX_IDENT
Invalid function, variable or constant name.
@ ecBUILTIN_OVERLOAD
Trying to overload builtin operator.
@ ecUNEXPECTED_EOF
Unexpected end of formula. (Example: "2+sin(")
@ ecINVALID_FUN_PTR
Invalid callback function pointer.
@ ecSTRING_EXPECTED
A string function has been called with a different type of argument.
@ ecNAME_CONFLICT
Name conflict.
@ ecVAL_EXPECTED
A numerical function has been called with a non value type of argument.
@ ecUNEXPECTED_FUN
Unexpected function found. (Example: "sin(8)cos(9)")
@ ecUNASSIGNABLE_TOKEN
Token cant be identified.
@ ecUNEXPECTED_ARG_SEP
An unexpected semicolon has been found. (Example: "1;23")
@ ecUNEXPECTED_ARG
An unexpected argument has been found.
@ ecSTR_RESULT
result is a string
@ ecEMPTY_EXPRESSION
The Expression is empty.
@ ecINVALID_POSTFIX_IDENT
Invalid function, variable or constant name.
@ ecTOO_MANY_PARAMS
Too many function parameters.
@ ecOPT_PRI
Invalid operator priority.
@ ecUNEXPECTED_PARENS
Unexpected Parenthesis, opening or closing.
@ ecINVALID_BINOP_IDENT
Invalid binary operator identifier.
@ ecINTERNAL_ERROR
Internal error of any kind.
@ ecUNEXPECTED_VAR
An unexpected variable token has been found.
@ ecUNEXPECTED_CONDITIONAL
@ ecUNEXPECTED_VAL
An unexpected value token has been found.
@ ecINVALID_VAR_PTR
Invalid variable pointer.
@ ecUNTERMINATED_STRING
unterminated string constant. (Example: "3*valueof("hello)")
@ ecDIV_BY_ZERO
Division by zero (currently unused)
@ ecCOUNT
This is no error code, It just stores just the total number of error codes.
This file contains standard definitions used by the parser.
#define QMUP_NOEXCEPT_EXPR(x)
The VTranslation class help store string for translation.