/sysy-compiler

Primary LanguageC++GNU General Public License v3.0GPL-3.0

SysY Compiler

This is a project for the course Compiler Principles. It can translate a SysY language source file to a RISC-V32IM assembly target file.

Building

After installing essential build tools, the compiler can be built with the following command:

make

Testing

After installing RISC-V GCC and RISC-V QEMU, the unit tests can be executed with the following command:

make tests

Using

The compiler is expected to be used in the following format:

./sysyc [-S] INPUT [-o] [OUTPUT]

where INPUT specifies a SysY language source file and OUTPUT specifies a RISC-V assembly target file. Note that OUTPUT will default to stdout if it is omitted.