Premium Only Content
Compiler From Scratch: Phase 1 - Tokenizer Generator 008: Code generating Context and Token
Streamed on 2024-09-06 (https://www.twitch.tv/thediscouragerofhesitancy)
Zero Dependencies Programming!
Today we generated more code to support the tokenizer we will be generating. We generated a class to handle Context. This is a simple object that keeps all the shared state and intermediate results which are in use throughout the different stages. For starters it contains our text buffer and a list of error and warning messages. This class will grow as we need more features.
We also generated the Token class that the Tokenizer will generate. This class contains all the information about where to find the token in the text buffer and a token identifier.
Then we got a start on generating the Tokenizer itself. We have stubbed in some of the simple parts, but there are two main processing methods we could go through: lazy or batch evaluation. Both have different performance implications, so we will generate both inside of ifdef checks so we can test them both.
In all this coding, we are writing out text, and large sections are just text with no modification which we could get from a separate file and not clutter our main code generation. The idea of having code snippets in an asset folder, then an asset pipeline script which embeds the code into our code would mean we could edit our snippets easier and also not count as much of that code towards our line count. We might work on this next week ... unless I get ambitious and excited about it and do it on my own before the next stream. That happens sometimes. Especially when I don't get to work on my compiler more than once a week and start to get the shakes.
-
2:06:44
Side Scrollers Podcast
3 hours agoRoblox Kids TRANS Game + Pokimane ROASTED AGAIN + More | Side Scrollers
27.5K7 -
2:05:47
The Charlie Kirk Show
2 hours agoTP Action Update + Mogadishu Minnesota + Replacing ObamaCare | Bowyer, Thorpe, Cremieux | 11.20.2025
53.7K6 -
3:08:29
Right Side Broadcasting Network
5 hours agoLIVE REPLAY: White House Press Secretary Karoline Leavitt Holds a Press Briefing - 11/20/25
49.6K9 -
1:08:05
Rebel News
2 hours agoCBSA refugee revelation, No oil tankers in BC, Notwithstanding clause debate | Rebel Roundup
16.5K2 -
DVR
TheAlecLaceShow
3 hours agoGuests: Scott Jennings, Senator Marsha Blackburn, Del Bigtree | The Alec Lace Show
10.3K6 -
1:01:04
The Rubin Report
4 hours agoThe Exact Moment CNN Host Realizes Jasmine Crockett Is a Monster
38K75 -
LIVE
LFA TV
17 hours agoLIVE & BREAKING NEWS! | THURSDAY 11/20/25
1,928 watching -
1:02:09
VINCE
5 hours agoThe Process Is The Punishment | Episode 173 - 11/20/25 VINCE
225K198 -
48:46
Athlete & Artist Show
3 hours ago $0.67 earnedBOMBASTIC Sports & Table Cames
15.9K -
1:50:29
The Mel K Show
3 hours agoMORNINGS WITH MEL K - The Battle for your Brain: Psychological Warfare on Full Throttle- 11-19-25
20.6K16