BRAINIAC2677 / CSE310-Compiler

A compiler for limited syntax of c. Part of course works of CSE310.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CSE310 | Compiler

Assignment Specifications

But I have broken the assignments into 5 stages and done some extensions in the last stage. You can run the generated assembly of stage 5 and 6 in a 8086 assembly emulator.

Stages

How to run on Linux

  • Install flex and bison using

sudo apt install flex bison

  • Install gcc using

sudo apt install gcc

  • Clone the repo using git clone or download the zip file.
  • Go to the directory of the stage you want to run.
  • Run the following commands

make run

  • After compilation you will be prompted to enter the input file name. Check out the example input files.
  • The input file should be
    • In the same directory as the stage directory
    • Have the syntax supported by this context free grammar
  • The output will be generated in the same directory as the stage directory.
  • To clean the directory run

make clean

Example Input/Output

Resources:

Relevant QnA

Tools

About

A compiler for limited syntax of c. Part of course works of CSE310.


Languages

Language:Yacc 30.3%Language:C 28.0%Language:C++ 19.8%Language:Assembly 16.6%Language:Lex 4.4%Language:Makefile 0.9%