This repository is an implementation of the Decaf programming language, created as part of MIT's 6.035 (Computer Language Engineering) course. The Decaf language and course materials can be found at the 6.035 course website.
Decaf is a simplified Java-like language designed for educational purposes. This project represents a Rust-based implementation of the Decaf language, including its parser, semantic analysis, and code generation components.
- Lexical analysis (tokenization)
- Parsing of Decaf source code
- Semantic analysis (type checking, symbol tables, etc.)
- Intermediate representation and code generation
- Rust toolchain (latest stable recommended). Install via rustup.
Clone the repository and build with Cargo:
git clone https://github.com/m04f/rust-decaf.git
cd rust-decaf
cargo buildYou can run the Decaf compiler with:
cargo run -- decafccsrc/- Rust source code for the Decaf implementationtests/- Test cases for language features- Other files and directories follow standard Rust project layout
- MIT 6.035: Computer Language Engineering
- Decaf Language Specification
If you are interested in a more refined or alternative implementation, see the rewrite at decafc.