January 2024
Beginner to intermediate
416 pages
9h 46m
English
As we learned in the previous chapter, a compiler is typically divided into two parts – the frontend and the backend. In this chapter, we will implement the frontend of a programming language – that is, the part that mainly deals with the source language. We will learn about the techniques that real-world compilers use and apply them to our programming languages.
Our journey will begin with us defining our programming language’s grammar and end with an abstract syntax tree (AST), which will become the base for code generation. You can use this approach for every programming language for which you would like to implement a compiler.
In this chapter, you will learn about the following:
Read now
Unlock full access