A compiler for a simple language similar to c language. Written in Lex, Yacc, C.
Compiller has 3 steps:
- Lexical analysis reuslt will be a Abstract syntax tree for Syntax analysis.
- Syntax analysis.
- Three address code (3AC) generation.
In order to run the application:
- clone this repository.
- open Linux command.
- download bison lex and yacc: sudo apt-get install bison.
- go to project location.
- change codeTest.txt by language rules or leave the template code.
- run command: yacc -d parser.y
- run command: lex scanner.l
- run command: cc -o test y.tab.c -ll
- run command: ./test < projectPath/codeTest.txt
Please let me know if you find bugs or something that needs to be fixed.
Hope you enjoy.