Compiler Design Notes 3.pdf - Shri Vishnu Engineering College For Women COMPILER DESIGN LECTURE NOTES DEPARTMENT OF COMPUTER SCIENCE ENGINEERING SHRI

Compiler Design Notes 3.pdf - Shri Vishnu Engineering...

This preview shows page 1 - 4 out of 89 pages.

Shri Vishnu Engineering College For Women Department of CSE - 1 - COMPILER DESIGN LECTURE NOTES DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING SHRI VISHNU ENGINEERING COLLEGE FOR WOMEN ( Approved by AICTE, Accredited by NBA, Affiliated to JNTU Kakinada) BHIMAVARAM 534 202
Image of page 1
Shri Vishnu Engineering College For Women Department of CSE - 2 - UNIT -1 1.1 OVERVIEW OF LANGUAGE PROCESSING SYSTEM 1.2 Preprocessor A preprocessor produce input to compilers. They may perform the following functions. 1. Macro processing: A preprocessor may allow a user to define macros that are short hands for longer constructs. 2. File inclusion: A preprocessor may include header files into the program text. 3. Rational preprocessor: these preprocessors augment older languages with more modern flow-of-control and data structuring facilities. 4. Language Extensions: These preprocessor attempts to add capabilities to the language by certain amounts to build-in macro 1.3 COMPILER Compiler is a translator program that translates a program written in (HLL) the source program and translate it into an equivalent program in (MLL) the target program. As an important part of a compiler is error showing to the programmer. Source pgm target pgm Error msg Compiler
Image of page 2
Shri Vishnu Engineering College For Women Department of CSE - 3 - Executing a program written n HLL programming language is basically of two parts. the source program must first be compiled translated into a object program. Then the results object program is loaded into a memory executed. Source pgm obj pgm Obj pgm input opj pgm output 1.4 ASSEMBLER : programmers found it difficult to write or read programs in machine language. They begin to use a mnemonic (symbols) for each machine instruction, which they would subsequently translate into machine language. Such a mnemonic machine language is now called an assembly language. Programs known as assembler were written to automate the translation of assembly language in to machine language. The input to an assembler program is called source program, the output is a machine language translation (object program). 1.5 INTERPRETER : An interpreter is a program that appears to execute a source program as if it were machine language. Languages such as BASIC, SNOBOL, LISP can be translated using interpreters. JAVA also uses interpreter. The process of interpretation can be carried out in following phases. 1. Lexical analysis 2. Synatx analysis 3. Semantic analysis 4. Direct Execution Advantages: Modification of user program can be easily made and implemented as execution proceeds. Type of object that denotes a various may change dynamically. Debugging a program and finding errors is simplified task for a program used for interpretation. The interpreter for the language makes it machine independent.
Image of page 3
Image of page 4

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture