COMPILER

Views:
 
Category: Education
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

COMPILER:

COMPILER BHANU ROD B.TECH(C.S.)

DISCUSSION TOPICS:

DISCUSSION TOPICS INTRODUCTION HISTORY ARCHITECTURE PHASE OF COMPILER ADVANTAGE DISADVANTAGE

INTRODUCTION:

INTRODUCTION Compiler is a program which takes one language (source program) as input and translate it into an equivalent (target program ). Input Output Source program Target program The compiler takes program as HLL and convert it into LLL or machine level language as assembly language. Compiler

HISTORY:

HISTORY Toward the 1950, machine independent programming languages were first proposed . Subsequently , several experimental compiler were developed. The first compiler was written Grace hopper , in 1952, for the A-0 programming language . COBOL was an early language to be compiled on multiple architectures, in 1960.

ARCHITECTURE:

ARCHITECTURE source program Target machine code Laxical analyser Syntax analyser Semantic analyser Intermediate code generator Code optmizer Code generator Error detection and handling Symbol table management

Laxical analyser:

Laxical analyser Lxical analyser is also called scanning. It breaks the source program into group of strings called token.

Syntax analyser:

Syntax analyser The syntax analyser is also called parsing. x= a+b = x + a b The syntax analyser groups the token together into syntax structure.

Semantic analyser:

Semantic analyser The semantic analyser determines the meaning of the source string. It checks the language.

Intermediate code generation:

Intermediate code generation The intermediate code is a kind of code which is easy to generate and this code can be easily converted to target code. Ex: add x y

Code optimization :

Code optimization The code optimization phase attempts to improve the intermediate code. This is necessary to have a faster executing code Thus by the optimizing the code the overall running of the target program can be improved

Code generation:

Code generation In code generation phase the target gets generated. The intermediate code instruction are translated into sequence of machine instruction.

Error detection and handling:

Error detection and handling Whenever a phase of the compiler discovers an error, it must report error to the error handler. the compiler must modify the input to the phase detecting the error.

Symbol table management :

Symbol table management The task of the symbol table is to store identifier (variable) used in the program. The symbol table also stores information about attributes of each identifier.

Advantages:

Advantages Execute time is less. It translate easily high level language to machine language. It is more efficient then interpreter. Compiler is faster as its compile the whole program in one code.

:

Thank you!

authorStream Live Help