Premium Only Content

Compiler From Scratch: Phase 1 - Tokenizer Generator 021: Using tokenizer in the tokenizer generator
Streamed on 2024-12-06 (https://www.twitch.tv/thediscouragerofhesitancy)
Zero Dependencies Programming!
The tokenizer generator has to parse two files (so far): the project file and the tokenizer definition file. If we can generate a tokenizer, why not use that to parse those files? There's no reason not to so I started that task today. There is a bit of back and forth as you update your file parsing and the supported tokens and keeping them in sync enough to continue to build and run while making the switch.
Things were going reasonably smoothly until I ran into a bug. I thought it was a bug that I had been anticipating for quite a while, but it turned out to be something else. I anticipated it being an ordering problem, but instead it looks like our DFA isn't quite formed correctly. There are states that should be merged, like if two keywords start with the same letter. Also, there are states that should have reasonable fallbacks if they don't complete (or if they continue after the expected end) as in the case of a KEYWORD being a subset of an identifier. If the KEYWORD doesn't match exactly, it can and should still skip over into the identifier track. But that isn't happening right now.
I started looking into this bug, but didn't have time to finish it. Today's stream was a bit short and the code of interest is stuff I haven't looked at in quite a long time, so there was quite a bit of time spent trying to remember how it works and reason about what the fix should be. We'll finish debugging this next week.
-
1:05:13
Russell Brand
2 hours agoReporting From Tommy Robinson’s ‘Unite the Kingdom’ March - SF634
65.3K33 -
5:56
Buddy Brown
2 hours agoThis is Why Everyone's Googling September 23rd! | Buddy Brown
2.17K10 -
LIVE
Human Events Daily with Jack Posobiec
49 minutes agoHUMAN EVENTS DAILY WITH JACK POSOBIEC
1,246 watching -
2:03:13
The Charlie Kirk Show
3 hours agoMichael Knowles, Matt Walsh, and Ben Shapiro Remember Charlie Kirk | 9.16.2025
383K313 -
2:11:49
Steven Crowder
5 hours agoThe Lies are Sick: Charlie Kirk's Legacy Separating Fact from Fiction
487K377 -
1:22:10
Sean Unpaved
2 hours agoMNF Mayhem: Bucs' Stunner, Brady's Booth Drama, Shedeur's Draft Doge & the Masters on Prime
21.9K1 -
1:07:59
NotTheBee
1 day agoOur Memories Of Charlie Kirk And What This Means For The Country
73.5K26 -
19:40
Clickbait Wasteland
15 hours ago $0.23 earnedAsking New Yorkers Who They Support For Mayor: The Bronx
4.93K3 -
LIVE
TheAlecLaceShow
1 hour agoCharlie Kirk Assassin's Discord Confession EXPOSED! Dems' Reaction | Jim Pfaff on The Alec Lace Show
137 watching -
1:19:51
The Rubin Report
4 hours agoListen to the Fear in Whoopi Goldberg’s Voice on 'The View' as She Gives a Chilling Warning
79.7K99