29-11-2012, 06:36 PM
Compiler Construction
Compiler Construction[.ppt (Size: 95.23 KB / Downloads: 24)
Objective of the course
Understanding the fundamentals of the compilation technique
Assist you in writing you own compiler (or any part of compiler)
Programming Language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create program that control the behavior of a machine and/or to express algorithms precisely.
First programming language ADA1950
Program
A set of rules to tell computer what to do
A set of rule for communicating with the system
A set of instructions to make computer understand
Translation
A program written in any language must be translated to machine understandable form
Translator is used to translate one form of program into another form
Types
Assembler
Compiler
Interpreter
Compiler
It is a translator
Compiler is a program (written in a high-level language) that converts / translates / compiles source program written in a high level language into an equivalent machine code.
It takes a program written in source language and translates it into an equivalent target program
A program that carries out translation activities
The Analysis-Synthesis Model of Compilation
Analysis
Understanding the source program properly
In this part intermediate representation is created from the source code
This part breaks up the source code into meaningful pieces, while storing information into symbol table
Then imposes a grammatical structure on these pieces
Synthesis
Generating the target code
In this part the target program is created from the representation
Constructs the target code from the information stored in the symbol table
Error Handling Proces
Error is any unknown thing to the compiler.
Each and every phase may encounter error, so this is the job of error handler to deal with it
Error handler performs overall management regarding the errors
Function of error handler
Rectification of error at own level
Error message generating
Management
Compiler Construction[.ppt (Size: 95.23 KB / Downloads: 24)
Objective of the course
Understanding the fundamentals of the compilation technique
Assist you in writing you own compiler (or any part of compiler)
Programming Language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create program that control the behavior of a machine and/or to express algorithms precisely.
First programming language ADA1950
Program
A set of rules to tell computer what to do
A set of rule for communicating with the system
A set of instructions to make computer understand
Translation
A program written in any language must be translated to machine understandable form
Translator is used to translate one form of program into another form
Types
Assembler
Compiler
Interpreter
Compiler
It is a translator
Compiler is a program (written in a high-level language) that converts / translates / compiles source program written in a high level language into an equivalent machine code.
It takes a program written in source language and translates it into an equivalent target program
A program that carries out translation activities
The Analysis-Synthesis Model of Compilation
Analysis
Understanding the source program properly
In this part intermediate representation is created from the source code
This part breaks up the source code into meaningful pieces, while storing information into symbol table
Then imposes a grammatical structure on these pieces
Synthesis
Generating the target code
In this part the target program is created from the representation
Constructs the target code from the information stored in the symbol table
Error Handling Proces
Error is any unknown thing to the compiler.
Each and every phase may encounter error, so this is the job of error handler to deal with it
Error handler performs overall management regarding the errors
Function of error handler
Rectification of error at own level
Error message generating
Management