This project is a simple demonstration of a stack based virtual machine in c++, that can execute arithmetic expressions.
I also took this opportuninity to try out a different parsing technique aside from the Old Trusty Recursive Descent parser. Instead of that our parser here uses a Climbing Presedence parser to, generate our ast.
git clone https://github.com/NM711/ExpressionVM.git
./ExpressionVM/build/main.out
- https://eli.thegreenplace.net/2012/08/02/parsing-expressions-by-precedence-climbing
- https://en.wikipedia.org/wiki/Operator-precedence_parser
- Lexing -> We aquire valid lexemes to convert into tokens
- Parsing -> We generate our AST off of the generated tokens
- Compiling -> We compile the AST to bytecode
- Executing -> We execute the bytecode instructions