Skip to content

kINo204/BUAA-Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BUAA Compiler Project

image

This is a repository containing labs for BUAA compiler course. DO NOT USE THE CODE DIRECTLY!

The compiler is written in Java, implementing a recursive-descent frontend, a mid part with customized 3-address IR, and a backend for MIPS architecture(running on "marsc.jar").

Usage

At working directory, run the script ./tools/run.cmd. This will compile the source program in testfile.txt and run the generated mips.txt through marsc.jar.

You can dis-rem comments in run.cmd to enable comparing running with unoptimized compiler. The compiler configs is controlled by two CLI args: java -jar compiler.jar O P, indicating enabling optimizing & runtime profiling info. Replace O or P with N will disable the corresponding function.

A dot command line tool for graphviz is needed as well. After each run you may find the control flow graph of the optimized program in ./target/cfg/.

All runnable tools lies within ./tools/, use at ease.

About

A compiler for SysY to MIPS in Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages