Skip to content

BNWong2000/Java-Subset-To-MIPS-Compiler

Repository files navigation

Java Subset to MIPS compiler

Branden Wong

This compiler compiles a specific subset of Java into MIPS assembly code. The specification for this subset can be found here or alternatively here.

How to Build:

Prerequisites:

  • Ensure that your computer is running c++14 and contains the clang++ compiler
  • Ensure that the Fast Lexical Analyzer Tool (FLEX) libary is installed on your computer. This can be found here: FLEX.
  • Ensure that the Bison libary is installed on your computer. This can be found here: Bison.

Build Instructions:

  1. Clone this repository, and navigate to the base folder, Java-Subset-To-MIPS-Compiler
  2. execute make in the console within this directory. This will generate an executable named main.

Execution Instructions:

  1. After bulding the project, the main executable should be created.
  2. Execute this file and include the file you would like to compile as an argument. Example: ./main [NAME_OF_FILE]

This will output the MIPS assembly code to standard output, which can then be piped to a *.s file.

Example: ./main /path/to/j--/file > outputFileName.s

Example test File Outputs:

  • The outputs of the provided test files (located in the cpsc folder ~Aycock/411/TEST/final/) are found in the finalResults folder.
    • These include the assembly files (denoted with a .s) and the output of said files, when run with SPIM (denoted with a .out)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors