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:44:33
The Quartering
2 hours agoTrump Calls For Hangings, McDonalds SNAP Controversy, The Demonic Relationship In Wicked & More
99.2K40 -
21:40
Bitcoin Policy Institute
4 hours agoCongressman Warren Davidson Unveils the “Bitcoin for America Act” | Spotlight Series #1
12 -
1:25:51
DeVory Darkins
3 hours agoDemocrats caught in corruption scheme as JD Vance issues MAJOR UPDATE
113K54 -
1:48:48
MattMorseTV
4 hours ago $28.34 earned🔴Sedition Charges INBOUND.🔴WH Press Conference.🔴
36.9K107 -
9:06
Jamesons Travels
19 hours ago $1.89 earnedMilitary Veterans in Congress Tell Troops to Refuse Trump's Orders
6.67K28 -
LIVE
The Bold Lib
1 hour agoBOLDCHAT: Unemployment | AI | Birth Rates w/ANGELA BELCAMINO
56 watching -
20:34
ArynneWexler
6 hours agoNew Poll: Women Are Done With America | NN8
3.75K15 -
59:30
The White House
4 hours agoPress Secretary Karoline Leavitt Briefs Members of the Media, Nov. 20, 2025
38.2K27 -
2:06:37
Steven Crowder
6 hours agoJasmine Crockett's Epstein Idiocy & the Absolute State of the Democrat Party
513K342 -
33:37
The Boomer Effect
17 hours agoBeyond Convenience: The Tyranny Behind Digital IDs
8.22K1