Book Image

LLVM Cookbook

Book Image

LLVM Cookbook

Overview of this book

Table of Contents (16 chapters)
LLVM Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 2. Steps in Writing a Frontend

In this chapter, we will cover the following recipes:

  • Defining a TOY language

  • Implementing a lexer

  • Defining Abstract Syntax Tree

  • Implementing a parser

  • Parsing simple expressions

  • Parsing binary expressions

  • Invoking a driver for parsing

  • Running lexer and parser on our TOY language

  • Defining IR code generation methods for each AST class

  • Generating IR code for expressions

  • Generating IR code for functions

  • Adding IR optimization support