/SBU_IE_HW1

Primary LanguageJavaMIT LicenseMIT

Cool Compiler

This project is developed for SBU Compiler Design Course - Fall 2021

Table of Contents

  1. About The Project
  2. Auxiliary Tools
  3. How To Use
  4. Roadmap
  5. Contributing
  6. License

About The Project

It has 3 Phases that in each phase the focus is on a specific part of a real compiler.

  • Phase 1 (Scanner)
  • Phase 2 (Parser)
  • Phase 3 (Code Generator)

This project is not a full compiler at all! It is just a simple implementation of a compiler (with many bugs :) ) based on lessons of the course and course assistant team's rules

(back to top)

Auxiliary Tools

In this project, we use some useful libraries and projects to make implementation easier.

(back to top)

How To Use

In Each Phase, There Are Some Necessary Tasks For Running The Program.

  • Phase 1 : test.txt Is The Input File For Scanner. You Just Need To Change This File For Testing More Inputs. You Can Also See The Result In output.html

  • Phase 2 : In This Phase We need InputCoolFilePath And OutputFilePath And TablePath You Can Change Each Of Them For Different Tests. To Run The Program, You Should Run Main.java Like Below            java [javaClassFile] --input [inputCoolFilePath] --output [outputFilePath] --table [tablePath]

  • Phase 3 : You Should Just Run Main.java. The SPIM Output Will Be Created In code.s. You Can Also Change Input File (Cool Program) test.cool

(back to top)

Roadmap

  • Fix Scanner Problems (Phase 1)
  • Change Graph For Accepting All Declarartions And Assignments In Any Order (Phase 2)
  • Add Array Support (Phase 3)
  • Fix Logical Computations (Phase 3)
  • Clean The Project :) (All Phases)

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)