Understanding the Super Tiny Compiler
This is just a simple learning project to understand THE SUPER TINY COMPILER! With the added benefit of unit tests.
Check the website
See the inner-working (guts) of the compiler and how it works! Repo here.
Original project
Please check out the original here! NOW!
Run tests
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.
Test importance
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!
Supported languages
Currently the only language syntax which is supported is: LISP -> C.
It only supports method names with numbers and strings as paramteres
Why should I care? V2.0
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!
Mi casa es su casa
Feel free to improve on the project however you see fit! You have my full trust :)!
Credits
All credits for the super tiny compiler go to: the man, the myth, the legend James Kyle