This repository contains a C compiler made as part of compiler course (CS335). The compiler properties are:
Source Language : C
Implementation Language : python 3
Target Architecture : MIPS
- Ketan Chaturvedi (190428)
- Sanjay Pander (190758)
- Priyanshu Yadav (190652)
- Hardik Sharma (190353)
To run the parser, cd into the compiler directory and use the following command:
python3 src/parser.py
The above command will generate an assembly file out.s
, which can be loaded into spim simulator and then executed.
The output of parser is in output.s
- Milestone 1 : Added compiler source language specifications
- Milestone 2 : Built lexer in python to tokenize C code
- Milestone 3 : Developed parser for the source language that outputs the Parser Automaton in a graphical form
- Wrote grammer rules for the C language
- Removed several reduce/reduce and shift/reduce conflicts
- Used action table and goto table to generate .dot file which when processed by Graphviz, gave a Parser Automaton image file
- Milestone 4 : Added error handling to the parser
- Milestone 5 : Generated TAC code for the input code
- Milestone 6 : Bootstrapped the complete compiler. Added functionalities for code generation.