https://github.com/utam0k/r9cc
Toy C compiler
https://github.com/utam0k/r9cc
compiler rust
Last synced: 10 months ago
JSON representation
Toy C compiler
- Host: GitHub
- URL: https://github.com/utam0k/r9cc
- Owner: utam0k
- License: mit
- Created: 2018-08-19T11:38:06.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-06-21T00:38:30.000Z (about 5 years ago)
- Last Synced: 2025-08-15T08:43:47.790Z (10 months ago)
- Topics: compiler, rust
- Language: Rust
- Homepage: https://www.utam0k.jp/en/blog/2018/10/12/r9cc/
- Size: 245 KB
- Stars: 250
- Watchers: 6
- Forks: 28
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
r9cc C Compiler
===============
r9cc is a toy project of compiler.
This is the [9cc](https://github.com/rui314/9cc) Rust version.
# Usage
Rust 2018 edition is required.
- Compile
```
$ cargo run c_file_path
```
- Test
```
$ make test
```
# Current status
- [x] Four arithmetic operations
- [x] Logical operation
- [x] Local variable
- [x] Global variable
- [x] Function call
- [x] Function definition
- [x] Array
- [x] Pointer
- [x] ++/--
- [x] char/int type
- [x] String literal
- [x] Strunct
- [x] extern
- [x] Comment
- [x] #include
- [x] #define
- [x] \_\_LINE\_\_
# Design
If you want more information, I think you should refer to [README.md](https://github.com/rui314/9cc/blob/master/README.md) of [9cc](https://github.com/rui314/9cc).
# Reference
Special thanks to [9cc](https://github.com/rui314/9cc) and author [rui314](https://github.com/rui314)