This article is part of the Human Resource Machine Compiler series.
Writing a parser isn’t exactly intuitive, and the process can feel, well, a bit rudimentary.
For simplicity, let's design a mini language called zoo
for this example.
This article is part of the Human Resource Machine Compiler series.
Writing a parser isn’t exactly intuitive, and the process can feel, well, a bit rudimentary.
For simplicity, let's design a mini language called zoo
for this example.
This article is part of the Human Resource Machine Compiler series.
Parsing a raw program word by word is almost impossible. You’ll quickly find yourself struggling with unpredictable and varied identifier names, and managing strings can be inefficient. This is where the concept of lexing naturally comes into play.
This article is part of the Human Resource Machine Compiler series.
Now, we need to determine what’s truly essential for this language. The game’s mechanics are fairly simple, and the processor used is quite basic. We’ll start by focusing on the early levels of the game and gradually expand our language as we progress through the later stages. The language will be effective up to level year 20, which is where I’m currently at, and it doesn’t seem to require much brain to reach this point.
This article is part of the Human Resource Machine Compiler series.
Six years ago, when I first played this level of Human Resource Machine, it struck me that the solution closely mirrors what a compiler typically does. Since then, the idea of building a compiler for Human Resource Machine has been stuck in my mind.