Skip to content

Yahavba/C-family-Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C-family-Compiler

A compiler for a simple language similar to c language. Written in Lex, Yacc, C.

Compiller has 3 steps:

  1. Lexical analysis reuslt will be a Abstract syntax tree for Syntax analysis.
  2. Syntax analysis.
  3. Three address code (3AC) generation.

Demo:

ALT "demo video"


In order to run the application:
  1. clone this repository.
  2. open Linux command.
  3. download bison lex and yacc: sudo apt-get install bison.
  4. go to project location.
  5. change codeTest.txt by language rules or leave the template code.
  6. run command: yacc -d parser.y
  7. run command: lex scanner.l
  8. run command: cc -o test y.tab.c -ll
  9. run command: ./test < projectPath/codeTest.txt

Please let me know if you find bugs or something that needs to be fixed.

Hope you enjoy.

About

A compiler for a simple language similar to C language.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published