Learn how to build a compiler by interacting with Let's Build a Compiler by Jack Crenshaw in Swift Playgrounds
"Let's Build a Compiler" translated to Swift Playgrounds
This repo is an attempt to learn how compilers work by translating Jack W. Crenshaw's Let's Build a Compiler book into Swift Playgrounds.
The original book is divided into 16 chapters and if you haven't noticed already, there are also 16 Playground files in this repo.
Each Playground file represents a chapter in the book. However, because fitting an entire chapter into a single Playground file would be impractical, each chapter has been divided into several "Parts".
A .playground
file is actually composed of three directories.
Parts
- individual parts of a book resides inSources
- Cradle.swift
, which contains all the boilerplate code used throughout the book is contained hereResource
- the original LBaC text file tutor(n).txt
, is contained hereIf you can't seem to find these directories after opening your
.playground
file, pressβ + 0
to show the Navigator (left panel).
This is an open source project so feel free to contribute by