A compiler is a program that reads a program in one language, the source language and translates into an equivalent program in another language, the target language.
The translation process should also report the presence of errors in the source program.
Source Program | → | Compiler | → | Target Program |
↓ |
||||
Error Messages |
There are two parts of compilation.
The analysis part breaks up the source program into constant piece and creates an intermediate representation of the source program.
The synthesis part constructs the desired target program from the intermediate representation.