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.
-
8:41
Zoufry
1 day agoInside The Cartels Training Camps for Assassins
16.2K1 -
12:37
itsSeanDaniel
1 day agoFake Republican REFUSES to Stand Up for Charlie Kirk
12.1K35 -
1:01:55
MTNTOUGH Podcast w/ Dustin Diefenderfer
22 hours agoJason Khalipa: American Men: Get Off the Couch and Rise Up Now | MTNPOD #133
32.2K45 -
5:17
Blackstone Griddles
13 hours agoEasy Weeknight Meals: Creamy Parmesan Beef Pasta
20.2K6 -
7:08
Rena Malik, M.D.
23 hours ago $1.45 earnedFour totally surprising causes of Back Pain
10.7K1 -
6:27
DropItLikeItsScott
15 hours ago $1.17 earnedIs This the Coolest Gun Accessory Ever? The Gun Guardian
12.2K -
19:05
Michael Feyrer Jr
1 day agoCan you even fit this much FAIL in one video? $10K Challenge Week 1
9.87K -
19:53
Professor Nez
17 hours agoYou WON’T BELIEVE What I Found on Charlie Kirk’s Shooter!
15.1K27 -
1:35:53
The China Show
18 hours ago $1.43 earnedBrutal Mayhem in China as Dark Coverups are Exposed - #280
19.6K8 -
12:30:34
Times Now World
1 day agoLIVE | Russia-Belarus Zapad-2025 LIVE | Missiles Target NATO in Arctic & Baltic
28.2K3