This is just a simple learning project to understand THE SUPER TINY COMPILER! With the added benefit of unit tests.
See the inner-working (guts) of the compiler and how it works! Repo here.
Please check out the original here! NOW!
All tests are found inside the tests
folder.
To run, choose one of the compiler components from below:
node tests\tokenizer.spec.js
node tests\parser.spec.js
node tests\traverser.spec.js
node tests\transformer.spec.js
node tests\code-generator.spec.js
Test arrangement is quite simple and uses npm assert I'm would like to add karma & jasmine support, sometime in the future.
I'm sure you would like to understand this compiler mombo-jumbo as fast as possible and then feel smart for the rest of the day!
So why not try this: take each compiler component and go through each test first! I believe it's a thorough and bite-sized approach to learning a fairly complex concept!
Currently the only language syntax which is supported is: LISP -> C.
It only supports method names with numbers and strings as paramteres
In this version I'll try and take a more TDD approach (a very light one). This may mean it will be easier for you to understand how the compiler works, step by step (test by test ;) ).
However I believe you do have to go through the tiny-super-compiler code at least once before having a look here!
Feel free to improve on the project however you see fit! You have my full trust :)!
All credits for the super tiny compiler go to: the man, the myth, the legend James Kyle