Skip to content
Snippets Groups Projects
Commit 2d317638 authored by Soeren Peters's avatar Soeren Peters
Browse files

Merge pull request 'Update MuParser to version 2.3.2 from 17.06.2020.' (#21)...

Merge pull request 'Update MuParser to version 2.3.2 from 17.06.2020.' (#21) from peters/VirtualFluids_dev:feature/update_muparser into develop
parents ac294696 3243b26b
No related branches found
No related tags found
No related merge requests found
Showing
with 3338 additions and 3297 deletions
# By default, build in Release mode. Must appear before project() command
#if (NOT DEFINED CMAKE_BUILD_TYPE)
# set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
#endif ()
vf_add_library(BUILDTYPE static) project(muParserProject)
vf_get_library_name(library_name) # Bump versions on release
target_include_directories(${library_name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include) set(MUPARSER_VERSION_MAJOR 2)
set(MUPARSER_VERSION_MINOR 3)
set(MUPARSER_VERSION_PATCH 2)
set(MUPARSER_VERSION ${MUPARSER_VERSION_MAJOR}.${MUPARSER_VERSION_MINOR}.${MUPARSER_VERSION_PATCH})
groupTarget(${library_name} ${thirdFolder}) # Build options
option(ENABLE_SAMPLES "Build the samples" OFF)
option(ENABLE_OPENMP "Enable OpenMP for multithreading" ON)
#option(BUILD_SHARED_LIBS "Build shared/static libs" ON)
if(ENABLE_OPENMP)
find_package(OpenMP REQUIRED)
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")
endif()
# Credit: https://stackoverflow.com/questions/2368811/how-to-set-warning-level-in-cmake/3818084
if(MSVC)
# Force to always compile with W4
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
# Update if necessary
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic")
endif()
add_library(muparser
src/muParserBase.cpp
src/muParserBytecode.cpp
src/muParserCallback.cpp
src/muParser.cpp
src/muParserDLL.cpp
src/muParserError.cpp
src/muParserInt.cpp
src/muParserTest.cpp
src/muParserTokenReader.cpp
)
target_link_libraries(muparser PUBLIC OpenMP::OpenMP_CXX)
target_include_directories(muparser PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
# this compiles the "DLL" interface (C API)
target_compile_definitions(muparser PRIVATE MUPARSER_DLL)
if (BUILD_SHARED_LIBS)
target_compile_definitions(muparser PRIVATE MUPARSERLIB_EXPORTS)
else ()
target_compile_definitions(muparser PUBLIC MUPARSER_STATIC)
endif()
if (CMAKE_BUILD_TYPE STREQUAL Debug)
target_compile_definitions(muparser PRIVATE _DEBUG)
endif ()
if(ENABLE_OPENMP)
target_compile_definitions(muparser PRIVATE MUP_USE_OPENMP)
endif()
set_target_properties(muparser PROPERTIES
VERSION ${MUPARSER_VERSION}
SOVERSION ${MUPARSER_VERSION_MAJOR}
)
if(ENABLE_SAMPLES)
add_executable(example1 samples/example1/example1.cpp)
target_link_libraries(example1 muparser)
add_executable(example2 samples/example2/example2.c)
target_link_libraries(example2 muparser)
endif()
#include(CTest)
#enable_testing()
#add_executable (t_ParserTest test/t_ParserTest.cpp)
#target_link_libraries(t_ParserTest muparser)
#add_test (NAME ParserTest COMMAND t_ParserTest)
groupTarget(muparser ${thirdFolder})
\ No newline at end of file
GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES outOption outSourceGroupName)
IF( ${outOption} )
#verzeichnis als std-include adden
INCLUDE_DIRECTORIES( ${CURRENT_DIR}/include )
OPTION(USE_MUPARSER_AS_LIB "MuParser will be compiled as lib" ON)
IF(USE_MUPARSER_AS_LIB)
FILE( GLOB muparser_HEADER_FILES ${CURRENT_DIR}/include/*.h )
FILE( GLOB muparser_CXX_FILES ${CURRENT_DIR}/src/*.cpp )
SET(MUPARSER_SRC_FILES ${muparser_HEADER_FILES} ${muparser_CXX_FILES})
ADD_LIBRARY(muParserLib ${MUPARSER_SRC_FILES})
#lib projekt hinzufuegen
LIST(APPEND CAB_ADDITIONAL_LINK_LIBRARIES muParserLib)
ADD_TARGET_PROPERTIES(muParserLib COMPILE_FLAGS "-I${CURRENT_DIR}/include")
#compilerflags aktuellem projekt hinzufuegen
ADD_COMPILER_FLAGS_TO_PROJECT(${CAB_COMPILER} "muParserLib" "CXX" "STATIC")
ELSE() #not as lib
SET( CURRENT_DIR_TMP ${CURRENT_DIR} ) #wird im nchsten befehl geaendert
INCLUDE( ${CURRENT_DIR_TMP}/include/CMakePackage.txt)
INCLUDE( ${CURRENT_DIR_TMP}/src/CMakePackage.txt)
ENDIF()
ENDIF( ${outOption} )
This diff is collapsed.
#######################################################################
# # _____ __ _____________ _______ ______ ___________
# # / \| | \____ \__ \\_ __ \/ ___// __ \_ __ \
# __________ # | Y Y \ | / |_> > __ \| | \/\___ \\ ___/| | \/
# _____ __ __\______ \_____ _______ ______ ____ _______ # |__|_| /____/| __(____ /__| /____ >\___ >__|
# / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ # \/ |__| \/ \/ \/
# | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ # Copyright (C) 2004 - 2020 Ingo Berg
# |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| #
# \/ \/ \/ \/ # =======================================================================
# Fast math parser Library # https://muparser.beltoforion.de
# # =======================================================================
# Copyright (C) 2012 Ingo Berg #
# # Installation
# Web: muparser.beltoforion.de # ============
# e-mail: muparser@beltoforion.de #
# # muParser can be installed just extracting the sources somewhere
# # and then, from a terminal, typing:
#######################################################################
cd [path to muParser]
cmake . [-DENABLE_SAMPLES=ON/OFF] [-DENABLE_OPENMP=OFF/ON]
[-DBUILD_SHARED_LIBS=ON/OFF]
Contents make
======== [sudo*] make install
[sudo*] ldconfig
1. Installation on win32 cd samples/example1
2. Installation on unix ./example1
2.1 Other miscellaneous info Unix-specific
3. Where to ask for help * = this command must be executed with root permissions and thus
you have to use 'sudo' or just 'su' to gain root access.
Note that installation and ldconfig are not strictly required unless
you built in shared mode.
1. Installation on win32
======================== The "make" step will create the muParser library in 'lib' and the
sample binary in samples/example1.
muParser supports various win32 command-line compilers: The samples/example2 is win32-specific and thus won't be built.
-> mingw
-> watcom
-> microsoft CL
and provides also the project files for MSVC6 IDE. Other miscellaneous info Unix-specific
======================================
In order to compile muParser from makefiles, open an MSDOS
prompt and then move to the muParser/build directory and If you don't like to have your muParser folder filled by temporary
type: files created by GCC, then you can do the following:
mingw32-make -fmakefile.mingw for mingw mkdir mybuild && cd mybuild && cmake .. && make
nmake -fmakefile.vc for msvc
make -fmakefile.bcc for borland to put all object files in the "mybuild" directory.
wmake -fmakefile.wat for watcom
If you want to use muParser library in your programs, you can use
All makefiles supports the following options: the pkg-config program (this works only if muParser was installed
with 'make install' !). The commands:
# Set to 1 to build debug version [0,1]
# 0 - Release pkg-config muparser --cflags
# 1 - Debug pkg-config muparser --libs
DEBUG = 0
will return all useful info you need to build your programs against
# Set to 1 to build shared (DLL) version [0,1] muParser !
# 0 - Static
# 1 - DLL
SHARED = 0
3. Where to ask for help
# Set to 1 to compile samples [0,1] ========================
SAMPLES = 1
Please report any bugs or issues at the muparser project page at GitHub:
The muParser library is created in the 'lib' folder and the sample
binaries are created in samples\example1 or samples\example2. https://github.com/beltoforion/muparser/issues
NOTE: samples\example1 can be compiled *only* when building
muParser as a STATIC library (SHARED=0). \ No newline at end of file
samples\example2 can be compiled *only* when building
muParser as a SHARED library (SHARED=1).
2. Installation on Unix/Linux
=============================
muParser can be installed just extracting the sources somewhere
and then, from a terminal, typing:
cd [path to muParser]
./configure [--enable-shared=yes/no] [--enable-samples=yes/no]
[--enable-debug=yes/no]
make
[sudo*] make install
[sudo*] ldconfig
cd samples/example1
./example1
* = this command must be executed with root permissions and thus
you have to use 'sudo' or just 'su' to gain root access.
Note that installation and ldconfig are not strictly required unless
you built in shared mode.
The "make" step will create the muParser library in 'lib' and the
sample binary in samples/example1.
The samples/example2 is win32-specific and thus won't be built.
2.1 Other miscellaneous info Unix-specific
==========================================
If you don't like to have your muParser folder filled by temporary
files created by GCC, then you can do the following:
mkdir mybuild && cd mybuild && ../configure && make
to put all object files in the "mybuild" directory.
If you want to use muParser library in your programs, you can use
the pkg-config program (this works only if muParser was installed
with 'make install' !). The commands:
pkg-config muparser --cflags
pkg-config muparser --libs
will return all useful info you need to build your programs against
muParser !
3. Where to ask for help
========================
If you find problems with either compilation, installation or usage
of muParser, then you can ask in the muParser forum at:
https://sourceforge.net/forum/forum.php?forum_id=462843
For more info about muParser, visit:
http://sourceforge.net/projects/muparser/
http://muparser.sourceforge.net
#######################################################################
# # _____ __ _____________ _______ ______ ___________
# # / \| | \____ \__ \\_ __ \/ ___// __ \_ __ \
# __________ # | Y Y \ | / |_> > __ \| | \/\___ \\ ___/| | \/
# _____ __ __\______ \_____ _______ ______ ____ _______ # |__|_| /____/| __(____ /__| /____ >\___ >__|
# / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ # \/ |__| \/ \/ \/
# | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ # Fast math parser Library
# |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| #
# \/ \/ \/ \/ # Copyright (C) 2004 - 2020 Ingo Berg
# Fast math parser Library #
# # Web: https://muparser.beltoforion.de
# Copyright (C) 2011 Ingo Berg # Git: https://github.com/beltoforion/muparser
# #
# Web: muparser.beltoforion.de # This software is distributed under the terms of the
# e-mail: muparser@beltoforion.de # BSD - Clause 2 "Simplified" or "FreeBSD" Licence (BSD-2-Clause)
# #
# # ###############################################################################################
#######################################################################
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software * Redistributions of source code must retain the above copyright notice, this list of
without restriction, including without limitation the rights to use, copy, modify, conditions and the following disclaimer.
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * Redistributions in binary form must reproduce the above copyright notice, this list of
permit persons to whom the Software is furnished to do so, subject to the following conditions: conditions and the following disclaimer in the documentation and/or other materials provided
with the distribution.
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OR OTHER DEALINGS IN THE SOFTWARE. OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.. image:: https://travis-ci.org/beltoforion/muparser.svg?branch=master
:target: https://travis-ci.org/beltoforion/muparser
.. image:: https://ci.appveyor.com/api/projects/status/u4882uj8btuspj9x?svg=true
:target: https://ci.appveyor.com/project/jschueller/muparser-9ib44
muparser - Fast Math Parser 2.3.2
===========================
For a detailed description of the parser go to http://beltoforion.de/article.php?a=muparser.
See Install.txt for installation
Change Notes for Revision 2.3.2
------------
Changes:
------------
* removed "final" keyword from Parser class since this API change broke multiple client applications
Security Fixes:
------------
The following issue was present in all older releases.
* https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23410 (Heap-buffer-overflow)
API and ABI compliance check with version 2.2.6
------------
Version 2.3 will extend existing enumerators. New Error codes have been added. In the muparser base class protected functions for implementing basic mathematical operations such as sin,cos, sqrt,tan,... have been removed.
The binary interface should be compatible with versions 2.2.6 unless the parser is used in ways that i did not forsee. I checked the compliance against the sample application compiled for 2.2.6 by exchanging the library with the new version 2.3. I did not see any problems. You can find a complete ABI compliance report here:
https://www.beltoforion.de/en/muparser/compat_reports/2.2.6_to_2.3.2/compat_report.html
I recommend replacing existing versions of 2.2.6 with version 2.3.2. Please report all incompatibilities that you find (API and ABI). I will try to fix them before the final release (if reasonable)
Change Notes for Revision 2.3.1
------------
No changes, only prereleases exist. Version 2.3.2 replaced them.
Change Notes for Revision 2.3.0
------------
Version 2.3.0 will bring fixes for parsing in bulk mode. It will enable OpenMP by default thus allowing the parallelization of expression evaluation. It will also fix a range of issues reported by oss-fuz (https://github.com/google/oss-fuzz).
Changes:
------------
* using OpenMP is now the default settings for cmake based builds
* added optimization for trivial expressions. (Expressions with an RPN length of 1)
* introduced a maximum length for expressions (5000 Character)
* introduced a maximum length for identifiers (100 Characters)
* removed the MUP_MATH_EXCEPTION macro and related functionality. (C++ exceptions for divide by zero or sqrt of a negative number are no longer supported)
* removed ParserStack.h (replaced with std::stack)
* removed macros for defining E and PI
* the MUP_ASSERT macro is no longer removed in release builds for better protection against segmentation faults
Security Fixes:
------------
Fixed several issues reported by oss-fuzz. The issues were present in older releases. Most of them resulted in segmentation faults.
* https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23330
* https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22922
* https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22938
* https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23330
* Added additional runtime checks for release builds to prevent segmentation faults for invalid expressions
Bugfixes:
------------
* Fixed an issue where the bulk mode could hang on GCC/CLANG builds due to OpenMP chunksize dropping below 1.
...@@ -282,7 +282,7 @@ TYPEDEF_HIDES_STRUCT = NO ...@@ -282,7 +282,7 @@ TYPEDEF_HIDES_STRUCT = NO
# causing a significant performance penality. # causing a significant performance penality.
# If the system has enough physical memory increasing the cache will improve the # If the system has enough physical memory increasing the cache will improve the
# performance by keeping more symbols in memory. Note that the value works on # performance by keeping more symbols in memory. Note that the value works on
# a logarithmic scale so increasing the size by one will rougly double the # a logarithmic scale so increasing the size by one will roughly double the
# memory usage. The cache size is given by this formula: # memory usage. The cache size is given by this formula:
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
# corresponding to a cache size of 2^16 = 65536 symbols # corresponding to a cache size of 2^16 = 65536 symbols
......
/* /*
__________
_____ __ __\______ \_____ _______ ______ ____ _______ _____ __ _____________ _______ ______ ___________
/ \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ / \| | \____ \__ \\_ __ \/ ___// __ \_ __ \
| Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ | Y Y \ | / |_> > __ \| | \/\___ \\ ___/| | \/
|__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| |__|_| /____/| __(____ /__| /____ >\___ >__|
\/ \/ \/ \/ \/ |__| \/ \/ \/
Copyright (C) 2013 Ingo Berg Copyright (C) 2004 - 2020 Ingo Berg
Permission is hereby granted, free of charge, to any person obtaining a copy of this Redistribution and use in source and binary forms, with or without modification, are permitted
software and associated documentation files (the "Software"), to deal in the Software provided that the following conditions are met:
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * Redistributions of source code must retain the above copyright notice, this list of
permit persons to whom the Software is furnished to do so, subject to the following conditions: conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of
The above copyright notice and this permission notice shall be included in all copies or conditions and the following disclaimer in the documentation and/or other materials provided
substantial portions of the Software. with the distribution.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
*/ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
#ifndef MU_PARSER_H IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
#define MU_PARSER_H OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//--- Standard includes ------------------------------------------------------------------------
#include <vector> #ifndef MU_PARSER_H
#define MU_PARSER_H
//--- Parser includes --------------------------------------------------------------------------
#include "muParserBase.h" //--- Standard includes ------------------------------------------------------------------------
#include "muParserTemplateMagic.h" #include <vector>
/** \file //--- Parser includes --------------------------------------------------------------------------
\brief Definition of the standard floating point parser. #include "muParserBase.h"
*/ #include "muParserTemplateMagic.h"
namespace mu /** \file
{ \brief Definition of the standard floating point parser.
/** \brief Mathematical expressions parser. */
Standard implementation of the mathematical expressions parser. namespace mu
Can be used as a reference implementation for subclassing the parser. {
/** \brief Mathematical expressions parser.
<small>
(C) 2011 Ingo Berg<br> Standard implementation of the mathematical expressions parser.
muparser(at)beltoforion.de Can be used as a reference implementation for subclassing the parser.
</small> */
*/ class API_EXPORT_CXX Parser : public ParserBase
/* final */ class Parser : public ParserBase {
{ public:
public:
Parser();
Parser();
virtual void InitCharSets();
virtual void InitCharSets(); virtual void InitFun();
virtual void InitFun(); virtual void InitConst();
virtual void InitConst(); virtual void InitOprt();
virtual void InitOprt(); virtual void OnDetectVar(string_type* pExpr, int& nStart, int& nEnd);
virtual void OnDetectVar(string_type *pExpr, int &nStart, int &nEnd);
value_type Diff(value_type* a_Var, value_type a_fPos, value_type a_fEpsilon = 0) const;
value_type Diff(value_type *a_Var,
value_type a_fPos, protected:
value_type a_fEpsilon = 0) const;
static int IsVal(const char_type* a_szExpr, int* a_iPos, value_type* a_fVal);
protected: };
} // namespace mu
// Trigonometric functions
static value_type Sin(value_type); #endif
static value_type Cos(value_type);
static value_type Tan(value_type);
static value_type Tan2(value_type, value_type);
// arcus functions
static value_type ASin(value_type);
static value_type ACos(value_type);
static value_type ATan(value_type);
static value_type ATan2(value_type, value_type);
// hyperbolic functions
static value_type Sinh(value_type);
static value_type Cosh(value_type);
static value_type Tanh(value_type);
// arcus hyperbolic functions
static value_type ASinh(value_type);
static value_type ACosh(value_type);
static value_type ATanh(value_type);
// Logarithm functions
static value_type Log2(value_type); // Logarithm Base 2
static value_type Log10(value_type); // Logarithm Base 10
static value_type Ln(value_type); // Logarithm Base e (natural logarithm)
// misc
static value_type Exp(value_type);
static value_type Abs(value_type);
static value_type Sqrt(value_type);
static value_type Rint(value_type);
static value_type Sign(value_type);
// Prefix operators
// !!! Unary Minus is a MUST if you want to use negative signs !!!
static value_type UnaryMinus(value_type);
static value_type UnaryPlus(value_type);
// Functions with variable number of arguments
static value_type Sum(const value_type*, int); // sum
static value_type Avg(const value_type*, int); // mean value
static value_type Min(const value_type*, int); // minimum
static value_type Max(const value_type*, int); // maximum
static int IsVal(const char_type* a_szExpr, int *a_iPos, value_type *a_fVal);
};
} // namespace mu
#endif
This diff is collapsed.
/* /*
__________
_____ __ __\______ \_____ _______ ______ ____ _______ _____ __ _____________ _______ ______ ___________
/ \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ / \| | \____ \__ \\_ __ \/ ___// __ \_ __ \
| Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ | Y Y \ | / |_> > __ \| | \/\___ \\ ___/| | \/
|__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| |__|_| /____/| __(____ /__| /____ >\___ >__|
\/ \/ \/ \/ \/ |__| \/ \/ \/
Copyright (C) 2004-2013 Ingo Berg Copyright (C) 2004 - 2020 Ingo Berg
Permission is hereby granted, free of charge, to any person obtaining a copy of this Redistribution and use in source and binary forms, with or without modification, are permitted
software and associated documentation files (the "Software"), to deal in the Software provided that the following conditions are met:
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * Redistributions of source code must retain the above copyright notice, this list of
permit persons to whom the Software is furnished to do so, subject to the following conditions: conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of
The above copyright notice and this permission notice shall be included in all copies or conditions and the following disclaimer in the documentation and/or other materials provided
substantial portions of the Software. with the distribution.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
*/ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
#ifndef MU_PARSER_BYTECODE_H IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
#define MU_PARSER_BYTECODE_H OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cassert>
#include <string> #ifndef MU_PARSER_BYTECODE_H
#include <stack> #define MU_PARSER_BYTECODE_H
#include <vector>
#include <string>
#include "muParserDef.h" #include <stack>
#include "muParserError.h" #include <vector>
#include "muParserToken.h"
#include "muParserDef.h"
/** \file #include "muParserError.h"
\brief Definition of the parser bytecode class. #include "muParserToken.h"
*/
/** \file
\brief Definition of the parser bytecode class.
namespace mu */
{
struct SToken
{ namespace mu
ECmdCode Cmd; {
int StackPos; struct SToken
{
union ECmdCode Cmd;
{
struct //SValData union
{ {
value_type *ptr; struct //SValData
value_type data; {
value_type data2; value_type* ptr;
} Val; value_type data;
value_type data2;
struct //SFunData } Val;
{
// Note: generic_fun_type is merely a placeholder. The real type could be struct //SFunData
// anything between gun_type1 and fun_type9. I can't use a void {
// pointer due to constraints in the ANSI standard which allows // Note: generic_fun_type is merely a placeholder. The real type could be
// data pointers and function pointers to differ in size. // anything between gun_type1 and fun_type9. I can't use a void
generic_fun_type ptr; // pointer due to constraints in the ANSI standard which allows
int argc; // data pointers and function pointers to differ in size.
int idx; generic_fun_type ptr;
} Fun; int argc;
int idx;
struct //SOprtData } Fun;
{
value_type *ptr; struct //SOprtData
int offset; {
} Oprt; value_type* ptr;
}; int offset;
}; } Oprt;
};
};
/** \brief Bytecode implementation of the Math Parser.
The bytecode contains the formula converted to revers polish notation stored in a continious /** \brief Bytecode implementation of the Math Parser.
memory area. Associated with this data are operator codes, variable pointers, constant
values and function pointers. Those are necessary in order to calculate the result. The bytecode contains the formula converted to revers polish notation stored in a continious
All those data items will be casted to the underlying datatype of the bytecode. memory area. Associated with this data are operator codes, variable pointers, constant
values and function pointers. Those are necessary in order to calculate the result.
\author (C) 2004-2013 Ingo Berg All those data items will be casted to the underlying datatype of the bytecode.
*/ */
class ParserByteCode class ParserByteCode final
{ {
private: private:
/** \brief Token type for internal use only. */ /** \brief Token type for internal use only. */
typedef ParserToken<value_type, string_type> token_type; typedef ParserToken<value_type, string_type> token_type;
/** \brief Token vector for storing the RPN. */ /** \brief Token vector for storing the RPN. */
typedef std::vector<SToken> rpn_type; typedef std::vector<SToken> rpn_type;
/** \brief Position in the Calculation array. */ /** \brief Position in the Calculation array. */
unsigned m_iStackPos; unsigned m_iStackPos;
/** \brief Maximum size needed for the stack. */ /** \brief Maximum size needed for the stack. */
std::size_t m_iMaxStackSize; std::size_t m_iMaxStackSize;
/** \brief The actual rpn storage. */ /** \brief The actual rpn storage. */
rpn_type m_vRPN; rpn_type m_vRPN;
bool m_bEnableOptimizer; bool m_bEnableOptimizer;
void ConstantFolding(ECmdCode a_Oprt); void ConstantFolding(ECmdCode a_Oprt);
public: public:
ParserByteCode(); ParserByteCode();
ParserByteCode(const ParserByteCode &a_ByteCode); ParserByteCode(const ParserByteCode& a_ByteCode);
ParserByteCode& operator=(const ParserByteCode &a_ByteCode); ParserByteCode& operator=(const ParserByteCode& a_ByteCode);
void Assign(const ParserByteCode &a_ByteCode); void Assign(const ParserByteCode& a_ByteCode);
void AddVar(value_type *a_pVar); void AddVar(value_type* a_pVar);
void AddVal(value_type a_fVal); void AddVal(value_type a_fVal);
void AddOp(ECmdCode a_Oprt); void AddOp(ECmdCode a_Oprt);
void AddIfElse(ECmdCode a_Oprt); void AddIfElse(ECmdCode a_Oprt);
void AddAssignOp(value_type *a_pVar); void AddAssignOp(value_type* a_pVar);
void AddFun(generic_fun_type a_pFun, int a_iArgc); void AddFun(generic_fun_type a_pFun, int a_iArgc);
void AddBulkFun(generic_fun_type a_pFun, int a_iArgc); void AddBulkFun(generic_fun_type a_pFun, int a_iArgc);
void AddStrFun(generic_fun_type a_pFun, int a_iArgc, int a_iIdx); void AddStrFun(generic_fun_type a_pFun, int a_iArgc, int a_iIdx);
void EnableOptimizer(bool bStat); void EnableOptimizer(bool bStat);
void Finalize(); void Finalize();
void clear(); void clear();
std::size_t GetMaxStackSize() const; std::size_t GetMaxStackSize() const;
std::size_t GetSize() const;
std::size_t GetSize() const
const SToken* GetBase() const; {
void AsciiDump(); return m_vRPN.size();
}; }
} // namespace mu inline const SToken* GetBase() const
{
#endif if (m_vRPN.size() == 0)
throw ParserError(ecINTERNAL_ERROR);
else
return &m_vRPN[0];
}
void AsciiDump();
};
} // namespace mu
#endif
/* /*
__________
_____ __ __\______ \_____ _______ ______ ____ _______ _____ __ _____________ _______ ______ ___________
/ \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ / \| | \____ \__ \\_ __ \/ ___// __ \_ __ \
| Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ | Y Y \ | / |_> > __ \| | \/\___ \\ ___/| | \/
|__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| |__|_| /____/| __(____ /__| /____ >\___ >__|
\/ \/ \/ \/ \/ |__| \/ \/ \/
Copyright (C) 2004-2011 Ingo Berg Copyright (C) 2004 - 2020 Ingo Berg
Permission is hereby granted, free of charge, to any person obtaining a copy of this Redistribution and use in source and binary forms, with or without modification, are permitted
software and associated documentation files (the "Software"), to deal in the Software provided that the following conditions are met:
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * Redistributions of source code must retain the above copyright notice, this list of
permit persons to whom the Software is furnished to do so, subject to the following conditions: conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of
The above copyright notice and this permission notice shall be included in all copies or conditions and the following disclaimer in the documentation and/or other materials provided
substantial portions of the Software. with the distribution.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
*/ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
#ifndef MU_PARSER_CALLBACK_H OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define MU_PARSER_CALLBACK_H */
#include "muParserDef.h"
#ifndef MU_PARSER_CALLBACK_H
/** \file #define MU_PARSER_CALLBACK_H
\brief Definition of the parser callback class.
*/ #include "muParserDef.h"
namespace mu /** \file
{ \brief Definition of the parser callback class.
*/
/** \brief Encapsulation of prototypes for a numerical parser function.
namespace mu
Encapsulates the prototyp for numerical parser functions. The class {
stores the number of arguments for parser functions as well
as additional flags indication the function is non optimizeable. /** \brief Encapsulation of prototypes for a numerical parser function.
The pointer to the callback function pointer is stored as void*
and needs to be casted according to the argument count. Encapsulates the prototyp for numerical parser functions. The class
Negative argument counts indicate a parser function with a variable number stores the number of arguments for parser functions as well
of arguments. as additional flags indication the function is non optimizeable.
The pointer to the callback function pointer is stored as void*
\author (C) 2004-2011 Ingo Berg and needs to be casted according to the argument count.
*/ Negative argument counts indicate a parser function with a variable number
class ParserCallback of arguments.
{ */
public: class API_EXPORT_CXX ParserCallback final
ParserCallback(fun_type0 a_pFun, bool a_bAllowOpti); {
ParserCallback(fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec = -1, ECmdCode a_iCode=cmFUNC); public:
ParserCallback(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eAssociativity); ParserCallback(fun_type0 a_pFun, bool a_bAllowOpti);
ParserCallback(fun_type2 a_pFun, bool a_bAllowOpti); ParserCallback(fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec = -1, ECmdCode a_iCode = cmFUNC);
ParserCallback(fun_type3 a_pFun, bool a_bAllowOpti); ParserCallback(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eAssociativity);
ParserCallback(fun_type4 a_pFun, bool a_bAllowOpti); ParserCallback(fun_type2 a_pFun, bool a_bAllowOpti);
ParserCallback(fun_type5 a_pFun, bool a_bAllowOpti); ParserCallback(fun_type3 a_pFun, bool a_bAllowOpti);
ParserCallback(fun_type6 a_pFun, bool a_bAllowOpti); ParserCallback(fun_type4 a_pFun, bool a_bAllowOpti);
ParserCallback(fun_type7 a_pFun, bool a_bAllowOpti); ParserCallback(fun_type5 a_pFun, bool a_bAllowOpti);
ParserCallback(fun_type8 a_pFun, bool a_bAllowOpti); ParserCallback(fun_type6 a_pFun, bool a_bAllowOpti);
ParserCallback(fun_type9 a_pFun, bool a_bAllowOpti); ParserCallback(fun_type7 a_pFun, bool a_bAllowOpti);
ParserCallback(fun_type10 a_pFun, bool a_bAllowOpti); ParserCallback(fun_type8 a_pFun, bool a_bAllowOpti);
ParserCallback(fun_type9 a_pFun, bool a_bAllowOpti);
ParserCallback(bulkfun_type0 a_pFun, bool a_bAllowOpti); ParserCallback(fun_type10 a_pFun, bool a_bAllowOpti);
ParserCallback(bulkfun_type1 a_pFun, bool a_bAllowOpti);
ParserCallback(bulkfun_type2 a_pFun, bool a_bAllowOpti); ParserCallback(bulkfun_type0 a_pFun, bool a_bAllowOpti);
ParserCallback(bulkfun_type3 a_pFun, bool a_bAllowOpti); ParserCallback(bulkfun_type1 a_pFun, bool a_bAllowOpti);
ParserCallback(bulkfun_type4 a_pFun, bool a_bAllowOpti); ParserCallback(bulkfun_type2 a_pFun, bool a_bAllowOpti);
ParserCallback(bulkfun_type5 a_pFun, bool a_bAllowOpti); ParserCallback(bulkfun_type3 a_pFun, bool a_bAllowOpti);
ParserCallback(bulkfun_type6 a_pFun, bool a_bAllowOpti); ParserCallback(bulkfun_type4 a_pFun, bool a_bAllowOpti);
ParserCallback(bulkfun_type7 a_pFun, bool a_bAllowOpti); ParserCallback(bulkfun_type5 a_pFun, bool a_bAllowOpti);
ParserCallback(bulkfun_type8 a_pFun, bool a_bAllowOpti); ParserCallback(bulkfun_type6 a_pFun, bool a_bAllowOpti);
ParserCallback(bulkfun_type9 a_pFun, bool a_bAllowOpti); ParserCallback(bulkfun_type7 a_pFun, bool a_bAllowOpti);
ParserCallback(bulkfun_type10 a_pFun, bool a_bAllowOpti); ParserCallback(bulkfun_type8 a_pFun, bool a_bAllowOpti);
ParserCallback(bulkfun_type9 a_pFun, bool a_bAllowOpti);
ParserCallback(multfun_type a_pFun, bool a_bAllowOpti); ParserCallback(bulkfun_type10 a_pFun, bool a_bAllowOpti);
ParserCallback(strfun_type1 a_pFun, bool a_bAllowOpti);
ParserCallback(strfun_type2 a_pFun, bool a_bAllowOpti); ParserCallback(multfun_type a_pFun, bool a_bAllowOpti);
ParserCallback(strfun_type3 a_pFun, bool a_bAllowOpti); ParserCallback(strfun_type1 a_pFun, bool a_bAllowOpti);
ParserCallback(); ParserCallback(strfun_type2 a_pFun, bool a_bAllowOpti);
ParserCallback(const ParserCallback &a_Fun); ParserCallback(strfun_type3 a_pFun, bool a_bAllowOpti);
ParserCallback(strfun_type4 a_pFun, bool a_bAllowOpti);
ParserCallback* Clone() const; ParserCallback(strfun_type5 a_pFun, bool a_bAllowOpti);
ParserCallback();
bool IsOptimizable() const; ParserCallback(const ParserCallback& a_Fun);
void* GetAddr() const; ParserCallback & operator=(const ParserCallback& a_Fun);
ECmdCode GetCode() const;
ETypeCode GetType() const; ParserCallback* Clone() const;
int GetPri() const;
EOprtAssociativity GetAssociativity() const; bool IsOptimizable() const;
int GetArgc() const; void* GetAddr() const;
ECmdCode GetCode() const;
private: ETypeCode GetType() const;
void *m_pFun; ///< Pointer to the callback function, casted to void int GetPri() const;
EOprtAssociativity GetAssociativity() const;
/** \brief Number of numeric function arguments int GetArgc() const;
This number is negative for functions with variable number of arguments. in this cases private:
they represent the actual number of arguments found. void* m_pFun; ///< Pointer to the callback function, casted to void
*/
int m_iArgc; /** \brief Number of numeric function arguments
int m_iPri; ///< Valid only for binary and infix operators; Operator precedence.
EOprtAssociativity m_eOprtAsct; ///< Operator associativity; Valid only for binary operators This number is negative for functions with variable number of arguments. in this cases
ECmdCode m_iCode; they represent the actual number of arguments found.
ETypeCode m_iType; */
bool m_bAllowOpti; ///< Flag indication optimizeability int m_iArgc;
}; int m_iPri; ///< Valid only for binary and infix operators; Operator precedence.
EOprtAssociativity m_eOprtAsct; ///< Operator associativity; Valid only for binary operators
//------------------------------------------------------------------------------ ECmdCode m_iCode;
/** \brief Container for Callback objects. */ ETypeCode m_iType;
typedef std::map<string_type, ParserCallback> funmap_type; bool m_bAllowOpti; ///< Flag indication optimizeability
};
} // namespace mu
#endif /** \brief Container for Callback objects. */
typedef std::map<string_type, ParserCallback> funmap_type;
} // namespace mu
#endif
This diff is collapsed.
This diff is collapsed.
/* /*
__________
_____ __ __\______ \_____ _______ ______ ____ _______ _____ __ _____________ _______ ______ ___________
/ \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ / \| | \____ \__ \\_ __ \/ ___// __ \_ __ \
| Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ | Y Y \ | / |_> > __ \| | \/\___ \\ ___/| | \/
|__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| |__|_| /____/| __(____ /__| /____ >\___ >__|
\/ \/ \/ \/ \/ |__| \/ \/ \/
Copyright (C) 2004-2011 Ingo Berg Copyright (C) 2004 - 2020 Ingo Berg
Permission is hereby granted, free of charge, to any person obtaining a copy of this Redistribution and use in source and binary forms, with or without modification, are permitted
software and associated documentation files (the "Software"), to deal in the Software provided that the following conditions are met:
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * Redistributions of source code must retain the above copyright notice, this list of
permit persons to whom the Software is furnished to do so, subject to the following conditions: conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of
The above copyright notice and this permission notice shall be included in all copies or conditions and the following disclaimer in the documentation and/or other materials provided
substantial portions of the Software. with the distribution.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
*/ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
#ifndef MU_PARSER_ERROR_H OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define MU_PARSER_ERROR_H */
#include <cassert> #ifndef MU_PARSER_ERROR_H
#include <stdexcept> #define MU_PARSER_ERROR_H
#include <string>
#include <sstream> #include <stdexcept>
#include <vector> #include <string>
#include <memory> #include <sstream>
#include <vector>
#include "muParserDef.h" #include <memory>
/** \file #include "muParserDef.h"
\brief This file defines the error class used by the parser.
*/ /** \file
\brief This file defines the error class used by the parser.
namespace mu */
{
namespace mu
/** \brief Error codes. */ {
enum EErrorCodes /** \brief A class that handles the error messages. */
{ class ParserErrorMsg final
// Formula syntax errors {
ecUNEXPECTED_OPERATOR = 0, ///< Unexpected binary operator found public:
ecUNASSIGNABLE_TOKEN = 1, ///< Token cant be identified. static const ParserErrorMsg& Instance();
ecUNEXPECTED_EOF = 2, ///< Unexpected end of formula. (Example: "2+sin(") string_type operator[](unsigned a_iIdx) const;
ecUNEXPECTED_ARG_SEP = 3, ///< An unexpected comma has been found. (Example: "1,23")
ecUNEXPECTED_ARG = 4, ///< An unexpected argument has been found private:
ecUNEXPECTED_VAL = 5, ///< An unexpected value token has been found ParserErrorMsg& operator=(const ParserErrorMsg&) = delete;
ecUNEXPECTED_VAR = 6, ///< An unexpected variable token has been found ParserErrorMsg(const ParserErrorMsg&) = delete;
ecUNEXPECTED_PARENS = 7, ///< Unexpected Parenthesis, opening or closing ParserErrorMsg();
ecUNEXPECTED_STR = 8, ///< A string has been found at an inapropriate position
ecSTRING_EXPECTED = 9, ///< A string function has been called with a different type of argument ~ParserErrorMsg() = default;
ecVAL_EXPECTED = 10, ///< A numerical function has been called with a non value type of argument
ecMISSING_PARENS = 11, ///< Missing parens. (Example: "3*sin(3") std::vector<string_type> m_vErrMsg; ///< A vector with the predefined error messages
ecUNEXPECTED_FUN = 12, ///< Unexpected function found. (Example: "sin(8)cos(9)") };
ecUNTERMINATED_STRING = 13, ///< unterminated string constant. (Example: "3*valueof("hello)")
ecTOO_MANY_PARAMS = 14, ///< Too many function parameters
ecTOO_FEW_PARAMS = 15, ///< Too few function parameters. (Example: "ite(1<2,2)") /** \brief Error class of the parser.
ecOPRT_TYPE_CONFLICT = 16, ///< binary operators may only be applied to value items of the same type
ecSTR_RESULT = 17, ///< result is a string Part of the math parser package.
*/
// Invalid Parser input Parameters class API_EXPORT_CXX ParserError
ecINVALID_NAME = 18, ///< Invalid function, variable or constant name. {
ecINVALID_BINOP_IDENT = 19, ///< Invalid binary operator identifier private:
ecINVALID_INFIX_IDENT = 20, ///< Invalid function, variable or constant name.
ecINVALID_POSTFIX_IDENT = 21, ///< Invalid function, variable or constant name. /** \brief Replace all ocuurences of a substring with another string. */
void ReplaceSubString(string_type& strSource, const string_type& strFind, const string_type& strReplaceWith);
ecBUILTIN_OVERLOAD = 22, ///< Trying to overload builtin operator void Reset();
ecINVALID_FUN_PTR = 23, ///< Invalid callback function pointer
ecINVALID_VAR_PTR = 24, ///< Invalid variable pointer public:
ecEMPTY_EXPRESSION = 25, ///< The Expression is empty
ecNAME_CONFLICT = 26, ///< Name conflict ParserError();
ecOPT_PRI = 27, ///< Invalid operator priority explicit ParserError(EErrorCodes a_iErrc);
// explicit ParserError(const string_type& sMsg);
ecDOMAIN_ERROR = 28, ///< catch division by zero, sqrt(-1), log(0) (currently unused) ParserError(EErrorCodes a_iErrc, const string_type& sTok, const string_type& sFormula = string_type(), int a_iPos = -1);
ecDIV_BY_ZERO = 29, ///< Division by zero (currently unused) ParserError(EErrorCodes a_iErrc, int a_iPos, const string_type& sTok);
ecGENERIC = 30, ///< Generic error ParserError(const char_type* a_szMsg, int a_iPos = -1, const string_type& sTok = string_type());
ecLOCALE = 31, ///< Conflict with current locale ParserError(const ParserError& a_Obj);
ecUNEXPECTED_CONDITIONAL = 32, ParserError& operator=(const ParserError& a_Obj);
ecMISSING_ELSE_CLAUSE = 33, ~ParserError();
ecMISPLACED_COLON = 34,
void SetFormula(const string_type& a_strFormula);
ecUNREASONABLE_NUMBER_OF_COMPUTATIONS = 35, const string_type& GetExpr() const;
const string_type& GetMsg() const;
// internal errors int GetPos() const;
ecINTERNAL_ERROR = 36, ///< Internal error of any kind. const string_type& GetToken() const;
EErrorCodes GetCode() const;
// The last two are special entries
ecCOUNT, ///< This is no error code, It just stores just the total number of error codes private:
ecUNDEFINED = -1 ///< Undefined message, placeholder to detect unassigned error messages string_type m_strMsg; ///< The message string
}; string_type m_strFormula; ///< Formula string
string_type m_strTok; ///< Token related with the error
//--------------------------------------------------------------------------- int m_iPos; ///< Formula position related to the error
/** \brief A class that handles the error messages. EErrorCodes m_iErrc; ///< Error code
*/ const ParserErrorMsg& m_ErrMsg;
class ParserErrorMsg };
{
public: } // namespace mu
typedef ParserErrorMsg self_type;
#endif
ParserErrorMsg& operator=(const ParserErrorMsg &);
ParserErrorMsg(const ParserErrorMsg&);
ParserErrorMsg();
~ParserErrorMsg();
static const ParserErrorMsg& Instance();
string_type operator[](unsigned a_iIdx) const;
private:
std::vector<string_type> m_vErrMsg; ///< A vector with the predefined error messages
static const self_type m_Instance; ///< The instance pointer
};
//---------------------------------------------------------------------------
/** \brief Error class of the parser.
\author Ingo Berg
Part of the math parser package.
*/
class ParserError
{
private:
/** \brief Replace all ocuurences of a substring with another string. */
void ReplaceSubString( string_type &strSource,
const string_type &strFind,
const string_type &strReplaceWith);
void Reset();
public:
ParserError();
explicit ParserError(EErrorCodes a_iErrc);
explicit ParserError(const string_type &sMsg);
ParserError( EErrorCodes a_iErrc,
const string_type &sTok,
const string_type &sFormula = string_type(),
int a_iPos = -1);
ParserError( EErrorCodes a_iErrc,
int a_iPos,
const string_type &sTok);
ParserError( const char_type *a_szMsg,
int a_iPos = -1,
const string_type &sTok = string_type());
ParserError(const ParserError &a_Obj);
ParserError& operator=(const ParserError &a_Obj);
~ParserError();
void SetFormula(const string_type &a_strFormula);
const string_type& GetExpr() const;
const string_type& GetMsg() const;
int GetPos() const;
const string_type& GetToken() const;
EErrorCodes GetCode() const;
private:
string_type m_strMsg; ///< The message string
string_type m_strFormula; ///< Formula string
string_type m_strTok; ///< Token related with the error
int m_iPos; ///< Formula position related to the error
EErrorCodes m_iErrc; ///< Error code
const ParserErrorMsg &m_ErrMsg;
};
} // namespace mu
#endif
/* /*
__________
_____ __ __\______ \_____ _______ ______ ____ _______ _____ __ _____________ _______ ______ ___________
/ \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ / \| | \____ \__ \\_ __ \/ ___// __ \_ __ \
| Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ | Y Y \ | / |_> > __ \| | \/\___ \\ ___/| | \/
|__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| |__|_| /____/| __(____ /__| /____ >\___ >__|
\/ \/ \/ \/ \/ |__| \/ \/ \/
Copyright (C) 2013 Ingo Berg Copyright (C) 2004 - 2020 Ingo Berg
Permission is hereby granted, free of charge, to any person obtaining a copy of this Redistribution and use in source and binary forms, with or without modification, are permitted
software and associated documentation files (the "Software"), to deal in the Software provided that the following conditions are met:
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * Redistributions of source code must retain the above copyright notice, this list of
permit persons to whom the Software is furnished to do so, subject to the following conditions: conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of
The above copyright notice and this permission notice shall be included in all copies or conditions and the following disclaimer in the documentation and/or other materials provided
substantial portions of the Software. with the distribution.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
*/ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
#ifndef MU_PARSER_FIXES_H OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define MU_PARSER_FIXES_H */
/** \file #ifndef MU_PARSER_FIXES_H
\brief This file contains compatibility fixes for some platforms. #define MU_PARSER_FIXES_H
*/
/** \file
// \brief This file contains compatibility fixes for some platforms.
// Compatibility fixes */
//
//
//--------------------------------------------------------------------------- // Compatibility fixes
// //
// Intel Compiler
// /* From http://gcc.gnu.org/wiki/Visibility */
//--------------------------------------------------------------------------- /* Generic helper definitions for shared library support */
#if defined _WIN32 || defined __CYGWIN__
#ifdef __INTEL_COMPILER #define MUPARSER_HELPER_DLL_IMPORT __declspec(dllimport)
#define MUPARSER_HELPER_DLL_EXPORT __declspec(dllexport)
// remark #981: operands are evaluated in unspecified order #define MUPARSER_HELPER_DLL_LOCAL
// disabled -> completely pointless if the functions do not have side effects #else
// #if __GNUC__ >= 4
#pragma warning(disable:981) #define MUPARSER_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
#define MUPARSER_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
// remark #383: value copied to temporary, reference to temporary used #define MUPARSER_HELPER_DLL_LOCAL __attribute__ ((visibility ("hidden")))
#pragma warning(disable:383) #else
#define MUPARSER_HELPER_DLL_IMPORT
// remark #1572: floating-point equality and inequality comparisons are unreliable #define MUPARSER_HELPER_DLL_EXPORT
// disabled -> everyone knows it, the parser passes this problem #define MUPARSER_HELPER_DLL_LOCAL
// deliberately to the user #endif
#pragma warning(disable:1572) #endif
#endif /*
Now we use the generic helper definitions above to define API_EXPORT_CXX and MUPARSER_LOCAL.
#endif // include guard API_EXPORT_CXX is used for the public API symbols. It either DLL imports or DLL exports (or does nothing for static build)
MUPARSER_LOCAL is used for non-api symbols.
*/
#ifndef MUPARSER_STATIC /* defined if muParser is compiled as a DLL */
#ifdef MUPARSERLIB_EXPORTS /* defined if we are building the muParser DLL (instead of using it) */
#define API_EXPORT_CXX MUPARSER_HELPER_DLL_EXPORT
#else
#define API_EXPORT_CXX MUPARSER_HELPER_DLL_IMPORT
#endif /* MUPARSER_DLL_EXPORTS */
#define MUPARSER_LOCAL MUPARSER_HELPER_DLL_LOCAL
#else /* MUPARSER_STATIC is defined: this means muParser is a static lib. */
#define API_EXPORT_CXX
#define MUPARSER_LOCAL
#endif /* !MUPARSER_STATIC */
#ifdef _WIN32
#define API_EXPORT(TYPE) API_EXPORT_CXX TYPE __cdecl
#else
#define API_EXPORT(TYPE) TYPE
#endif
#endif // include guard
/* /*
__________
_____ __ __\______ \_____ _______ ______ ____ _______ _____ __ _____________ _______ ______ ___________
/ \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ / \| | \____ \__ \\_ __ \/ ___// __ \_ __ \
| Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ | Y Y \ | / |_> > __ \| | \/\___ \\ ___/| | \/
|__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| |__|_| /____/| __(____ /__| /____ >\___ >__|
\/ \/ \/ \/ \/ |__| \/ \/ \/
Copyright (C) 2004-2013 Ingo Berg Copyright (C) 2004 - 2020 Ingo Berg
Permission is hereby granted, free of charge, to any person obtaining a copy of this Redistribution and use in source and binary forms, with or without modification, are permitted
software and associated documentation files (the "Software"), to deal in the Software provided that the following conditions are met:
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * Redistributions of source code must retain the above copyright notice, this list of
permit persons to whom the Software is furnished to do so, subject to the following conditions: conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of
The above copyright notice and this permission notice shall be included in all copies or conditions and the following disclaimer in the documentation and/or other materials provided
substantial portions of the Software. with the distribution.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
*/ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
#ifndef MU_PARSER_INT_H OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define MU_PARSER_INT_H */
#include "muParserBase.h" #ifndef MU_PARSER_INT_H
#include <vector> #define MU_PARSER_INT_H
#include "muParserBase.h"
/** \file #include <vector>
\brief Definition of a parser using integer value.
*/
/** \file
\brief Definition of a parser using integer value.
namespace mu */
{
/** \brief Mathematical expressions parser. namespace mu
{
This version of the parser handles only integer numbers. It disables the built in operators thus it is
slower than muParser. Integer values are stored in the double value_type and converted if needed. /** \brief Mathematical expressions parser.
*/
class ParserInt : public ParserBase This version of the parser handles only integer numbers. It disables the built in operators thus it is
{ slower than muParser. Integer values are stored in the double value_type and converted if needed.
private: */
static int Round(value_type v) { return (int)(v + ((v>=0) ? 0.5 : -0.5) ); }; class ParserInt : public ParserBase
{
static value_type Abs(value_type); private:
static value_type Sign(value_type); static int Round(value_type v) { return (int)(v + ((v >= 0) ? 0.5 : -0.5)); };
static value_type Ite(value_type, value_type, value_type);
// !! The unary Minus is a MUST, otherwise you cant use negative signs !! static value_type Abs(value_type);
static value_type UnaryMinus(value_type); static value_type Sign(value_type);
// Functions with variable number of arguments static value_type Ite(value_type, value_type, value_type);
static value_type Sum(const value_type* a_afArg, int a_iArgc); // sum // !! The unary Minus is a MUST, otherwise you can't use negative signs !!
static value_type Min(const value_type* a_afArg, int a_iArgc); // minimum static value_type UnaryMinus(value_type);
static value_type Max(const value_type* a_afArg, int a_iArgc); // maximum // Functions with variable number of arguments
// binary operator callbacks static value_type Sum(const value_type* a_afArg, int a_iArgc); // sum
static value_type Add(value_type v1, value_type v2); static value_type Min(const value_type* a_afArg, int a_iArgc); // minimum
static value_type Sub(value_type v1, value_type v2); static value_type Max(const value_type* a_afArg, int a_iArgc); // maximum
static value_type Mul(value_type v1, value_type v2); // binary operator callbacks
static value_type Div(value_type v1, value_type v2); static value_type Add(value_type v1, value_type v2);
static value_type Mod(value_type v1, value_type v2); static value_type Sub(value_type v1, value_type v2);
static value_type Pow(value_type v1, value_type v2); static value_type Mul(value_type v1, value_type v2);
static value_type Shr(value_type v1, value_type v2); static value_type Div(value_type v1, value_type v2);
static value_type Shl(value_type v1, value_type v2); static value_type Mod(value_type v1, value_type v2);
static value_type LogAnd(value_type v1, value_type v2); static value_type Pow(value_type v1, value_type v2);
static value_type LogOr(value_type v1, value_type v2); static value_type Shr(value_type v1, value_type v2);
static value_type And(value_type v1, value_type v2); static value_type Shl(value_type v1, value_type v2);
static value_type Or(value_type v1, value_type v2); static value_type LogAnd(value_type v1, value_type v2);
static value_type Xor(value_type v1, value_type v2); static value_type LogOr(value_type v1, value_type v2);
static value_type Less(value_type v1, value_type v2); static value_type And(value_type v1, value_type v2);
static value_type Greater(value_type v1, value_type v2); static value_type Or(value_type v1, value_type v2);
static value_type LessEq(value_type v1, value_type v2); static value_type Xor(value_type v1, value_type v2);
static value_type GreaterEq(value_type v1, value_type v2); static value_type Less(value_type v1, value_type v2);
static value_type Equal(value_type v1, value_type v2); static value_type Greater(value_type v1, value_type v2);
static value_type NotEqual(value_type v1, value_type v2); static value_type LessEq(value_type v1, value_type v2);
static value_type Not(value_type v1); static value_type GreaterEq(value_type v1, value_type v2);
static value_type Equal(value_type v1, value_type v2);
static int IsHexVal(const char_type* a_szExpr, int *a_iPos, value_type *a_iVal); static value_type NotEqual(value_type v1, value_type v2);
static int IsBinVal(const char_type* a_szExpr, int *a_iPos, value_type *a_iVal); static value_type Not(value_type v1);
static int IsVal (const char_type* a_szExpr, int *a_iPos, value_type *a_iVal);
static int IsHexVal(const char_type* a_szExpr, int* a_iPos, value_type* a_iVal);
/** \brief A facet class used to change decimal and thousands separator. */ static int IsBinVal(const char_type* a_szExpr, int* a_iPos, value_type* a_iVal);
template<class TChar> static int IsVal(const char_type* a_szExpr, int* a_iPos, value_type* a_iVal);
class change_dec_sep : public std::numpunct<TChar>
{ /** \brief A facet class used to change decimal and thousands separator. */
public: template<class TChar>
class change_dec_sep : public std::numpunct<TChar>
explicit change_dec_sep(char_type cDecSep, char_type cThousandsSep = 0, int nGroup = 3) {
:std::numpunct<TChar>() public:
,m_cDecPoint(cDecSep)
,m_cThousandsSep(cThousandsSep) explicit change_dec_sep(char_type cDecSep, char_type cThousandsSep = 0, int nGroup = 3)
,m_nGroup(nGroup) :std::numpunct<TChar>()
{} , m_cDecPoint(cDecSep)
, m_cThousandsSep(cThousandsSep)
protected: , m_nGroup(nGroup)
{}
virtual char_type do_decimal_point() const
{ protected:
return m_cDecPoint;
} virtual char_type do_decimal_point() const
{
virtual char_type do_thousands_sep() const return m_cDecPoint;
{ }
return m_cThousandsSep;
} virtual char_type do_thousands_sep() const
{
virtual std::string do_grouping() const return m_cThousandsSep;
{ }
// fix for issue 4: https://code.google.com/p/muparser/issues/detail?id=4
// courtesy of Jens Bartsch virtual std::string do_grouping() const
// original code: {
// return std::string(1, (char)m_nGroup); // fix for issue 4: https://code.google.com/p/muparser/issues/detail?id=4
// new code: // courtesy of Jens Bartsch
return std::string(1, (char)(m_cThousandsSep > 0 ? m_nGroup : CHAR_MAX)); // original code:
} // return std::string(1, (char)m_nGroup);
// new code:
private: return std::string(1, (char)(m_cThousandsSep > 0 ? m_nGroup : CHAR_MAX));
}
int m_nGroup;
char_type m_cDecPoint; private:
char_type m_cThousandsSep;
}; int m_nGroup;
char_type m_cDecPoint;
public: char_type m_cThousandsSep;
ParserInt(); };
virtual void InitFun(); public:
virtual void InitOprt(); ParserInt();
virtual void InitConst();
virtual void InitCharSets(); virtual void InitFun();
}; virtual void InitOprt();
virtual void InitConst();
} // namespace mu virtual void InitCharSets();
};
#endif
} // namespace mu
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment