A C++ app that parses JSON and evaluates user expressions.
- Evaluating trivial expressions with JSON paths
- min() and max() functions
- Work with an array or multiple arguments
- size() function
- Works with arrays and objects
- Expressions and functions in the subscript operator []
- Allows for recursive function and expression calls
- Binary arithmetic operations with expressions
- C++ 20 or later
- CMake 3.29 or later
- Clone the repository.
git clone https://github.com/markovolimango/JSON-Parser.git- Create a build directory and navigate to it.
cd JSON-Parser
mkdir build
cd build- Generate the build files using CMake.
cmake ..- Build the project.
make- Place your JSON file in the build directory.
- Run the json_eval executable and input the file name and expression.
./json_eval
[filename] [expression]Examples:
./json_eval
test.json a.b[1]./json_eval
test.json a.b[max(0,a.b[1])]./json_eval
test.json a.b[3][1]+a.b[size(a)]- Just run the tests executable.
./tests