C++11 parser and evaluator for mathematical expressions
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ast
examples
CMakeLists.txt
LICENSE
MathCommonConstants.cpp
MathCommonConstants.hpp
MathCommonFunctions.cpp
MathCommonFunctions.hpp
MathDriver.cpp
MathDriver.hpp
MathExpression.cpp
MathExpression.hpp
MathParser.cpp
MathParser.hpp
MathParser.ypp
MathParser_C.cpp
MathParser_C.h
MathScanner.l
README.md

README.md

#C++11 parser and evaluator for mathematical expressions

This is a parser and evaluator created for a plotting application.

You can compile strings like 2^x and evaluate their value for some values of x.

Also, in case of no variables you can use it as a simple calculator.

>> 3+5^2
28
>> sin(pi/2)
1

Part of the source code is generated on build time with flex and bison, so you need them in order to compile this. At the moment this project requires bison 2.7 (3.0 introduces some backward incompatible changes).

A C compatible API is also provided in order to help the usage of the parser in other languages than C++.

See examples directory for more information on usage.

##How to build

Regular CMake procedures apply. Remember to install flex and bison27.

mkdir build && cd build
cmake ..
make