Skip to content

F23 PKU course “Compiler Principles” lab solutions.

Notifications You must be signed in to change notification settings

CS-icez/SysY-Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

关于本仓库

本仓库存放北京大学 2023 秋"编译原理"课程中 SysY 编译器的个人实现代码.

常用命令

创建容器, 开启标准输入和终端, 挂载工作目录, 运行bash, 退出后删除容器:

docker run -it --rm -v `pwd`:/root/compiler maxxing/compiler-dev bash

运行测试 (以测试 lv1 的 RISC-V 为例):

autotest -w /root/compiler/autotest -riscv -s lv1 /root/compiler

不运行 bash 而直接运行测试:

docker run -it --rm -v `pwd`:/root/compiler maxxing/compiler-dev \
  autotest -riscv -s lv1 /root/compiler

生成 AST:

cargo run -- -ast temp/hello.c -o temp/hello.ast

生成 Koopa 文本:

cargo run -- -koopa temp/hello.c -o temp/hello.koopa

生成 RISC-V 汇编:

cargo run -- -riscv temp/hello.c -o temp/hello.s

About

F23 PKU course “Compiler Principles” lab solutions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages