mirror of
https://github.com/Gers2017/cpp.js.git
synced 2024-11-21 22:38:41 -06:00
Gers2017
9a1ad1e7a4
- Move generate_rust_code to interpreter - Clean stuff.js - Parse command line arguments |
||
---|---|---|
.gitignore | ||
interpreter.js | ||
main.cpp | ||
main.js | ||
Makefile | ||
package.json | ||
parser.js | ||
README.md | ||
run.sh | ||
stuff.js | ||
utils.js |
Cpp.js
C++ compiler written in Vanilla Javascript
Features
- Compiles c++ to Rust
- Compiles c++ to Php (Not yet)
Motivation
Because I had no other choice.
Example
# node main.js <file>.cpp
node main.js main.cpp # compiles a main.cpp file to rust
Test rust code
# rustc <file>.rs -o <file>.out
rustc main.rs -o main.out
Support
//
commentsprintf("...");
return
#include <cstdio>
int main()
{
// This is comment
printf("Hello from c++\n");
return 0;
}