Skip to content

A toy compiler for the decaf language written in Rust.

Notifications You must be signed in to change notification settings

baocvcv/decaf-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is the course project for Principles of Compilers.

A compiler for the decaf language is developed in Rust.

Project Guide

decaf-doc

Build & Run

You need a nightly rust compiler. It is tested on rustc 1.38.0-nightly, there is no guarantee about any older version (I believe that a newer version won't break the code).

Run:

cargo run --bin test # for testing your implemetation using the testcase folder
# or
cargo run --bin decaf # for a command line app

The command line app (with name decaf) support the following arguments:

<input> # required, the input decaf file path
--target=<target> # required, <target> can be pa1a, pa1b, pa2, pa3, pa4, pa5
--output=<output> # optional, the output path; if not specified, it prints to stdout

About

A toy compiler for the decaf language written in Rust.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published