A simple C program that evaluates arithmetic expressions using the Shunting Yard algorithm. Supports:
+,-,*,/,%,^- Parentheses for grouping
- Unary minus
- Floating-point numbers (doubles)
- Original Shunting Yard algorithm implementation: literateprograms.org
- Double conversion support inspired by: Anthony DiGirolamo, GitHub gist
- Vectorized and maintained by: Jonah Huggins
A standalone, single-file version of the library is available on the single-file branch for easy integration. It is also included in release v1.0.
mkdir build
cd build
cmake ..
cmake --build .This will create the executable ReactionParser in the build directory.
./ReactionParser "3 + 4 * 2"Example output:
11.000000
A test suite is provided in tests/test_reactionparser.c:
./test_reactionparser