Compiling C into JavaScript
tokens.l
parser.y
node.hpp
codeGen.cpp
level_*.c
, accompanied by level_*.js
as reference.
apt-get install flex bison
To run the compiled code, you need nodejs
with ES6 support, and several npm
packages:
npm install -g printf readline-sync
make
./parser test/level_1.c test/level_1.js
node test/level_1.js