Skip to content

Write a simple interpreter of C. Inspired by c4 and largely based on it.

License

Notifications You must be signed in to change notification settings

descent/write-a-C-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Run the Code

gcc -o xc xc.c (you may need the -m32 option on 64bit machines)
./xc hello.c
./xc -s hello.c

./xc c4.c hello.c
./xc c4.c c4.c hello.c

About

This project is inspired by c4 and is largely based on it.

However, I rewrited them all to make it more understable and help myself to understand it.

Despite the complexity we saw in books about compiler design, writing one is not that hard. You don't need that much theory though they will help for better understanding the logic behind the code.

Also I write a series of article about how this compiler is built(in Chinese though).

Licence

The original code is licenced with GPL2, so this code will use the same licence.

About

Write a simple interpreter of C. Inspired by c4 and largely based on it.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 99.8%
  • Makefile 0.2%