0% found this document useful (0 votes)
24 views9 pages

Compiler Construction: by Noor Wali Khan Uoch

The document discusses compilers, describing source languages like C++ and Java, target languages like machine code and assembly code, the steps in compilation like preprocessing, compiling, assembling, linking and loading, and desirable properties of compilers like generating correct executable code and providing good diagnostics.

Uploaded by

Abdul Mateen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views9 pages

Compiler Construction: by Noor Wali Khan Uoch

The document discusses compilers, describing source languages like C++ and Java, target languages like machine code and assembly code, the steps in compilation like preprocessing, compiling, assembling, linking and loading, and desirable properties of compilers like generating correct executable code and providing good diagnostics.

Uploaded by

Abdul Mateen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Compiler Construction

By Noor Wali Khan


Uoch
Source Language
• Any programming language or high level languages
are called source language.
• These languages contains English like words and
mathematical symbols, that are easy to understand by
the Human. E.g. C, C++, java, Python, PHP etc.
• There are thousand of languages(source) ranges from
traditional programming languages to specialized
language.
Target Language
• low level programming languages.
• It has two forms
• Relocatable Machine Code
• Target Assembly Code
Relocatable Machine Code
• It is a machine code with relocatable address.
• Machine code that is loaded in storage so that its relative address is
different from its absolute address.
• Absolute Address: A direct address that identifies a location, such as a
storage location, without a reference to any other address, such as a
base address.
• Relative address:  A direct address that identifies its location by
means of its displacement from a base address.
Target Assembly Code
• If the output of the compiler is in assembly
language then a translator called assembler is
used to translate the output(assembly codes)
into machine code.
Skeletal Source

Context of compiler Program

Preprocessor

Source
program .obj
extension
Compiler
Relocatable Machine
Assembler
code

Linker

Execute

Loader
Desirable Properties of compiler
• It must generate a correct executable code.
• The input program and the output program must be
equivalent, the compiler should preserve the meaning
of the input program.
• Compiler should be fast.
• Compiler should provide good diagnostic for
programming errors.

You might also like