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.
-
37:06
Camhigby
1 hour agoI Was Stalked By DRONE At Dearborn MOSQUE
5.4K9 -
LIVE
SavageJayGatsby
3 hours ago🔥 Spicy Saturday – Let's Play: Human Fall Flat🔥
64 watching -
12:38
Timcast
22 hours agoJasmine Crocket HUMILIATED By CNN To HER FACE Over Epstein LIE | Tim Pool
85.5K64 -
19:32
MetatronHistory
19 hours agoWas Nazism Left Wing or Right Wing? An Answer From History
9.9K22 -
LIVE
a12cat34dog
3 hours agoI'M FINALLY BACK :: Resident Evil 4 (2023) :: FINISHING MAIN GAME & DLC {18+}
205 watching -
31:23
Stephen Gardner
3 hours agoFINALLY! Charlie Kirk MISSING DETAILS released!
17.7K110 -
5:26:11
cosmicvandenim
8 hours agoCOSMIC VAN DENIM | SEX APPEAL & HORROR
12.5K10 -
LIVE
DoldrumDan
3 hours agoFINISHING SEKIRO - DEPTH 5 TOP RANKED - DAY 50 NEW LIFE
37 watching -
23:40
MYLUNCHBREAK CHANNEL PAGE
1 day agoWe Want the Blueprints
60.8K17 -
LIVE
PenguinSteve
5 hours agoLIVE! Penguin to the Battlefield (6)
63 watching