35 #define QMUP_VERSION "2.5.0"
36 #define QMUP_VERSION_DATE "20170101; GC"
38 #define QMUP_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
41 # if defined(__clang__)
42 # if __has_feature(cxx_noexcept)
43 # define QMUP_NOEXCEPT_EXPR(x) noexcept(x)
45 # elif defined(__GNUC__)
46 # if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
47 # define QMUP_NOEXCEPT_EXPR(x) noexcept(x)
49 # elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026
50 # define QMUP_NOEXCEPT_EXPR(x) noexcept(x)
52 # define QMUP_NOEXCEPT_EXPR(x)
55 #ifndef __has_cpp_attribute
56 # define __has_cpp_attribute(x) 0
59 #if __cplusplus > 201402L && __has_cpp_attribute(fallthrough)
60 # define QMUP_FALLTHROUGH [[fallthrough]];
61 #elif defined(Q_CC_CLANG) && __cplusplus >= 201103L
63 # define QMUP_FALLTHROUGH [[clang::fallthrough]];
64 #elif defined(Q_CC_MSVC)
70 # define QMUP_FALLTHROUGH __fallthrough;
71 #elif defined(Q_CC_GNU) && (__GNUC__ >= 7)
72 # define QMUP_FALLTHROUGH [[gnu::fallthrough]];
74 # define QMUP_FALLTHROUGH
87 #define QMUP_STRING_TYPE std::wstring
205 typedef std::basic_stringstream < char_type, std::char_traits<char_type>, std::allocator<char_type> >
stringstream_type;
236 typedef qreal ( *
fun_type4 ) ( qreal, qreal, qreal, qreal );
239 typedef qreal ( *
fun_type5 ) ( qreal, qreal, qreal, qreal, qreal );
242 typedef qreal ( *
fun_type6 ) ( qreal, qreal, qreal, qreal, qreal, qreal );
245 typedef qreal ( *
fun_type7 ) ( qreal, qreal, qreal, qreal, qreal, qreal, qreal );
248 typedef qreal ( *
fun_type8 ) ( qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal );
251 typedef qreal ( *
fun_type9 ) ( qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal );
254 typedef qreal ( *
fun_type10 ) ( qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal );
272 typedef qreal ( *
bulkfun_type5 ) ( int, int, qreal, qreal, qreal, qreal, qreal );
275 typedef qreal ( *
bulkfun_type6 ) ( int, int, qreal, qreal, qreal, qreal, qreal, qreal );
278 typedef qreal ( *
bulkfun_type7 ) ( int, int, qreal, qreal, qreal, qreal, qreal, qreal, qreal );
281 typedef qreal ( *
bulkfun_type8 ) ( int, int, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal );
284 typedef qreal ( *
bulkfun_type9 ) ( int, int, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal );
287 typedef qreal ( *
bulkfun_type10 ) ( int, int, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal );
302 typedef int ( *
identfun_type ) (
const QString &sExpr,
int *nPos, qreal *fVal,
const QLocale &locale,
303 const QChar &decimal,
const QChar &thousand );
306 typedef qreal* ( *facfun_type ) (
const QString &,
void* );
Namespace for mathematical applications.
qreal(* bulkfun_type10)(int, int, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal)
Callback type used for functions with five arguments.
std::map< QString, int > strmap_type
Type for assigning a string name to an index in the internal string table.
string_type::value_type char_type
The character type used by the parser.
qreal(* bulkfun_type4)(int, int, qreal, qreal, qreal, qreal)
Callback type used for functions with four arguments.
qreal(* fun_type7)(qreal, qreal, qreal, qreal, qreal, qreal, qreal)
Callback type used for functions with five arguments.
qreal(* fun_type10)(qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal)
Callback type used for functions with five arguments.
qreal(* fun_type3)(qreal, qreal, qreal)
Callback type used for functions with three arguments.
qreal(* fun_type8)(qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal)
Callback type used for functions with five arguments.
qreal(* bulkfun_type5)(int, int, qreal, qreal, qreal, qreal, qreal)
Callback type used for functions with five arguments.
int(* identfun_type)(const QString &sExpr, int *nPos, qreal *fVal, const QLocale &locale, const QChar &decimal, const QChar &thousand)
Callback used for functions that identify values in a string.
@ cmOPRT_INFIX
code for infix operators
@ cmBC
Operator item: closing bracket.
@ cmLE
Operator item: less or equal.
@ cmUNKNOWN
uninitialized item
@ cmSUB
Operator item: subtract.
@ cmGT
Operator item: greater than.
@ cmSTRING
Code for a string token.
@ cmFUNC
Code for a generic function item.
@ cmFUNC_STR
Code for a function with a string parameter.
@ cmLT
Operator item: less than.
@ cmMUL
Operator item: multiply.
@ cmGE
Operator item: greater or equal.
@ cmADD
Operator item: add.
@ cmASSIGN
Operator item: Assignment operator.
@ cmENDIF
For use in the ternary if-then-else operator.
@ cmELSE
For use in the ternary if-then-else operator.
@ cmEQ
Operator item: equals.
@ cmFUNC_BULK
Special callbacks for Bulk mode with an additional parameter for the bulk index.
@ cmARG_SEP
function argument separator
@ cmPOW
Operator item: y to the power of ...
@ cmNEQ
Operator item: not equal.
@ cmOPRT_BIN
user defined binary operator
@ cmIF
For use in the ternary if-then-else operator.
@ cmOPRT_POSTFIX
code for postfix operators
@ cmDIV
Operator item: division.
@ cmBO
Operator item: opening bracket.
std::map< QString, qreal > valmap_type
Type used for storing constants.
qreal(* fun_type6)(qreal, qreal, qreal, qreal, qreal, qreal)
Callback type used for functions with five arguments.
qreal(* fun_type4)(qreal, qreal, qreal, qreal)
Callback type used for functions with four arguments.
qreal(* fun_type9)(qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal)
Callback type used for functions with five arguments.
qreal(* bulkfun_type1)(int, int, qreal)
Callback type used for functions with a single arguments.
qreal(* fun_type2)(qreal, qreal)
Callback type used for functions with two arguments.
qreal(* bulkfun_type2)(int, int, qreal, qreal)
Callback type used for functions with two arguments.
qreal(* generic_fun_type)()
Callback type used for functions without arguments.
qreal(* bulkfun_type0)(int, int)
Callback type used for functions without arguments.
qreal(* strfun_type3)(const QString &, qreal, qreal)
Callback type used for functions taking a string and two values as arguments.
EOprtAssociativity
Parser operator precedence values.
qreal(* fun_type1)(qreal)
Callback type used for functions with a single arguments.
qreal(* bulkfun_type7)(int, int, qreal, qreal, qreal, qreal, qreal, qreal, qreal)
Callback type used for functions with five arguments.
qreal(* multfun_type)(const qreal *, int)
Callback type used for functions with a variable argument list.
std::basic_stringstream< char_type, std::char_traits< char_type >, std::allocator< char_type > > stringstream_type
Typedef for easily using stringstream that respect the parser stringtype.
qreal(* strfun_type2)(const QString &, qreal)
Callback type used for functions taking a string and a value as arguments.
qreal(* fun_type0)()
Callback type used for functions without arguments.
EOprtPrecedence
Parser operator precedence values.
@ prPOW
power operator priority (highest)
@ prPOSTFIX
Postfix operator priority (currently unused)
@ prCMP
comparsion operators
@ prINFIX
Signs have a higher priority than ADD_SUB, but lower than power operator.
@ prMUL_DIV
multiplication/division
qreal(* bulkfun_type6)(int, int, qreal, qreal, qreal, qreal, qreal, qreal)
Callback type used for functions with five arguments.
qreal(* bulkfun_type8)(int, int, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal)
Callback type used for functions with five arguments.
qreal(* bulkfun_type3)(int, int, qreal, qreal, qreal)
Callback type used for functions with three arguments.
std::wstring string_type
The stringtype used by the parser.
qreal(* bulkfun_type9)(int, int, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal)
Callback type used for functions with five arguments.
ETypeCode
Types internally used by the parser.
@ tpDBL
Floating point variables.
@ tpSTR
String type (Function arguments and constants only, no string variables)
std::map< QString, qreal * > varmap_type
Type used for storing variables.
qreal(* fun_type5)(qreal, qreal, qreal, qreal, qreal)
Callback type used for functions with five arguments.
qreal(* strfun_type1)(const QString &)
Callback type used for functions taking a string as an argument.
#define QMUP_STRING_TYPE
If this macro is defined mathematical exceptions (div by zero) will be thrown as exceptions.
This file contains compatibility fixes for some platforms.