Preprocessor
A preprocessor, generally considered as a part of the compiler, is a tool that produces input for compilers. It deals with macro-processing, augmentation, file inclusion, language extension, etc.
Compiler
A compiler is a translator program that translates a program written in (HLL) the source program and translates it into an equivalent program in (MLL) the target program. As an important part of a compiler is error showing to the programmer.
Executing a program written n HLL programming language is basically of two parts. the source
program must first be compiled translated into an object program. Then the results object program is loaded into a memory executed.
Cross-compiler
A compiler that runs on the platform (A) and is capable of generating executable code for a platform (B) is called a cross-compiler.
Source-to-source Compiler
A compiler that takes the source code of one programming language and translates it into the source code of another programming language is called a source-to-source compiler.
INTERPRETER
An interpreter is a program that appears to execute a source program as if it were machine language
Fig: Execution in Interpreter
The process of interpretation can be carried out in the following phases.
1. Lexical analysis
2. Syntax analysis
3. Semantic analysis
4. Direct Execution
Assembler
An assembler translates assembly language programs into machine code. The output of an assembler is called an object file, which contains a combination of machine instructions as well as the data required to place these instructions in memory.
Linker
Linker is a computer program that links and merges various object files together in order to make an executable file. All these files might have been compiled by separate assemblers. The major task of a linker is to search and locate referenced module/routines in a program and to determine the memory location where these codes will be loaded, making the program instruction to have absolute references.
Loader
Loader is a part of the operating system and is responsible for loading executable files into memory and execute them. It calculates the size of a program (instructions and data) and creates memory space for it. It initializes various registers to initiate execution.
STUDY