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.
-
49:25
ThisIsDeLaCruz
4 hours ago $5.80 earnedBack Stage Pass with Avenged Sevenfold
40.3K7 -
6:43:40
GritsGG
9 hours agoWorld Record Win Streak Attempt! #1 Most Wins 3880+!
20.6K2 -
3:12:05
Tundra Tactical
7 hours ago $12.45 earnedProfessional Gun Nerd Plays Battlefield 6
51.6K5 -
1:01:12
Donald Trump Jr.
9 hours agoThe China Matrix with Journalist Lee Smith | TRIGGERED Ep.288
142K86 -
11:56:00
Dr Disrespect
14 hours ago🔴LIVE - DR DISRESPECT - ARC RAIDERS - FULL SEND INTO THE RED
161K18 -
5:17:51
JdaDelete
5 hours ago $0.43 earnedFinally playing Eldin Ring | First Playthrough Episode 2
12.1K3 -
1:02:08
BonginoReport
8 hours agoNicki Minaj Speaks Out Against Christian Persecution - Nightly Scroll w/ Hayley Caronia (Ep.169)
67.6K53 -
5:23:36
HomieQuest
7 hours agoLive Streaming! Pokemon Legends Z-A
4.82K4 -
5:33:02
FusedAegisTV
10 hours agoFUSEDAEGIS PLAYS THE GREATEST JRPG EVER MADE ⌛► CHRONO TRIGGER (1995) Part 3
4.08K2 -
2:13:20
Nerdrotic
6 hours ago $3.07 earnedNerdrotic At Night 531
32.7K4