cc is a subset of c compiler. It will cover the c89 syntax in th future.
This product is developed for my study of computer science. Pull requests which are related to language implementation will be declined since I want to study implementing features and do that by my self. Any issues are welcome and will help me for developing this project. Thank you for your understanding!
- void
- char
- int
- unsigned
- struct
- union
- enum
- if
- else
- { ... }
- switch
- while
- for
- continue
- break
- return
- #define
- #if ... #endif
- typedef
- sizeof
A test header file for test.c
A test file for application. This file is not used to build cc.
All error point logics are controlled here.
A file reader and an include path finder.
A header file which all used functions are declared in. Also, briefs of those functions are written here.
New token functions which make new tokens and token utilities
New node functions which make new nodes for abstract syntax tree
This file serves vector utilities.
Hash map utilities
String utilities such as strlen, strncmp, strncpy in string.h.
Functions for unit test.
A tokenizer
A main function are written in this file.
Parsing functions.
Generator functions which convert an abstract syntax tree into assembly codes.
- refactoring/ remove include standard library
- allow type cast in a global declaration
- add %
- add unsigned long
- add macro operator #, ##
- fix the extern static variables code generation
- add va-arg function declaration
- add include file path find algorithm
- add #ifndef, #ifdef
- add #elif #else
- add a character literal ''
- add type cast
- add long and long int
- add ? :
- add typedef
- sizeof can accept type-keyword, type alias
- add do{...}while(...)
- refactoring preprocessor (especially macro_expansion)
- add storage class specifiers (static, extern)
- add #include to preprocessor
For simplicity, we will not manage memories in cc codes. We allocate memories to pointers but will not free memories within the compiler life cycle. Don't use "free" before changing this policy.
Rui Ueyama,低レイヤを知りたい人のためのCコンパイラ作成入門,2020-03-16,https://www.sigbus.info/compilerbook
ISO/IEC 9899:2011 - Information technology - Programming languages - C
draft of standard above ,last edited 2012-Nov-11 20:09:34,https://port70.net/~nsz/c/c11/n1570.html