Anna University – B.E -VI Sem CSE
CS2352 – Principles of Compiler Design
Dr. D. Jagadeesan, B.E., M.Tech., Ph.D., MISTE.,
Professor in CSE, APCE
Unit – I
Syllabus : Unit – I : LEXICAL ANALYSIS
Introduction to Compiling- Compilers-Analysis of the source program- The phasesCousins-The grouping of phases-Compiler construction tools. The role of the lexical
analyzer- Input buffering-Specification of tokens-Recognition of tokens-A language for
specifying lexical analyzer.
A Compiler is a program that reads a program written in one language (Source
Language like C,C++,etc…) and translate it into an equivalent program in another language
(Target Language like Machine Language) and the Compiler reports to its user the presence
of errors in the source program.
(High Level Language)
(Low Level Language)
Classification of Compiler :
1. Single Pass Compiler
2. Multi-Pass Compiler
3. Load and Go Compiler
4. Debugging or Optimizing Compiler.
Software Tools :
Many software tools that manipulate source programs first perform some kind of
analysis. Some examples of such tools include:
Structure Editors :
A structure editor takes as input a sequence of commands to build a source
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.
Example – while …. do and begin….. end.
Pretty printers :
A pretty printer analyzes a program and prints it in such a way that the
structure of the program becomes clearly visible.
Static Checkers :
A static checker reads a program, analyzes it, and attempts to discover
potential bugs without running the program.
1 / 17