Compiler Design Overview
Compiler Design Overview
Compiler Design Overview
Preprocessor
- A preprocessor produce input to compilers.
Preprocessor
- They may perform the below functions.
- Macro processing
- Language Extensions
- Rational preprocessor
- File inclusion
Macro processing
- This allow a user to define macros that are short hands for longer constructs.
Typedef int integerData
Language Extensions
- This preprocessor attempts to add capabilities to the language by certain amounts to build-in macro.
Language Extensions
Rational preprocessor
- This augment older languages with more modern flow-of-control and data structuring facilities.
Rational Preprocessor
File inclusion
- File inclusion include header files into the program text.
#include <stdio.h>
Compiler
- Compiler is a translator program that translates a program written in (High Level Language) the source program and translates it into an equivalent program in (Machine Level Language) the target program.
- As an important part of a compiler is error showing to the programmer.
Machine Code
Compiler
Read Also
List of Compiler
Assembler
- Programs known as assembler were written to automate the translation of assembly language into machine language.
- The input to an assembler program is called source program, the output is a machine language translation.
Assembler
Interpreter
- An Interpreter is a program that appears to execute a source program as if it were machine language.
Interpreter
- Languages such as BASIC, SNOBOL, LISP can be translated using interpreters. JAVA also uses interpreter.
Loader and Link Editor
- A loader is a program that places programs into memory and prepares them for execution. The loader determines and allocates the required memory space for the program to execute properly.
Loader and Link Editor
Translator
- A translator is a program that takes as input a program written in one language and produces as output a program in another language. Beside program translation, the translator performs another very important role, the error-detection.
- Any violation of the High level language specification would be detected and reported to the programmers.
Translator