GOAL of project: This a completely learning based project. To build a compiler from scratch without using the library functions.
- The end goal of the compiler is to be able to implement FizzBuzz on its own.
- This will include implementation of loops and conditional statements.
- This will also include a basic implementation of arithmetic operators.
- Also an implementation of the modulo operator.
Current progress: Can compile a fizzbuzz code given in the examples!
Dependencies: nasm, gcc Build Instructions part-I:
- gcc main.c parserf.c lexerf.c codegeneratorf.c ./hashmap/hashmapoperators.c -c
- gcc main.o parserf.o lexerf.o codegeneratorf.o hashmapoperators.o -o demo
- ./demo examples/fizzbuzz.did output
- ./output
Build Instructions part-II:
- ./build.sh
- ./build examples/fizzbuzz.did output
- ./output
NOTE: This compiler uses x86 architecture and the code will not compile if you are using arm64 based architectures. To deal with this problem, here is a link: https://mrsen.medium.com/how-to-run-x86-assembly-on-m1-mac-on-docker-a58c476c6655
PS: This could not have been possible without CobbCoding's video series on the compiler from scratch: https://www.youtube.com/watch?v=-4RmhDy0A2s&list=PLRnI_2_ZWhtA_ZAzEa8uJF8wgGF0HjjEz&ab_channel=CobbCoding