Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Notes  >  Introduction to Compiling Compilers - Lexical Analysis, Computer Science and IT Engineering

Introduction to Compiling Compilers - Lexical Analysis, Computer Science and IT Engineering - Computer Science Engineering (CSE) PDF Download

Introduction to Compiling Compilers

A compiler is a program that reads a program written in one language-the source language-and translates it into an equivalent program in another language-the target language.

COMPILERS

A compiler is a program that reads a program written in one language-the source language-and translates it into an equivalent program in another language-the target language. As an important part of this translation process, the compiler reports to its user the presence of errors in the source program.

Introduction to Compiling Compilers - Lexical Analysis, Computer Science and IT Engineering - Computer Science Engineering (CSE)

Compilers are sometimes classified as single-pass, multi-pass, load-and-go, debugging, or optimizing, depending on how they have been constructed or on what function they are supposed to perform. Despite this apparent complexity, the basic tasks that any compiler must perform are essentially the same.

 

The Analysis – Synthesis Model of Compilation

There are two parts of compilation.

  • Analysis part

  • Synthesis Part

The analysis part breaks up the source program into constant piece and creates an

intermediate representation of the source program.

The synthesis part constructs the desired target program from the intermediate representation.

Software tools used in Analysis part: 1) 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 analyzes the program text, putting an appropriate hierarchical structure on the source program.

  • For example , it can supply key words automatically - while …. do and begin….. end

2) Pretty printers :

  • A pretty printer analyzes a program and prints it in such a way that the structure of the program becomes clearly visible. For example, comments may appear in a special font.

3) Static checkers

  • A static checker reads a program, analyzes it, and attempts to discover potential bugs without running the program.

  • For example, a static checker may detect that parts of the source program can never be executed.

4) Interpreters :

  • Translates from high level language (BASIC, FORTRAN, etc..) into machine language.

  • An interpreter might build a syntax tree and then carry out the operations at the nodes as it walks the tree.

  • Interpreters are frequently used to execute command language since each operator executed in a command language is usually an invocation of a complex routine such as an editor or complier.

Introduction to Compiling Compilers - Lexical Analysis, Computer Science and IT Engineering - Computer Science Engineering (CSE)

The document Introduction to Compiling Compilers - Lexical Analysis, Computer Science and IT Engineering - Computer Science Engineering (CSE) is a part of Computer Science Engineering (CSE) category.
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)

Top Courses for Computer Science Engineering (CSE)

Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

study material

,

Exam

,

Viva Questions

,

shortcuts and tricks

,

practice quizzes

,

Introduction to Compiling Compilers - Lexical Analysis

,

Computer Science and IT Engineering - Computer Science Engineering (CSE)

,

Free

,

ppt

,

Important questions

,

Extra Questions

,

video lectures

,

Sample Paper

,

Semester Notes

,

Summary

,

MCQs

,

mock tests for examination

,

pdf

,

past year papers

,

Computer Science and IT Engineering - Computer Science Engineering (CSE)

,

Introduction to Compiling Compilers - Lexical Analysis

,

Previous Year Questions with Solutions

,

Computer Science and IT Engineering - Computer Science Engineering (CSE)

,

Introduction to Compiling Compilers - Lexical Analysis

,

Objective type Questions

;