Tristano Ajmone's personal notes and exercises for the Creating a C Compiler From Scratch video-course by Daniel McCarthy, along with the lessons source code material.
Table of Contents
Creating a C Compiler From Scratch is a commercial video-course on how to hand-code a C compiler in C, without resorting to third party lexer/parser generator tools like Yacc, Bison, etc.
The course is available at the Dragon Zap and Udemy online stores, as a single product at the former, and as three separate modules at the latter.
NOTE — at the time of this writing, only the first of the three modules has been released. Modules 2 and 3 are currently undergoing final editing, and should become available soon.
At Udemy store, course assets are provided as links to specific commits at the PeachCompiler repository, from which the reader can download the source files, with occasional in-video instructions to fetch specific files from the DragonCompiler repository — a rather cumbersome solution, compared to having access to Zip archives with lesson-specific ready files, or a dedicated repository for the course assets.
While studying the course, I decided to gather the required material in an orderly fashion, organized into subfolders according to lesson. Since both the PeachCompiler and DragonCompiler repositories are GPLv2 licensed, I thought I might just as well share the material for the benefit of other students.
Besides saving end users the time of manually fetching each lesson files from specific commit checkouts, the files in this project often contain bug fixes that were introduced in later commits, for which I've manually overwritten the original files with their fixed versions, or other fixes that surfaced during students' Q&A.
I also took the liberty to fix some obvious typos in source comments and strings.
This being first and foremost my personal study project, I'm including my own course notes and reference links within the project, for my own benefit, and often tweak the original comments in the source files, or even add new ones, as a means to annotate my learning process.
If these extra annotations turn out to be useful to others, that's an added value. Just beware at all times that this repository is a personal project, and that the assets herein contained often contain various changes compared to the original course material.
Whereas the online course explicitly targets Ubuntu, all the code within this repository is tested under MS Windows 10 Home, using MinGW as the compiler suite. So far the project didn't require any fixes to run under MS Windows, but if the need arises I'll adapt the assets to ensure they work under Windows, at the expenses of other platforms.
All the C source assets in this project were taken from the PeachCompiler and DragonCompiler repositories, both created by Daniel McCarthy and released under GPLv2 license:
LICENSE
— GPLv2 License.