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.
- 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.
- Clone this repository, and navigate to the base folder,
Java-Subset-To-MIPS-Compiler - execute
makein the console within this directory. This will generate an executable namedmain.
- After bulding the project, the main executable should be created.
- 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
- 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)