/rucc

Primary LanguageRust

rucc

rucc is a small C compiler written in Rust.

Requirements

  • Rust
  • gcc

Useage

rucc [ -o <path> ] <file>

Test

make test

Features

  • Data types
    • Primitive
      • char
      • short
      • int
      • long
      • long long
      • signed integer
      • float
      • double
      • long double
      • complex number
    • enum
    • union
    • struct
    • array
    • pointer
    • incomplete type
    • Type qualifiers
      • const
      • volatile
    • Storage class specifiers
      • auto
      • extern
      • register
      • static
  • Expressions and Operators
    • Assignment Operators (=, +=, -=, *=, /=, %=, <<=, >>=, &=, ^=, |=)
    • Incrementing and Decrementing (++, --)
    • Arithmetic Operators (+, -, *, %)
    • Comparison Operators (==, !=, <, >, <=, >=)
    • Logical Operators (&&, ||, !)
    • Bit Shifting (<<, >>)
    • Bitwise Logical Operators (&, |, ^, ~)
    • Pointer Operators (*ptr, &var)
    • sizeof
    • Type Casts
    • Array Subscripts
    • Function Calls as Expressions
    • The Comma Operator
    • Member Access Expressions
    • Conditional Expressions (?:)
    • Statements and Declarations in Expressions
  • Statements
    • Labels
    • The if Statements
    • The switch Statements
    • The while Statements
    • The do Statements
    • The for Statements
    • Blocks
    • The Null Statements
    • The goto Statements
    • The break Statements
    • The continue Statements
    • The return Statements
    • The goto Statements
    • The typedef Statements
  • Functions
    • Function Declarations
    • Function Definitions
    • Calling Declarations
    • Function Parameters (up to 6 arguments)
    • Variable Length Parameter Lists
    • Calling Functions Through Function Pointers
    • Recursive Functions
    • Static Functions
  • Program Structure and Scope
    • Scope
  • Ohter
    • Preprocessor directives

References

Implementation

Document

Other