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.
-
58:40
Donald Trump Jr.
3 hours agoCan California be Golden Again? Interview with Gubernatorial Candidate Steve Hilton | TRIGGERED Ep.293
71.5K56 -
LIVE
AirCondaTv Gaming
5 hours ago $0.14 earnedBattlefield 6: Burn Baby Burn. Like a Raging Inferno
65 watching -
1:06:20
BonginoReport
3 hours agoTrump, Vance “SNUBBED” by Never-Trumper Cheneys - Nightly Scroll w/ Hayley Caronia (Ep.182)
40.7K16 -
3:35:57
SlantRock
3 hours agoBATTLEFIELD REDSEC/ MAYBE ARC RAIDERS AFTER
600 -
LIVE
Astral Doge Plays!
1 hour agoHyrule Warriors: Age of Imprisonment ~LIVE!~ Ganondorf Is a Jerk
76 watching -
1:25:13
Kim Iversen
3 hours agoMKUltra Victims Are SUING — The CIA's Darkest Secret EXPOSED
88.9K44 -
LIVE
GritsGG
5 hours ago#1 Most Warzone Wins 4015+!
85 watching -
16:30
Stephen Gardner
3 hours ago🚨OVAL OFFICE EXPOSES TRUMP TAKEOVER – FILIBUSTER NUKED!
17.5K23 -
LIVE
The Rabble Wrangler
16 hours agoThe Best in the West Dominates Battlefield
33 watching -
LIVE
cosmicvandenim
3 hours agoCOSMIC VAN DENIM
56 watching