Premium Only Content
Compiler From Scratch: Phase 1 - Tokenizer Generator 010: Dispatching DFAStates with switch/case
Streamed on 2024-09-20 (https://www.twitch.tv/thediscouragerofhesitancy)
Zero Dependencies Programming!
Work on the Tokenizer Generator continues. I plan to implement it with several different processing options so we can compare the performance implications, which leads to the permutations of code to generate a bit unwieldy. There are 96 permutations for the Tokenizer Generator right now. To narrow the scope for the days work we settled on the following three options to get the process working end-to-end in one way. I set the defines in my Makefile for using a C++ style iterator to get each character, to process all the tokens in a single batch, and to dispatch DFAStates with a switch/case statement.
With that scope set for the day I got to work. It didn't take long to dispatch the DFAStates, and there was a bit of work to initialize the tokenization process correctly. Instead of generating the tokens when accepting a token, I just logged the information the tokens would need. This worked pretty well and showed that the flow was working as expected.
Then it was time to actually generate the tokens themselves. I decided to just put the list of Tokens in the Context and not keep them in the Tokenizer. This shouldn't have been too hard, but we ended the day with a crash that I wasn't able to pin down before the end of the stream. The debugger was useless as it wasn't breaking on the lines specified and wouldn't do anything with the stackdump. I am sorely tempted to debug it this weekend off-stream. We'll see.
-
1:25:01
Misfits Mania
1 day ago $5.52 earnedMISFITS MANIA: Press Conference
12K6 -
DVR
Graham Allen
1 hour agoLive From AMFEST 2025: Day 1
12.5K2 -
LIVE
Sean Unpaved
34 minutes agoSeahawks Looking For REVENGE Against Rams! | UNPAVED
83 watching -
1:56:43
Steven Crowder
4 hours agoLWC Christmas Special 2025 | Giving Back with Santa Crowder
200K56 -
14:33
Robbi On The Record
3 hours ago $1.97 earnedNPC Girls & The Digital Dehumanization of Women
12.6K7 -
53:25
Simply Bitcoin
1 day ago $0.64 earnedThe Bitcoin Crucible w/ Alex Stanczyk & Tomer Strolight - Episode 13
15K1 -
59:21
The Rubin Report
2 hours agoIs This the Real Reason Bongino Is Leaving the FBI?
28.8K40 -
LIVE
LFA TV
14 hours agoLIVE & BREAKING NEWS! | THURSDAY 12/18/25
3,372 watching -
LIVE
The Mel K Show
1 hour agoMORNINGS WITH MEL K- America is Mad As Hell And We’re Not Going to Take it Anymore! - 12-18-25
921 watching -
LIVE
The Shannon Joy Show
2 hours ago🔥SJ LIVE Dec 18 - Exclusive With Peter Schiff On Trumpflation, The Affordability Crisis, AI Bubbles & Bitcoin Collapse. Will Metals Become The Global Hedge Against Financial Chaos?🔥
152 watching