Learn the-super-tiny-compiler.
- tokenizer
- parser
- traverser
- transformer
- codegen
- compiler
npm install @moozon/tiny-compiler
import { compiler } from '@moozon/tiny-compiler'
console.log(
/**
* should output:
* "add(2, subtract(4, 2));"
*/
compiler('(add 2 (subtract 4 2))')
)
console.log(
/**
* should output:
* "add(2, subtract(4, 2));
* add(2, subtract(4, 2));"
*/
compiler('(add 2 (subtract 4 2))(add 2 (subtract 4 2))')
)
import {
codegen,
parser,
tokenizer,
transformer,
traverser,
} from '@moozon/tiny-compiler'
// checkout test files
// ...