A simple scripting language
| examples | initial commit | |
| .gitignore | initial commit | |
| .prettierrc | initial commit | |
| CHANGELOG | initial commit | |
| compiler.cpp | initial commit | |
| compiler.h | initial commit | |
| executable.h | initial commit | |
| lexer.cpp | initial commit | |
| lexer.h | initial commit | |
| Makefile | initial commit | |
| README | initial commit | |
| scr.cpp | initial commit | |
| transpiler.cpp | initial commit | |
| transpiler.h | initial commit | |
| value.cpp | initial commit | |
| value.h | initial commit | |
| vm.cpp | initial commit | |
| vm.h | initial commit | |
A basic scripting language (scr) for Programming Project 2 in COM S 3270 at Iowa State University. Build `scr` with `make all`. Then, you can run any of the test programs with `./scr ./examples/<name>.scr`. The language supports local variable creation, assignment, references, and math expressions, shortcutting logical expressions, equality expressions, and if statements, while statements, and built-in function calls (print and sqrt). I built a lexer, bytecode compiler (on the fly without a parse tree), and virtual machine for the language. The language only supports numbers, lambdas, and built-in function values. Also, if the first line of the file is a comment, it is printed to stderr. I have organized the codebase into separate files for each main part. Here are some descriptions: | Files | Description | | ------------------ | ------------------------- | | `compiler.h/cpp` | parsing and bytecode emit | | `executable.h/cpp` | bytecode format functions | | `lexer.h/cpp` | tokenization | | `value.h/cpp` | value representation | | `vm.h/cpp` | virtual machine | | `transpiler.h/cpp` | scr-to-js transpiler | Thank you for reviewing my submission.