biran0079 / RanC

a self-hosting compiler for a subset of C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RanC Build Status codecov

A self-hosting compiler for a subset of C.

How to use

$ make ranc                      # bootstrap ranc
$ ./ranc > a.s <<EOF             
void printf();
int main() {
  printf("hello world\n");
  return 0;
}
EOF                              # compile C code to assembly
$ gcc -m32 a.s                   # use gcc to assemble and link into binary executable
$ ./a.out                        # run your program

How to test

$ make test

Acknowledge

Many ideas are borrowed from https://github.com/Fedjmike/mini-c.

About

a self-hosting compiler for a subset of C

License:MIT License


Languages

Language:C 98.1%Language:Makefile 1.6%Language:Shell 0.4%