Skip to content

This is a simple C compiler that created with lex and yacc and it is my compiler design course project :)

Notifications You must be signed in to change notification settings

sarsanaee/Simple-C-Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple-C-Compiler

This is a simple C compiler that created with lex and yacc and it is my compiler design course project :)
In archlinux simply install byacc and use it for creating y.tab.c and lex for creating y.lex.c.

Installation

I think that fairly simple packages are needed for this porject. It would be just byacc and bison and lex.

For Arch

sudo pacman -S byacc

For Ubuntu

sudo apt-get install byacc lex

yacc is the fundamental parts of a compiler. Parsers are integrated in .yacc file and there is no optimization for it. However, we have a simple semantic analyzer available to be used here. I try to generate llvm assembly in order to use llvm's code optimizer and other benefits of it.

you can do it by using assembler.py. You need to just give three address code which is generated by compiler to python the script as first argument python2 assmebler.py threeaddresscode.txt.

Hint

Follow the mybash.sh script so that you can figure out how this project is working.

About

This is a simple C compiler that created with lex and yacc and it is my compiler design course project :)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published