Chapter 3: The Structure of a Compiler

Compiler technology is a well-studied field of computer science. Its high-level task is to translate a source language into machine code. Typically, this task is divided into two parts: the frontend and the backend. The frontend mainly deals with the source language, while the backend is responsible for generating machine code.

In this chapter, we will cover the following topics:

  • The building blocks of a compiler, in which you will learn about the components typically found in a compiler.
  • An arithmetic expression language, which will introduce you to an example language. You will learn how grammar is used to define a language.
  • Lexical analysis, which will discuss how you implement lexers for the language. ...

Get Learn LLVM 12 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.