A compiler is a program used to convert symbolic programming languages of the second to fourth generation into executable machine languages. Since microprocessors can only interpret machine language, programs written in a high- level computer language must be converted into the machine code of the respective processor.
This involves conversion to object code, which can then be executed directly by a microprocessor. To do this, the source program is first subjected to a character-by-character lexical analysis and broken down into its individual components, which are referred to as terminal symbols. Each symbol is identified by its type and value. The type contains the nature of the components of the program, and the value contains the contents in terms of their program function. After the analysis of the source code in terms of its symbols, the analysis of the syntax follows, where the symbols are assembled according to the rules of the machine code for which the compiler was written. After this analysis, the program is broken down into its components and can be converted into the machine language.
During this process of code generation, the source program ischecked for conformance with the rules of the programming language. During compilation, individual program modules are created which are linked to form an object program.