Template for Cargo based SysY compiler projects.

Overview

基于 Cargo 的 SysY 编译器项目模板

该仓库中存放了一个基于 Cargo 的 SysY 编译器项目的模板, 你可以在该模板的基础上进行进一步的开发.

该仓库中的 Rust 代码实现仅作为演示, 不代表你的编译器必须以此方式实现. 如你需要使用该模板, 建议你删掉所有 Rust 源文件, 仅保留 Cargo.toml 和必要的目录结构, 然后重新开始实现.

事实上, 基于 Cargo 的编译器项目并不需要模板. 不过为了保持和 sysy-make-template 以及 sysy-cmake-template 的一致性, 此处还是开放一个模板项目吧.

你只需要使用如下命令:

cargo init --bin

即可在任意目录初始化一个基于 Cargo 的 Rust 项目, 该项目无需进行任何额外的修改, 即可被评测平台正确编译.

使用方法

注意: 通常情况下, 建议你不要使用本模板, 而直接使用 cargo init 初始化 Cargo 项目.

首先 clone 本仓库:

git clone https://github.com/pku-minic/sysy-cmake-template.git

进入仓库目录后执行:

cargo run -- -S -e input.c -o output.eeyore

Cargo 将自动构建并运行该项目.

如在此基础上进行开发, 你需要重新初始化 Git 仓库:

rm -rf .git
git init

然后将自己的编译器的源文件放入 src 目录.

评测平台要求

当你提交一个根目录包含 Cargo.toml 文件的仓库时, 评测平台会使用如下命令编译你的编译器:

cargo build --manifest-path "Cargo.toml的路径" --release

默认情况下, 你无需进行任何更改, 只需要确保项目的 manifest 文件名为 Cargo.toml 即可.

You might also like...
MiniJinja is a powerful but minimal dependency template engine for Rust
MiniJinja is a powerful but minimal dependency template engine for Rust

MiniJinja: a powerful template engine for Rust with minimal dependencies MiniJinja is a powerful but minimal dependency template engine for Rust which

finch - a super fast and efficient template rendering engine for node.js

finch A super fast and efficient template rendering engine for node.js, inspired by Handlebars. Usage Finch is very simple to use: Register a template

A "Hello, world!" template of a Rust binary crate for the ESP-IDF framework.

Rust on ESP-IDF "Hello, World" template A "Hello, world!" template of a Rust binary crate for the ESP-IDF framework. This is the crate you get when ru

Balsa is a delightfully simple HTML template engine

🌳 balsa Balsa is a delightfully simple HTML template engine. It is designed to be used in user interfaces such as a CMS where a user needs to be able

Bevy GitHub CI Template

Bevy GitHub CI Template This repo show how to setup CI on a github project for Bevy. It creates two workflows: CI Release CI Definition: .github/workf

This is a template repo for eframe, a framework for writing apps using egui.

eframe template This is a template repo for eframe, a framework for writing apps using egui. The goal is for this to be the simplest way to get starte

A template for creating services in Rust using Axum and Prisma.

A template for creating services in Rust using Axum and Prisma. This uses the super cool Prisma Rust Client.

✨ A perfect template for a binary rust project.

Rust Template A project template for Rust, helping to structure your projects blazingly fast ⚡ . Features 🔥 Code-ready for binary projects. Add amazi

A macro-based html builder for rust

Horrorshow A macro-based html templating library, compatible with stable rust (currently requires rust = 1.37). Features This crate will degrade grac

Owner
PKU Compiler Course
Learn the compiler step by step.
PKU Compiler Course
Templates for creating rust projects with a GitHub-managed lifecycle with cargo-generate 🏗️📃

rust-templates Templates for creating rust projects with a GitHub-managed lifecycle with cargo-generate. ??️ ?? What you get: PR build validation usin

Ben Greenier 1 Oct 30, 2021
A template engine for Rust based on Jinja2/Django

Tera Tera is a template engine inspired by Jinja2 and the Django template language. <title>{% block title %}{% endblock title %}</title> <ul> {% for u

Vincent Prouillet 2.5k Jan 1, 2023
Quickly create boilerplate projects and templates.

boyl boyl is a command-line tool written in Rust to manage template folders. boyl can copy existing folders (with support for glob-like ignore pattern

Miguel M. 13 Feb 16, 2022
Hatch new projects like a chick coming out of its egg

?? Cargo Hatch Hatch new projects like a chick coming out of its egg. Cargo hatch is a cargo init/cargo new on steroids, allowing complex templates th

Dominik Nakamura 6 Nov 2, 2022
Yarte stands for Yet Another Rust Template Engine

Should we start to worry? bytes-buf feature can produce SIGILL. avx and sse flags are in almost all cpus of x86 and x86_64 architectures. More details

Juan Aguilar 249 Dec 19, 2022
A flexible template engine for Rust

Rustache Rustache is a Rust implementation of the Mustache spec. Documentation The different Mustache tags are documented at the mustache(5) man page.

rustache 208 May 10, 2022
A nice template for NEAR repos

Template for a NEAR project If you're looking for a no-std version of this template, go here. Contains: a setup script Cargo.toml setup with simulatio

Thor 12 Dec 28, 2021
A minimalist Rust WebAssembly project template

MiniWASM - A minimalist Rust WebAssembly project template This is a minimal Rust-powered WebAssembly application template. It was designed to showcase

Emil Loer 160 Jul 26, 2022
A template for a Rust-powered static-page Try Online interface

rust-tio-template A template for a Rust-powered static-page Try Online interface What is included This is an example setup that enables all of the fol

null 2 Dec 13, 2021
Yew Tauri Desktop App Template

Yew Tauri Desktop App Template This is Template App for Desktop App. Run Develop $ cargo tauri dev Build App $ cargo tauri build Setup yew setup Using

usa 16 Oct 16, 2022