Definition of Compiler Design

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

Introduction to Compiler Design

Introduction to Compiler:
⚫Programming languages are notations for describing
computations to people and to machines. The world as
we know it depends on programming languages,
because all the software running on all the computers
was written in some programming language. But,
before a program can be run, it first must be translated
into a form in which it can be executed by a computer.
⚫The software systems that do this translation are called
compilers.
Language Processor
a compiler is a program that can read a program in one
language | the source language | and translate it into an
equivalent program in another language | the target language
⚫If the target program is an executable machine-language program,
it can then be called by the user to process inputs and produce
outputs

⚫An interpreter is another common kind of language processor. Instead


of producing a target program as a translation, an interpreter appears to
directly execute the operations specfied in the source program on
inputs supplied by the user.
Example 1.1
⚫ Java language processors combine compilation and interpretation, as
shown in Fig. 1.4. A Java source program may first be compiled into an
intermediate form called bytecodes.

The linker resolves


external memory
addresses, where the code
in one file may refer to a
location in another file.
The loader then puts
together all of the
executable object files into
memory for execution.
The Structure of a Compiler
⚫ The analysis part breaks up the source program into constituent
pieces and imposes a grammatical structure on them. It then uses
this structure to create an intermediate representation of the source
program.
⚫ The analysis part also collects information about the source program
and stores it in a data structure called a symbol table, which is
passed along with the intermediate representation to the synthesis
part.
⚫ The synthesis part constructs the desired target program from the
intermediate representation and the information in the symbol table.
The analysis part is often called the front end of the compiler; the
synthesis part is the back end
Thank You

You might also like