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.
-
LIVE
2 MIKES LIVE
9 hours ago2 MIKES LIVE #170 with special guest Rep. Buddy Carter (R-GA)
580 watching -
7:09:22
Dr Disrespect
9 hours ago🔴LIVE - DR DISRESPECT - TRIPLE THREAT CHALLENGE - EXTREME EDITION
195K22 -
55:00
LFA TV
9 hours agoThe End of the January 6 Hoax | TRUMPET DAILY 1.22.25 7pm
20.2K2 -
1:13:37
Battleground with Sean Parnell
6 hours agoPresident Trump Is On FIRE w/ Savage Rich Baris
163K18 -
1:59:59
Melonie Mac
3 hours agoGo Boom Live Ep 34!
34.4K5 -
49:27
Sarah Westall
2 hours agoTrillion Dollar 5G Lawsuit, Project Archimedes, Mind Control & DEW Weapons w/Attorney Todd Callender
48.8K9 -
53:11
Standpoint with Gabe Groisman
1 day agoTrump Is Crucial For Hostage Agreement Says Israeli Colonel
35.2K4 -
1:01:22
Anthony Pompliano
1 day ago $0.88 earnedTrump Inauguration Sends Bitcoin Flying
26.1K2 -
15:21
LFA TV
9 hours agoWHY GOLD WILL CONTINUE TO SKYROCKET
18.4K2 -
1:31:40
MTNTOUGH Fitness Lab
3 hours agoThe Power of Brotherhood: How Vulnerability and Grit Shape Resilient Men with Thosh Collins
29.9K1