Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.
/ ExpressionVM Public archive

A stack based virtual machine for arithmetic expression execution.

Notifications You must be signed in to change notification settings

NM711/ExpressionVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expression VM

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.

Execute

git clone https://github.com/NM711/ExpressionVM.git
./ExpressionVM/build/main.out

Parser Algorithm Resources:

  1. https://eli.thegreenplace.net/2012/08/02/parsing-expressions-by-precedence-climbing
  2. https://en.wikipedia.org/wiki/Operator-precedence_parser

General Phases:

  1. Lexing -> We aquire valid lexemes to convert into tokens
  2. Parsing -> We generate our AST off of the generated tokens
  3. Compiling -> We compile the AST to bytecode
  4. Executing -> We execute the bytecode instructions

About

A stack based virtual machine for arithmetic expression execution.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published