Skip to content
lucasch37Public

About

x86-64 C compiler completely from scratch

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

llcc

llcc is a (toy) C compiler written in Rust with no dependencies that compiles C code into x86_64 following Intel syntax.

Features

Current/Planned:

  • Binary and unary operators
  • Global and local variable declarations
  • char, int, float, & double types
  • Function calls & recursion
  • Pointers
  • putchar
  • Conditional statements
  • for, while loops

Error Reporting

Features detailed, colorful error messages and can report multiple errors in a program.

Code Messages
void foo() {
  return 0;
}

int main() {
  int x = 7 / 0;
  return 0;
}
image

AST Pretty Printing

Use the --print-ast option to print the AST tree after parsing.

Code Tree
int main() {
  int y = 9 * 2;
  return 0;
}
image

About

x86-64 C compiler completely from scratch

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages