Building blocks of a compiler
After computers became available in the middle of the last century, it quickly became apparent that a more abstract language than assembler would be useful for programming. As early as 1957, Fortran was the first available higher programming language. Since then, thousands of programming languages have been developed. It turns out that all compilers must solve the same tasks and that the implementation of a compiler is best structured according to these tasks.
At the highest level, a compiler consists of two parts: the frontend and the backend. The frontend is responsible for language-specific tasks. It reads a source file and computes a semantic analyzed representation of it, usually an annotated abstract syntax tree (AST). The backend creates optimized machine code from the frontend's result. The motivation behind there being a distinction between the frontend and the backend is reusability. Let's assume that the interface between the frontend...