Lectyu
Lectyu
1
Course Grading
2
Course Goals
3
Pre- requisite
4
Textbooks and Class Materials
Compilers: Principles, Techniques and Tools,
Alfred v.Aho, Ravi Sethi , Jeffrey D.Ullman.
Compiler Construction principles and Practice,
Kenneth G.Louden
Compiler Design
O.G.Kakde
Introduction to computer theory(second Edition)
Daniel I.A.Cohen
5
Answer These Questions
What is compiler ?
Why we need compiler?
What are the high or low level languages?
Difference b/w them.
6
Answer These Questions (cont’d)
7
What is compiler ?
8
Besides this what it does ?
9
The compiler reports to its user the presence of
errors in the source program.
Error Messages
10
Different Terminology
11
Decompiler
12
Decompiler (cont’d)
13
The Ethics of Decompilation
15
The Ethics of Decompilation(cont’d)
16
The Ethics of Decompilation(cont’d)
17
The Ethics of Decompilation(cont’d)
Usually all software are copyrighted by the authors.
This means, copying or expressing the same idea in
another program is prohibited. Hence if you are using
decompilation to discover the internals of a program
and if that particular part is breaking the copyright of
the owner, you are liable for legal action. However,
there are some permitted uses of decompilation, like
the first three cases stated above
18
The Ethics of Decompilation(cont’d)
19
The Ethics of Decompilation(cont’d)
20
Language Translator
21
Benefits
22
Benefits (cont’d)
Because the task of conversion requires a lot
of programming effort from the
programmers.But using a language translator
will simplify this task and is not a costly
solution.
EXAMPLE
Example of language translator is “DIAMOND
CONVERTER”.This converter is used to
convert a code written in Pascal to Ada.
23
Cross-Compiler
24
Example
25
Example (cont’d)
26
The Analysis-Synthesis Model of
Compilation
27
The Analysis-Synthesis Model of
Compilation (cont’d)
28
The Analysis-Synthesis Model of
Compilation (cont’d)
29
Example
30
Software Tools
31
Structure Editors
A structure editor takes as input a sequence of
commands to build a source program .The
structure editor not only performs the text
creation and modification functions of an
ordinary text editor but it also analyses the
program text ,putting appropriate hierarchical
structure on the source program.Thus the
structure editor can perform additional tasks
that are useful in preparation of programs.
32
Structure Editors (cont’d)
For example it can check that the input is correctly
formed can supply keywords automatically(e.g.when
the user types while the editor supplies the matching
do and reminds the user that a condition must come
between them) and can run from a begin or left
parenthesis to its matching end or right
parenthesis.Further the output of such an editor is
often similar to the output of the analysis phase of a
compiler.
33
Pretty Printer
34
Static checkers
35
Interpreter
36
Interpreter (cont’d)
At the root it would discover it (interpreter) had on
assignment to perform so it would call a routine to
evaluate the expression on the right and then store the
resulting value in the location as associated with the
identifier position .At the right side of the root the
routine would discover,it had to compute the sum of
two expressions.It would call itself recursively to
compute the value of the expression rate*60 it would
then add that value to the value of the variable initial.
37
THANKS
38