Creating a C Compiler From Scratch Video Course!

Daniel McCarthy

Created by

Daniel McCarthy

5.00 Star (1)

28 Hours

186 Lesson




Learn to create your very own C compiler from scratch. In this course we develop a compiler that compiles a subset of the C Programming Language. By the time you finish all modules of this course you will be able to compile C programs that use pointers, structures, unions, arrays, functions, for loops, while loops. do while loops, if statements, switches and much more!  This course includes all course modules!

Our compiler also has a preprocessor macro system allowing you to include header files and create definitions just like you would in any C file.

Your compiler is advanced enough to use the GCC standard library so we are able to call C functions from our compiler. Your compiler will be able to compile the C programming language.

This course does not rely on any frameworks we do everything from scratch to ensure the best possible learning experience for students

Module 1

In module 1 of this course we load our C source file that we wish to compile, into memory. We create a lexer to preform lexical analysis on the source input which will convert the source code into a bunch of tokens that our compiler can easily understand. We then pass the tokens through a parser to produce an abstract syntax tree. An AST describes the C program in a logical way that makes it easier for our compiler to understand. For example for the expression 50 + 20 you will end up with a root expression node that has a left operand that has a node of value 50 and a right operand that has a node of value 20. Breaking down problems in this way makes it much easier to create compilers.

Module 2

In module 2 of this course we create a code generator that produces 32 bit Intel assembly language that can then be passed through an assembler to produce a program binary that we can run. We also in this module create a resolver system which is responsible for taking a complicated expression such as "a->b.c.e[50] = 50" and breaking it down into simple steps and rules that our code generator can then easily follow. This abstraction is essential to ensure that the code generator does not become over complex. With the use of a resolver system we can ensure the code base remains clean.

Module 3

In module 3 of this course we create a preprocessor and macro system. This preprocessor system allows us to include header files in our C programs and also use a variety of macro keywords such as "#define" "#ifdef" , "sizeof" and many more. We also create a semantic validator that ensures that we have written valid C code. Examples of invalid C code would be setting variables that do not exist. Our validator will catch these errors and let the programmer know he needs to declare variable "a" before setting it.

This is the only video course in the world that shows you how to create a C compiler, come and learn today!

Please note this course is in early release. All modules have been completed however the final module, module 3 is still being processed by our editing team. We expect this module to be released and uploaded by 1st January 2023.

In the mean time you have over 28 hours of content to work with on this course.


You must have a basic experience of assembly language.

Who This Course is For

People with an interest in compiler design

People who are interested in assembly language

People who are interested in the C Programming language

What You Will be Learn

How to build a C compiler from scratch

Full understanding of stackframes and how assembly language is generared for a C source file

Complete Understanding of lexical analysis and parsing

Stronger Assembly language skills will be gained

Compiler Design

Daniel McCarthy

Dragon Zap Instructor

3.91 Star Rating

13 Courses

Dragon Zap Instructor

I am a software engineer that has been programming for 14+ years. My experience is vast and covers web development all the way to compiler and interpreter development. I have also developed bootloaders and kernels that can boot from the FAT(File Allocation Table) filesystem. I have developed two programming languages of my own. One is called Craft language. The other is called Marble which is a web language like PHP. I am currently developing a C compiler. I have experience in the following programming languages: C, C++, Java, x86 Assembly language, PHP, HTML5, JAVASCRIPT, CSS, Craft, Marble I also have programmed Linux kernel modules professionally in the workplace. These days I am focused on providing my years of expertise to students to help them grow as professional software engineers.


Course Rating






Students Feedback (1)
Sort by:




55% off

2 days and 18 hours at this price

This course includes:
  • dollar

    Full Lifetime Access

  • clock

    30 Days Money Back Guarantee

  • paper-plus

    Free Exercises File

  • airplay

    Access on PC, Mobile, Tablet and TV

  • clipboard

    Certificate of Completion

shape shape