Premium Only Content

Compiler From Scratch: Phase 1 - Tokenizer Generator 008: Code generating Context and Token
Streamed on 2024-09-06 (https://www.twitch.tv/thediscouragerofhesitancy)
Zero Dependencies Programming!
Today we generated more code to support the tokenizer we will be generating. We generated a class to handle Context. This is a simple object that keeps all the shared state and intermediate results which are in use throughout the different stages. For starters it contains our text buffer and a list of error and warning messages. This class will grow as we need more features.
We also generated the Token class that the Tokenizer will generate. This class contains all the information about where to find the token in the text buffer and a token identifier.
Then we got a start on generating the Tokenizer itself. We have stubbed in some of the simple parts, but there are two main processing methods we could go through: lazy or batch evaluation. Both have different performance implications, so we will generate both inside of ifdef checks so we can test them both.
In all this coding, we are writing out text, and large sections are just text with no modification which we could get from a separate file and not clutter our main code generation. The idea of having code snippets in an asset folder, then an asset pipeline script which embeds the code into our code would mean we could edit our snippets easier and also not count as much of that code towards our line count. We might work on this next week ... unless I get ambitious and excited about it and do it on my own before the next stream. That happens sometimes. Especially when I don't get to work on my compiler more than once a week and start to get the shakes.
-
26:57
Robbi On The Record
2 days agoMouth Breathing Is Why You’re Exhausted | with Dr. Melanie Silvestrini
28.3K5 -
LIVE
Total Horse Channel
7 hours ago2025 Reno Snaffle Bit Futurity | Sunday Finals
114 watching -
40:44
SouthernbelleReacts
7 days ago $3.49 earned“Event Horizon (1997) Reaction | Hellraiser in Space with Sam Neill & Laurence Fishburne”
37K4 -
10:49
Artur Stone Garage
3 days ago $2.50 earnedI Spent $2000 on My Turbo Honda Civic Build (Before & After)
37.7K10 -
0:44
Danny Rayes
19 hours ago $3.89 earnedDid Someone Know It Was Going To Happen?
37.3K11 -
15:03
World2Briggs
1 day ago $3.18 earnedShocking Home Prices in Florida's Cheapest Towns!
32K8 -
58:02
ChopstickTravel
4 days ago $1.30 earnedBillionaire Food in Dubai 🇦🇪 Super Luxury MICHELIN +WAGYU + CAVIAR in UAE!
22.9K1 -
21:20
Advanced Level Diagnostics
12 days ago $1.19 earned2020 Toyota Sienna - Crank No Start! Never Seen This Before!
25.1K2 -
49:04
The Why Files
6 days agoMajestic 12 | Secret Documents Expose UFO Cover-Up Vol. 1
60.6K72 -
12:29
The Quartering
23 hours agoFBI Admits ACCOMPLICE In Charlie Kirk Assassination! Ring Doorbell Camera Footage & Phone Calls!
150K485