36 #define translate(context, source, disambiguation) QmuTranslation::translate((context), (source), (disambiguation))
45 translate(
"QmuParserErrorMsg",
"Unexpected token \"$TOK$\" found at position $POS$.",
46 "Math parser error messages. Left untouched \"$TOK$\" and $POS$"));
48 translate(
"QmuParserErrorMsg",
"Internal error",
49 "Math parser error messages."));
51 translate(
"QmuParserErrorMsg",
"Invalid function-, variable- or constant name: \"$TOK$\".",
52 "Math parser error messages. Left untouched \"$TOK$\""));
54 translate(
"QmuParserErrorMsg",
"Invalid binary operator identifier: \"$TOK$\".",
55 "Math parser error messages. Left untouched \"$TOK$\""));
57 translate(
"QmuParserErrorMsg",
"Invalid infix operator identifier: \"$TOK$\".",
58 "Math parser error messages. Left untouched \"$TOK$\""));
60 translate(
"QmuParserErrorMsg",
"Invalid postfix operator identifier: \"$TOK$\".",
61 "Math parser error messages. Left untouched \"$TOK$\""));
63 translate(
"QmuParserErrorMsg",
"Invalid pointer to callback function.",
64 "Math parser error messages."));
66 translate(
"QmuParserErrorMsg",
"Expression is empty.",
67 "Math parser error messages."));
69 translate(
"QmuParserErrorMsg",
"Invalid pointer to variable.",
70 "Math parser error messages."));
72 translate(
"QmuParserErrorMsg",
"Unexpected operator \"$TOK$\" found at position $POS$",
73 "Math parser error messages. Left untouched \"$TOK$\" and $POS$"));
75 translate(
"QmuParserErrorMsg",
"Unexpected end of expression at position $POS$",
76 "Math parser error messages. Left untouched $POS$"));
78 translate(
"QmuParserErrorMsg",
"Unexpected argument separator at position $POS$",
79 "Math parser error messages. Left untouched $POS$"));
81 translate(
"QmuParserErrorMsg",
"Unexpected parenthesis \"$TOK$\" at position $POS$",
82 "Math parser error messages. Left untouched \"$TOK$\" and $POS$"));
84 translate(
"QmuParserErrorMsg",
"Unexpected function \"$TOK$\" at position $POS$",
85 "Math parser error messages. Left untouched \"$TOK$\" and $POS$"));
87 translate(
"QmuParserErrorMsg",
"Unexpected value \"$TOK$\" found at position $POS$",
88 "Math parser error messages. Left untouched \"$TOK$\" and $POS$"));
90 translate(
"QmuParserErrorMsg",
"Unexpected variable \"$TOK$\" found at position $POS$",
91 "Math parser error messages. Left untouched \"$TOK$\" and $POS$"));
93 translate(
"QmuParserErrorMsg",
"Function arguments used without a function (position: $POS$)",
94 "Math parser error messages. Left untouched $POS$"));
96 translate(
"QmuParserErrorMsg",
"Missing parenthesis",
97 "Math parser error messages."));
100 "Too many parameters for function \"$TOK$\" at expression position $POS$",
101 "Math parser error messages. Left untouched \"$TOK$\" and $POS$"));
104 "Too few parameters for function \"$TOK$\" at expression position $POS$",
105 "Math parser error messages. Left untouched \"$TOK$\" and $POS$"));
107 translate(
"QmuParserErrorMsg",
"Divide by zero",
108 "Math parser error messages."));
110 translate(
"QmuParserErrorMsg",
"Domain error",
111 "Math parser error messages."));
113 translate(
"QmuParserErrorMsg",
"Name conflict",
114 "Math parser error messages."));
117 "Invalid value for operator priority (must be greater or equal to zero).",
118 "Math parser error messages."));
121 "user defined binary operator \"$TOK$\" conflicts with a built in operator.",
122 "Math parser error messages. Left untouched \"$TOK$\""));
124 translate(
"QmuParserErrorMsg",
"Unexpected string token found at position $POS$.",
125 "Math parser error messages. Left untouched $POS$"));
127 translate(
"QmuParserErrorMsg",
"Unterminated string starting at position $POS$.",
128 "Math parser error messages. Left untouched $POS$"));
130 translate(
"QmuParserErrorMsg",
"String function called with a non string type of argument.",
131 "Math parser error messages."));
133 translate(
"QmuParserErrorMsg",
"String value used where a numerical argument is expected.",
134 "Math parser error messages."));
136 translate(
"QmuParserErrorMsg",
"No suitable overload for operator \"$TOK$\" at position $POS$.",
137 "Math parser error messages. Left untouched \"$TOK$\" and $POS$"));
139 translate(
"QmuParserErrorMsg",
"Function result is a string.",
140 "Math parser error messages."));
142 translate(
"QmuParserErrorMsg",
"Parser error.",
143 "Math parser error messages."));
145 translate(
"QmuParserErrorMsg",
"Decimal separator is identic to function argument separator.",
146 "Math parser error messages."));
148 translate(
"QmuParserErrorMsg",
"The \"$TOK$\" operator must be preceded by a closing bracket.",
149 "Math parser error messages. Left untouched \"$TOK$\""));
151 translate(
"QmuParserErrorMsg",
"If-then-else operator is missing an else clause",
152 "Math parser error messages. Do not translate operator name."));
154 translate(
"QmuParserErrorMsg",
"Misplaced colon at position $POS$",
155 "Math parser error messages. Left untouched $POS$"));
170 : QException(), m_sMsg(), m_sExpr(), m_sTok(), m_iPos ( -1 ), m_iErrc (
ecUNDEFINED ),
181 : QException(), m_sMsg(), m_sExpr(), m_sTok(), m_iPos ( -1 ), m_iErrc ( a_iErrc ),
194 : QException(), m_sMsg(sMsg), m_sExpr(), m_sTok(), m_iPos ( -1 ), m_iErrc (
ecUNDEFINED ),
207 : QException(), m_sMsg(), m_sExpr ( sExpr ), m_sTok ( sTok ), m_iPos ( iPos ), m_iErrc ( iErrc ),
223 : QException(), m_sMsg(), m_sExpr(), m_sTok ( sTok ), m_iPos ( a_iPos ), m_iErrc ( a_iErrc ),
238 : QException(), m_sMsg ( szMsg ), m_sExpr(), m_sTok ( sTok ), m_iPos ( iPos ), m_iErrc (
ecGENERIC ),
250 : QException(), m_sMsg ( a_Obj.m_sMsg ), m_sExpr ( a_Obj.m_sExpr ), m_sTok ( a_Obj.m_sTok ),
251 m_iPos ( a_Obj.m_iPos ), m_iErrc ( a_Obj.m_iErrc ), m_ErrMsg (
QmuParserErrorMsg::Instance() )
258 if (
this == &a_Obj )
A class that handles the error messages.
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.
QString m_sExpr
Formula string.
QString m_sTok
Token related with the error.
int m_iPos
Formula position related to the error.
EErrorCodes m_iErrc
Error code.
QmuParserError()
Default constructor.
virtual Q_REQUIRED_RESULT QmuParserError * clone() const Q_DECL_OVERRIDE
clone clone exception
void Reset()
Reset the erro object.
virtual Q_NORETURN void raise() const Q_DECL_OVERRIDE
raise method raise for exception
QString m_sMsg
The message string.
const QmuParserErrorMsg & m_ErrMsg
QmuParserError & operator=(const QmuParserError &a_Obj)
Assignment operator.
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)
#define translate(context, source, disambiguation)
This file defines the error class used by the parser.