• Stars
    star
    238
  • Rank 168,402 (Top 4 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 6 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Toy C compiler

r9cc C Compiler

r9cc is a toy project of compiler.
This is the 9cc Rust version.

Usage

Rust 2018 edition is required.

  • Compile
$ cargo run c_file_path
  • Test
$ make test

Current status

  • Four arithmetic operations
  • Logical operation
  • Local variable
  • Global variable
  • Function call
  • Function definition
  • Array
  • Pointer
  • ++/--
  • char/int type
  • String literal
  • Strunct
  • extern
  • Comment
  • #include
  • #define
  • __LINE__

Design

If you want more information, I think you should refer to README.md of 9cc.

Reference

Special thanks to 9cc and author rui314