List the cousins (context) of compiler and explain the role of any one of them

List the cousins (context) of compiler and explain the role of any one of them.

  • The cousins of compiler are :

    1. Pre-processor
    2. Assembler
    3. Linker
    4. Loader
1. Pre-processor : 
  • Pre-processor produce input to compiler they may perform the following functions :

    a) Macro Processing : 
  • A pre-processor may allow user to define macros that are shorthand for longer constructs.
    
    b) File Inclusion : 
  • preprocessor may include the header file into the program text.

    c) Rational Pre-processor : 
  • Such a preprocessor provides the user with built in macro for construct like while statement or if statement.

    d) Language Extensions : 
  • this processors attempt to add capabilities to the language by what amount to built-in macros.
  • Ex: the language equal is a database query language embedded in C. 
  • statement beginning with ## are taken by preprocessor to be database access statement unrelated to C and translated into procedure call on routines that perform the database access.
List the cousins (context) of compiler and explain the role of any one of them
Fig.Context Of Compiler

2. Assembler :

  • Assembler is a translator which takes the assembly program as an input and generates the machine code as a output. An assembly is a mnemonic version of machine code, in which names are used instead of binary codes for operations.

3. Linker :

  • Linker allows us to make a single program from a several files of relocatable machine code. These file may have been the result of several different compilation, and one or more may be library files of routine provided by a system.

4. Loader :

  • The process of loading consists of taking relocatable machine code, altering the relocatable address and placing the altered instructions and data in memory at the proper location.