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.
-
2:05:36
Inverted World Live
11 hours agoSaint's Tomb Opened for First Time in 800 Years for Ancient Ritual | Ep. 121
102K18 -
2:43:30
TimcastIRL
9 hours agoNY AG Indicted For FRAUD, Faces 30 Years In Prison, $1 MILLION FINE | Timcast IRL
228K110 -
1:09:16
Man in America
19 hours agomRNA 2.0: This Frightening Tech Can Target Your BRAIN Using Biological Post Codes
60.3K22 -
1:28:31
The Charlie Kirk Show
8 hours agoTHOUGHTCRIME Ep. 100 — Turning Point Halftime? Potatoes and Katie Porter? Hasan the Dog Shocker?
119K61 -
6:33:19
SpartakusLIVE
10 hours agoNEW Update, NEW Meta || Zombies Mode is BACK - Smokes NURFED
70.8K5 -
13:10
Robbi On The Record
8 hours ago $9.53 earnedThe War on Christians | China’s Surveillance & Nigeria’s Killing Fields
49.5K36 -
1:24:49
Flyover Conservatives
1 day agoYour Home Just Became a Healing Room — The Truth About Red Light & Med Bed - Jonathan Otto | FOC Show
48.1K8 -
2:11:35
Mally_Mouse
4 days ago🎮 Throwback Thursday! Let's Play: Kingdom Hearts 1 pt. 2
35.5K2 -
3:00:37
Barry Cunningham
12 hours agoBREAKING NEWS: LETITIA JAMES INDICTED FOR MORTGAGE FRAUD!!! LIBTARD TEARS ARE FLOWING!
66.9K46 -
1:17:42
Glenn Greenwald
11 hours agoUS/Venezuela Escalations: Revisiting Key Developments and the Push for Regime Change | SYSTEM UPDATE SPECIAL
121K169