Skip to content

C Subset Compiler developed at CIN-UFPE for the Compilers 101 course.

Notifications You must be signed in to change notification settings

heitorado/c-subset-compiler

Repository files navigation

C Subset Compiler

This is my repo for store and track progress on the college project for the Compilers course on the second semester of 2020. Due to the pandemics the semester is of extraordinary character and it was called "2020.3".

The project consists on building a compiler for a subset of the C language. ANTLR is being used for parser generation.

Running

Instructions to run each part of the project are contained on their respective folders.

Copyright, disclaimers, and other stuff

  • I, obviously, did not develop the .jar package of the ANTLR software provided in this repo. It was a copy provided for developing this project. Refer to the official ANTLR website for the latest version and more info, etc.
  • The makefile inside the /1_antl_grammar/ folder was also not written by me, nor any of the codes on the /sample_codes/ directory. They were also provided for educational purposes. You can find them and other resources at the original project repo
  • The same as described above applies for the files inside /2_type_checker/ EXCEPT the README.md, test_input.c and GrammarCheckerVisitor.py, which were written and/or modified by yours truly. As an additional note, the Grammar.g4 inside that folder serves the purpose of a "solved exercise" for the part 1 of this project. Since this was the "official" answer provided after the delivery date of part 1, I used it instead of the one I developed, for the sake of not having more headaches.
  • The same also applies for the files inside /3_optimization/, EXCEPT the modifications made on the GrammarCheckerVisitor.py and the generated my_outputXX.txt. At this point I did not care enough to write a README. A formal specification was not provided for the project as well so I guess I wasn't the only one that did not care.
  • The same also applies for the files inside /4_intermediary_representation/, except my outputs and modifications on the GrammarCheckerVisitor.py, etc etc etc, you know the drill. At this point I did not care for anything else except managing my anxiety and not having to do this again in my life, ever. Oh 2020, what a year!

All the rest was made by me with love and despair. Sometimes one, sometimes another, and sometimes both. Sometimes rage took a part in the play as well.

Hope this helps someone, someday. (But at the same time, I wish that no one ever has to go through this suffering.)

About

C Subset Compiler developed at CIN-UFPE for the Compilers 101 course.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages