Summary
In this chapter, you learned about the typical components of a compiler. An arithmetic expression language was used to introduce you to grammar for programming languages. You then learned how to develop the typical components of a frontend for this language: a lexer, a parser, a semantic analyzer, and a code generator. The code generator only produced LLVM IR, and the LLVM static compiler, llc
, was used to create object files from it. Finally, you developed your first LLVM-based compiler!
In the next chapter, you will deepen this knowledge to construct the frontend for a programming language.