Skip to content

gura105/create_c_compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prototype C Compiler

A simple compiler written in C

  • Currently, the following code can be compiled into assembly code.
5*(9-6) <= 15;

a = 1; b = 2; a + b == 3;

clk = 0; cnt = 0; while(clk < 5){clk = clk + 1; if(clk == 2){cnt = cnt + 1;} else if(clk == 4){cnt = cnt + 1;}} return cnt;

cond = 1; if(cond == 0) return 0; else if(cond == 1) return 1; else return 2;

How to use

make
./9cc '<statement you want to compile>' >> tmp.s
gcc -o tmp tmp.s

Reference

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors