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.
-
Kim Iversen
1 hour agoTrump To Pardon Ghislaine Maxwell? | They Mocked It as a Horse Drug — Now It Could Cure Cancer
3.37K12 -
29:08
Michael Franzese
1 hour agoEx-Mobster REVEALS the 15 Deadliest Killers in Organized Crime
791 -
22:07
Jasmin Laine
3 hours agoRoom ERUPTS as Trump INTERRUPTS Carney—HUMILIATES Him in Front of Reporters
43611 -
LIVE
Wayne Allyn Root | WAR Zone
7 hours agoWatch LIVE: The War Zone Podcast with Wayne Allyn Root
48 watching -
9:23
Red Pill MMA
10 hours agoCharlie Kirk Turned on Israel—Candace Has the Receipts!
1062 -
1:55:29
Redacted News
2 hours agoCharlie Kirk's Text Messages CONFIRMED ACCURATE by TPUSA, Days Before Assassination | Redacted News
99.2K82 -
1:02:11
DeVory Darkins
1 hour ago $3.58 earnedDemocrats suffers ANNIHILATION during heated hearing with Bondi as Jack Smith bombshell drops
6.99K25 -
40:59
Dad Saves America
23 hours ago $0.66 earnedThe Radical Left’s True Romance: Revolution & Chaos
4.95K8 -
1:07:42
vivafrei
5 hours agoJack Smith SPIED on GOP Lawmakers? Ottawa Trucker Protest Organizers SENTENCED! & MORE!
105K46 -
LIVE
LFA TV
20 hours agoLIVE & BREAKING NEWS! | TUESDAY 10/7/25
985 watching