Skip to content

A simple SysY compiler for PKU's Compiler Principle course, implemented in Rust.

Notifications You must be signed in to change notification settings

AllenYolk/sysy-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sysy-compiler

Introduction

A SysY compiler for PKU's Compiler Principle course, implemented in Rust.

  • SysY source code -> AST: lalrpop
  • AST -> Koopa Text (an intermediate representation)
  • Koopa Text -> Koopa Program: koopa
  • Koopa Program -> RISC-V

For more information, see the report (written in Chinese 🫡).

Results

  • Offline Judgement:
    • all the tests (except performance tests) have been passed!
  • Online Judgement:
    • SysY to Koopa: 99.09 / 100
    • SysY to RISC-V: 98.64 / 100
    • Performance: 100 / 100 (598.74 sec 😋👉🤡)

Notices

  • Disclaimer: for your own benefit, please avoid directly copying and pasting the code 🙏.
  • If you find my code or idea helpful, please consider citing this repository in your lab report or code 😘.
    • ...... and star ⭐️ the repo if you like!

References

About

A simple SysY compiler for PKU's Compiler Principle course, implemented in Rust.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published