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

1-Language Processing System

This document provides an overview of a lecture on language processing systems and translators from a Compiler Design course. It discusses the main components of a language processing system, including preprocessors, compilers, assemblers, linkers, loaders, interpreters, decompilers, and disassemblers. It also compares compilers and interpreters, discusses different types of compilers like single pass, two pass, and multi pass compilers, and covers other language translators like hybrid compilers and language rewriters.

Uploaded by

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

1-Language Processing System

This document provides an overview of a lecture on language processing systems and translators from a Compiler Design course. It discusses the main components of a language processing system, including preprocessors, compilers, assemblers, linkers, loaders, interpreters, decompilers, and disassemblers. It also compares compilers and interpreters, discusses different types of compilers like single pass, two pass, and multi pass compilers, and covers other language translators like hybrid compilers and language rewriters.

Uploaded by

sherlock holmes
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Compiler Design
KCS502
by
DR PARUL YADAV

Institute of Engineering and Technology, Lucknow


Lecture 1:
LANGUAGE PROCESSING SYSTEM
AND TRANSLATORS
Contents
• Language Processing System
• Translators
• Brief Introduction to Compiler
Computer: Hardware + Software
Language Processing System
Language Processing System
Preprocessor:

• Generally considered as part of


compiler

• Generates preprocessed code

• Produces input for compiler

• Expands macros
Language Processing System
Compiler:
• Translates source code written in HLL
into target code written in assembly
language or low level language
•Reports user about error(s) in source
program, if any

•Example: C/ C++, BASIC, COBOL,


FORTRAN, Ada compiler
Language Processing System
Assembler:
•Translates source code in
assembly language and target
code in machine language

•Example: MASM, NASM, gas,


as86, TASM, a86 and Terse
etc.
Language Processing System:
Linker and Loader
Translators
Compiler
Compiler v/s Interpreter
• Compiler
usually
produces
faster target
program.
• Interpreter
usually gives
better error
diagnostics.
• Example:
LIST, PHP,
PERL, ASP
etc.
• Interpreter: Executes source program statement by statement.
• Instead producing a target program, interpreter directly executes the operations
specified in the source program on inputs supplied by the user.
Decompiler

• Decompiler: Translates from low-level language to a high-level language


• Example: Data Flex Decompiler, .NET Decompiler etc.
• Used for recovery of lost source code
• Also useful in some cases of security, interoperability and error diagnostics
Assembler

• Translates source code in assembly language and target code in


machine language
• Example: MASM, NASM, gas, as86, TASM, a86 and Terse etc.
Disassembler

• Translates executable program into assembly language


• Reverse engineering tool (accepts commands from you for examining, if
stopped, for continuing program execution)
• Example: objdump, PVDasm, OllyDbg, SIMON, gdb etc.
Hybrid Compiler

• Combines compilation and interpretation


• Advantage: Intermediate code (byte code) compiled on one machine can be
interpreted on another machine, perhaps across the network
• In order to achieve faster processing of inputs to outputs, some JAVA compiler
called just-in-time compilers, translates the bytecode into machine language
immediately before they run the intermediate program to process the input.
Language Translator
• Translates between HLLs
• Source to source translator
• Language converter
• Used to add extension to
existing languages
• Used to good and portable
implementation of other
languages (eg. C)
• Sometimes for simplifying
development
Language Rewritter

• Translates form of
expressions without a
change in language
Compiler
Phases of Compiler
Single Pass Compiler
Two Pass Compiler
Multi Pass Compiler
Thank you

You might also like