Compile ClassroomObjectOrientedLanguage to EcmaScript6+, and provide a single .html playground for GUI user.
COOL lexer and parser are generated by antlr4.
I PR a grammar to antlr4 grammars, if there were something wrong, please issue it.
- install by
yarn
orcnpm i
ornpm i
- build by
npm run build
orgulp build
- run by
node -r ./build/bundle.js
or open./build/COOLRuner.html
in browser
- user choose a *.cl file
- load *.cl file, show in editor
- on editor change, send content to lexer, to parser, get a COOL AST
- visit COOL AST, build an ES6 AST
- generate ES6 code from ES6 AST
- show ES6 code in UI
- transform ES6 to vanilla JS (maybe optional)
- execute JS in an iframe, given *.std as input
- user feeling happy, choose another *.cl
- antlr-ts 使用经验(过时的)
- antlr4使用经验
- antlr4小教程
- JSON.g4 example
- 剖析Babel——Babel总览
- babel-types at npm
- babel-types usage at its test
- babel-template at npm
- Babel Plugin Handbook
- Understanding ASTs by Building Your Own Babel Plugin(illustrating ES AST)
- COOL manual
- AST explorer(learn how AST form, expecally flowtype)
- Parser + AST builder: 5 men day
- 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