Chapter 2: Introduction to compilers

 

We design the front end independent of machines and the back end independent of the source language. For this, we will require a Universal Intermediate Language (UIL) that acts as an interface between front end and back end. The front end will convert code written in the particular source language to the code in UIL, and the back end will convert the code in UIL to the equivalent code in the particular machine language. So, we need to design only M front ends and N back ends. To design a compiler for language L that produces output for machine C, we take the front end for L and the back end for C. In this way, we require only M + N compilers for M source languages and N machine architectures. For large M and N, this is a significant reduction in the effort.