OmarKimo / CompilersProject

Compilers course project in Computer Department in Faculty of Engineering, Cairo University

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilers Project

Project Overview:

Simple C language Compiler that is designed to compile basic functions of C language components.

Tools and Technologies used:

  • Flex: compile lex files
  • Bison: compile yacc files
  • Cygwin: generate executable files

Production rules:

  • Variables and Constants declaration
  • Mathematical expressions (+, -, *, /)
  • Assignment statement
  • Block structure ({}, ())

Quadruples:

  • MOV 3, R0 [move value 3 to register R0]
  • MOV R0, x [move value in register R0 to variable x]
  • ADD R0, R1, R2 [add the value in R0 & R1 and move it to R2]
  • SUB R0, R1, R2 [the same as ADD but subtract]
  • MUL R0, R1, R2 [the same as ADD but multiply]
  • DIV R0, R1, R2 [the same as ADD but divide]

About

Compilers course project in Computer Department in Faculty of Engineering, Cairo University

License:MIT License


Languages

Language:C 83.6%Language:Yacc 15.4%Language:Lex 0.7%Language:C++ 0.2%Language:Batchfile 0.1%