This is a nice small C subset compiler implemented in Elixir.
git clone https://github.com/hiphoox/c321-turingmachine
mix escript.build
./nqcc file_name.c
- Prints help options:
./nqcc file_name.c --help
- Prints all compiling stages output and compiles the specified file:
./nqcc file_name.c --A
- Prints scanner output:
./nqcc file_name.c --l
- Prints parser output:
./nqcc file_name.c --p
- Prints code generator: output
./nqcc file_name.c --s
- Prints sanitizer output:
./nqcc file_name.c --sn
$ nqcc ./examples/return_2.c
$ nqcc ./examples/return_2.c --A
$ nqcc ./examples/return_2.c --sn
mix test