muParser API -  1.35
muParser.h
Go to the documentation of this file.
1 /*
2 
3  _____ __ _____________ _______ ______ ___________
4  / \| | \____ \__ \\_ __ \/ ___// __ \_ __ \
5  | Y Y \ | / |_> > __ \| | \/\___ \\ ___/| | \/
6  |__|_| /____/| __(____ /__| /____ >\___ >__|
7  \/ |__| \/ \/ \/
8  Copyright (C) 2004 - 2022 Ingo Berg
9 
10  Redistribution and use in source and binary forms, with or without modification, are permitted
11  provided that the following conditions are met:
12 
13  * Redistributions of source code must retain the above copyright notice, this list of
14  conditions and the following disclaimer.
15  * Redistributions in binary form must reproduce the above copyright notice, this list of
16  conditions and the following disclaimer in the documentation and/or other materials provided
17  with the distribution.
18 
19  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
20  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
22  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28 
29 #ifndef MU_PARSER_H
30 #define MU_PARSER_H
31 
32 //--- Standard includes ------------------------------------------------------------------------
33 #include <vector>
34 
35 //--- Parser includes --------------------------------------------------------------------------
36 #include "muParserBase.h"
37 #include "muParserTemplateMagic.h"
38 
39 /** \file
40  \brief Definition of the standard floating point parser.
41 */
42 
43 namespace mu
44 {
45  /** \brief Mathematical expressions parser.
46 
47  Standard implementation of the mathematical expressions parser.
48  Can be used as a reference implementation for subclassing the parser.
49  */
50  class API_EXPORT_CXX Parser : public ParserBase
51  {
52  public:
53 
54  Parser();
55 
56  void InitCharSets() override;
57  void InitFun() override;
58  void InitConst() override;
59  void InitOprt() override;
60  void OnDetectVar(string_type* pExpr, int& nStart, int& nEnd) override;
61 
62  value_type Diff(value_type* a_Var, value_type a_fPos, value_type a_fEpsilon = 0) const;
63 
64  protected:
65 
66  static int IsVal(const char_type* a_szExpr, int* a_iPos, value_type* a_fVal);
67  };
68 } // namespace mu
69 
70 #endif
71 
This file contains the class definition of the muparser engine.
MUP_BASETYPE value_type
The numeric datatype used by the parser.
Definition: muParserDef.h:294
Namespace for mathematical applications.
Definition: muParser.cpp:46
string_type::value_type char_type
The character type used by the parser.
Definition: muParserDef.h:306
Mathematical expressions parser.
Definition: muParser.h:50
MUP_STRING_TYPE string_type
The stringtype used by the parser.
Definition: muParserDef.h:300
Mathematical expressions parser (base parser engine).
Definition: muParserBase.h:68