This is a project for the course Compiler Principles. It can translate a SysY language source file to a RISC-V32IM assembly target file.
After installing essential build tools, the compiler can be built with the following command:
make
After installing RISC-V GCC and RISC-V QEMU, the unit tests can be executed with the following command:
make tests
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.