Computer-Languages is a project mainly written in C++, it's free.
Compilers, Interpreters, with Spirit parser and LLVM code generator, for educational purposes
This is a work in progress, with for now, only the first examples as self-contained c++ programs (hence the dupplication). After launching the programs, you have to feed the "code" on standard input (Ctrl-d to end input when interactive).
define i32 @main() { entry: %addtmp = add i32 3, 1 %multmp = mul i32 2, %addtmp %addtmp1 = add i32 1, %multmp %divtmp = sdiv i32 1, 2 %subtmp = sub i32 %addtmp1, %divtmp ret i32 %subtmp } " and then exec the code to print the result: " result: 9 "
lang-2 adds variables (var a; var b=...;) and statements must end with a ';' the program must end with a return statement (return ... ;)
lang-3 adds if{} [else{}] and while(){} control structures and ternary operators.
To be continued ...