Compile ClassroomObjectOrientedLanguage to EcmaScript6+, and provide a single .html playground for GUI user.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.vscode
examples
flow-typed/npm
src
.babelrc
.eslintrc
.flowconfig
.gitignore
LICENSE
README.md
gulpfile.js
package.json
webpack.config.js
yarn.lock

README.md

COOL-to-JavaScript

Compile ClassroomObjectOrientedLanguage to EcmaScript6+, and provide a single .html playground for GUI user.

description

COOL lexer and parser are generated by antlr4.

I PR a grammar to antlr4 grammars, if there were something wrong, please issue it.

usage

  1. install by yarn or cnpm i or npm i
  2. build by npm run build or gulp build
  3. run by node -r ./build/bundle.js or open ./build/COOLRuner.html in browser

dataflow

  1. user choose a *.cl file
  2. load *.cl file, show in editor
  3. on editor change, send content to lexer, to parser, get a COOL AST
  4. visit COOL AST, build an ES6 AST
  5. generate ES6 code from ES6 AST
  6. show ES6 code in UI
  7. transform ES6 to vanilla JS (maybe optional)
  8. execute JS in an iframe, given *.std as input
  9. user feeling happy, choose another *.cl

referencce

schedule

  • Parser + AST builder: 5 men day

todos

  • fix high callstack usage:
  • Topological Sorting of class defination: COOL's class can be randomly arranged, but ES6 classes should be sorted
  • Linting for generated code: call eslint --fix programmatically
  • webworker: doing hard job background with a status information

sponsor