0% found this document useful (0 votes)
10 views

Unit

The document provides an overview of compilers, including their definition, types (single pass, two pass, multipass), and operations. It outlines the key tasks performed by compilers and describes various components involved in language processing systems, such as preprocessors, interpreters, assemblers, linkers, loaders, cross-compilers, and source-to-source compilers. The information emphasizes the role of compilers in translating source code into machine language and the structure of the compilation process.

Uploaded by

purnimapandey
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Unit

The document provides an overview of compilers, including their definition, types (single pass, two pass, multipass), and operations. It outlines the key tasks performed by compilers and describes various components involved in language processing systems, such as preprocessors, interpreters, assemblers, linkers, loaders, cross-compilers, and source-to-source compilers. The information emphasizes the role of compilers in translating source code into machine language and the structure of the compilation process.

Uploaded by

purnimapandey
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Unit-I

Introduction to compiling & Lexical Analysis Introduction of Compiler, Major data Structure in
compiler, types of Compiler, Front-end and Back-end of compiler, Compiler structure: analysis-synthesis
model of compilation, various phases of a compiler, Lexical analysis: Input buffering , Specification &
Recognition of Tokens,Design of a Lexical Analyzer Generator, LEX

Introduction to compiling

A compiler translates a program in a source language to a program in a target language. The most well
known form of a compiler is one that translates a high-level language like C into the native assembly
language of a machine so that it can be executed.

Basically, it translates the program written in the source language to the machine language.

Types of Compiler
Majorly, there are three types of compilers:

 Single Pass Compilers


 Two Pass Compilers
 Multipass Compilers

Single Pass Compiler:


When we merge all the phases of compiler design in a single module, then it is called a single
pass compiler. In the case of a single pass compiler, the source code converts into machine code.

Two Pass Compiler:


A processor that runs through the program to be translated twice is considered a two-pass
compiler.
Multipass Compiler:
A program’s source code or syntax tree is processed many times by the multipass compiler. It
breaks down a huge programme into numerous smaller programmes and runs them all at the
same time. It creates a number of intermediate codes. All of these multipasses use the previous
phase’s output as an input. As a result, it necessitates less memory. ‘Wide Compiler’ is another
name for it.

Operations of Compiler
The important tasks executed by the compiler are:

 Breaks down the source programme into chunks and applies grammatical structure to each
one.
 Enables you to create the symbol table and the target programme you’re after from the
intermediate representation.
 Helps in compiling source code and detecting the errors.
 Organise and save all codes and variables.
 Separate compilation is supported.
 Read the full programme, analyse it, and translate it to a semantically similar language.
 Depending on the type of machine, converting source code to object code.

Steps for Language Processing Systems


 Preprocessor: It is an integral component of the compiler. It’s a tool that generates Compiler
input. It is concerned with augmentation, macro processing, and language expansion,
among other things.
 Interpreter: It works similarly to a compiler in that it converts high-level language into
machine language.
 Assembler: It changes assembly language code into a language that computers can
understand. The output of the assembler, known as an object file, consists of both machine
instructions and the information required to store those commands in memory.
 Linker: It facilitates the linking and combining of numerous object files to produce an
executable file. The main responsibility of a linker is to search a programme for modules and
to identify the memory address where every module is kept.
 Loader: The loader is a component of the operating system that handles the loading and
execution of executable files. It also determines the size of an application, freeing up
additional memory.
 Cross-compiler: In compiler design, a cross compiler is a forum that aids in the generation
of executable code.
 Source-to-source Compiler: A source-to-source compiler is used when the source code of
one programming language is converted into the program code of some other language.

You might also like