ycc is a self-hosted x86-64 C Compiler written in C.
This is initially based on https://www.sigbus.info/compilerbook (compilerbook).
I create this compiler for my study :)
This is partially compliant with C11 specification.
The implementation is work in progress, so ycc is still a toy.
- Docker
- x86-64 Environment
$ docker build -t compilerbook https://www.sigbus.info/compilerbook/Dockerfile
$ ./shell.sh
$ make
You can use 1st, 2nd and 3rd gen compilers.
Path | Gen | Description |
---|---|---|
./build/ycc_gen1 |
1st | Compiled by cc |
./build/ycc_gen2 |
2nd | Compiled by ./build/ycc_gen1 |
./build/ycc_gen3 |
3rd | Compiled by ./build/ycc_gen2 (Same as gen2) |
$ ycc <target C file path>
(output the assembly to stdout)
$ ./test-docker.sh
- Self-hosted
- Struct
- Enum
- Variable Arguments
short
,_Bool
andvoid
typetypedef
- Function declaration
switch
- Scope
- char literal
continue
andbreak
%
,||
,&&
,+=
,!
,++
and--
operators- and so on!
WIP