Skip to content
A Compiler Writing Journey
C C++ Shell Makefile
Branch: master
Clone or download
Warren Toomey
Latest commit 1195968 Jan 28, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
00_Introduction Update Readme to mention books Jan 8, 2020
01_Scanner Enable highlighting. Jan 10, 2020
02_Parser Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
03_Precedence Refactor some loop code. Jan 17, 2020
04_Assembly Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
05_Statements Add details of changed expression parser in part 5. Jan 28, 2020
06_Variables Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
07_Comparisons Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
08_If_Statements Update Readme.md Jan 21, 2020
09_While_Loops Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
10_For_Loops Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
11_Functions_pt1 Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
12_Types_pt1 Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
13_Functions_pt2 Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
14_ARM_Platform Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
15_Pointers_pt1 Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
16_Global_Vars
17_Scaling_Offsets Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
18_Lvalues_Revisited Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
19_Arrays_pt1 Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
20_Char_Str_Literals Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
21_More_Operators Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
22_Design_Locals Enable highlighting. Jan 10, 2020
23_Local_Variables Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
24_Function_Params Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
25_Function_Arguments Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
26_Prototypes Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
27_Testing_Errors Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
28_Runtime_Flags Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
29_Refactoring Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
30_Design_Composites
31_Struct_Declarations Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
32_Struct_Access_pt1 Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
33_Unions Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
34_Enums_and_Typedefs Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
35_Preprocessor Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
36_Break_Continue Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
37_Switch Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
38_Dangling_Else Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
39_Var_Initialisation_pt1 Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
40_Var_Initialisation_pt2 Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
41_Local_Var_Init Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
42_Casting Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
43_More_Operators Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
44_Fold_Optimisation Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
45_Globals_Again Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
46_Void_Functions Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
47_Sizeof Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
48_Static Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
49_Ternary Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
50_Mop_up_pt1 Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
51_Arrays_pt2 Merge branch 'master' of https://github.com/DoctorWkt/acwj Jan 12, 2020
52_Pointers_pt2 Enable highlighting. Jan 10, 2020
53_Mop_up_pt2 Enable highlighting. Jan 10, 2020
54_Reg_Spills Enable highlighting. Jan 10, 2020
55_Lazy_Evaluation Enable highlighting. Jan 10, 2020
56_Local_Arrays Enable highlighting. Jan 10, 2020
57_Mop_up_pt3 Enable highlighting. Jan 10, 2020
58_Ptr_Increments Enable highlighting. Jan 10, 2020
59_WDIW_pt1 Enable highlighting. Jan 10, 2020
60_TripleTest Enable highlighting. Jan 10, 2020
61_What_Next Mention shorts and unsigned as possible future work. Dec 10, 2019
62_Cleanup Enable highlighting. Jan 10, 2020
LICENSE Initial commit Oct 18, 2019
Readme.md Did a bit of code cleanup. Dec 12, 2019

Readme.md

A Compiler Writing Journey

In this Github repository, I'm documenting my journey to write a self-compiling compiler for a subset of the C language. I'm also writing out the details so that, if you want to follow along, there will be an explanation of what I did, why, and with some references back to the theory of compilers.

But not too much theory, I want this to be a practical journey.

Here are the steps I've taken so far:

There isn't a schedule or timeline for the future parts, so just keep checking back here to see if I've written any more.

Copyrights

I have borrowed some of the code, and lots of ideas, from the SubC compiler written by Nils M Holm. His code is in the public domain. I think that my code is substantially different enough that I can apply a different license to my code.

Unless otherwise noted,

  • all source code and scripts are (c) Warren Toomey under the GPL3 license.
  • all non-source code documents (e.g. English documents, image files) are (c) Warren Toomey under the Creative Commons BY-NC-SA 4.0 license.
You can’t perform that action at this time.