Developing A C Compiler From Scratch - Module 2
Published 7/2025
MP4 | Video: h264, 1920x1080 | Audio: AAC, 44.1 KHz
Language: English | Size: 8.48 GB | Duration: 10h 18m
Published 7/2025
MP4 | Video: h264, 1920x1080 | Audio: AAC, 44.1 KHz
Language: English | Size: 8.48 GB | Duration: 10h 18m
Compiler Design, Compiler Development, Lexical Analysis, Parsing, Code Generation, Abstract Syntax Trees
What you'll learn
How to build a C compiler from scratch
Simple assembly language skills
How to build a code generator
How to traverse through complicated expressions with the resolver system
Requirements
Basic C programming experience
Description
Are you ready to learn compiler design and compiler development and prove your a master programmer?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!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 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.Throughout the whole course series you will learn to create a fully functioning C compiler.
Overview
Section 1: Introduction
Lecture 1 Introduction
Lecture 2 What now?
Section 2: The Code Generator Basics
Lecture 3 The Code Generator
Lecture 4 Building the fundementals
Lecture 5 Beginning the iteration of the AST
Lecture 6 Generating global variables
Lecture 7 Understanding the label systems
Lecture 8 Building the label system
Lecture 9 Dealing with strings in the code generator
Lecture 10 Building our string registration system
Lecture 11 Implementing numerical values for global variables
Lecture 12 Implementing string values for global variables
Lecture 13 Fixing issue parsing strings
Lecture 14 Stackframes
Lecture 15 Building our stack frame functionality
Section 3: The Code Generator, Building a resolver
Lecture 16 The resolver explained
Lecture 17 Creating the resolver - Part 1
Lecture 18 Creating the resolver - Part 2
Lecture 19 Creating the resolver - Part 3
Lecture 20 How array offsets are calculated
Lecture 21 Creating the resolver - Part 4
Lecture 22 Creating the resolver - Part 5
Lecture 23 Calculating structure and union offsets
Lecture 24 Implementing the struct_offset function
Lecture 25 Creating the resolver - Part 6
Lecture 26 Creating the resolver - Part 7
Lecture 27 Creating the resolver - Part 8
Lecture 28 Creating the resolver - Part 9
Lecture 29 Creating the resolver - Part 10
Lecture 30 Implementing unaries
Lecture 31 Creating the resolver - Part 11
Lecture 32 Creating the resolver - Part 12
Lecture 33 Creating the resolver - Part 13
Lecture 34 Creating the resolver - Part 14
Lecture 35 Creating the resolver - Part 15
Lecture 36 Creating the resolver - Default handler
Section 4: The Code Generator Continued
Lecture 37 Starting to implement function code generation
Lecture 38 Implementing the foundations of scope variables
Lecture 39 Fixing the parser_scope_offset_for_stack function
Lecture 40 Assigning Variables
Lecture 41 Code generator response system
Lecture 42 Implementing the code generator response system and expressions
Lecture 43 Running our first program
Section 5: Bonus Section
Lecture 44 Bonus Lecture
Compiler Engineers,Students interested in learning compiler development,Students interested in learning about parsing and code generation