Skip to content

An interpreter that can evaluate simple calculations to understand how computers process human-readable text

License

Notifications You must be signed in to change notification settings

jackprogramsjp/CPP-Simple-Math-Interpreter-V2

Repository files navigation

C++ - Simple Math Interpreter V2

I made this for fun, so there may or may not be some bad practice or anything like that! If there is an issue, I'm willing to fix it, but I do not have a lot of knowledge with C++.

An interpreter, written in C++, that can evaluate simple math calculations.

This is written in C++11.

V1

My first simple math interpreter:

https://github.com/jackprogramsjp/CPP-Simple-Math-Interpreter

V2 (this)

Improvements:

  • Smart pointers instead of raw pointers.
  • More similar to CodePulse's Python Simple Math Interpreter code
  • Inheritance with classes, including use of virtual functions (polymorphism)
  • CMakeLists.txt added to build with CMake
  • In general, more use of C++11 features

V2 does not have the power operator like in V1.

Credits

Credits to CodePulse for the Simple Math interpreter written in Python and credits to CoolDeveloper101 for his Simple Math Interpreter written in C#.

Here is CodePulse's simple math interpreter. Here is CoolDeveloper101's simple math interpreter and this.

Running the program

If you are using G++ (GNU Compiler Collection), there is a compile.txt, so you can compile the interpreter into an executable file.

You can also build with CMake. In a terminal, go to the root directory and run

cmake .
make
./CPP-Simple-Math-Interpreter

to compile and execute the math interpreter.

About

An interpreter that can evaluate simple calculations to understand how computers process human-readable text

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published