A tiny source code example
Let’s start with the a very simple source code fragment that will be fed to the interpreter/compiler.
int result = (12 + 56) / 3 * 2;
Lexing
The first step is lexing or lexical analysis. Also called scanning.
The easiest way to learn the basics of creating a programming language is examining the necessary steps to transform
the source code into executable code. In this post, I’m going to introduce these steps, and I will explain them in
detail in future posts. I will also implement these concepts in C.
Why, really?
Before we start, let’s try to answer the question: What possible benefit could I gain by doing this?