3. Role of compiler
• A computer program which reads source code and outputs assembly
code or executable code is called compiler.
• A program that translates software written in source code into
instructions that a computer can understand Software used to
translate the text that a programmer writes into a format the CPU
can use.
• A piece of software that takes third-generation language code and
translates it into a specific assembly code. Compilers can be quite
complicated pieces of software.
4. Role of interpreter
• It translates a program line-by-line (statement-by-statement) and
carries out the specified actions in sequence. In contrast, an
assembler or compiler completely translates a program written in a
high-level language (the source program) into a machine-language
program (the object program) for later execution. Whereas a
compiled-program executes much faster than an interpreted-
program, an interpreter allows examination and modification of the
program while it is running (executing).
5. Pre-processing phase
• A C pre-processor is a program that accepts C code with pre-
processing statements and produces a pure form of C code that
contains no pre-processing statements (like #include).
6. Compilation
• The C compiler accepts a preprocessed output file from the
preprocessor and produces a special file called an object file. Object
file contains machine code generated from the program
7. Linking phase
• The link phase is implemented by the linker. The linker is a process
that accepts as input object files and libraries to produce the final
executable program.