CS1352 PRINCIPLES OF COMPILER
DESIGN 3 1
0 100
AIM
At the end of the course the student
will be able to design and implement a simple compiler.
OBJECTIVES
· To understand, design and implement a lexical
analyzer.
· To understand, design and implement a parser.
· To understand, design code generation schemes.
· To understand optimization of codes and runtime
environment.
UNIT I INTRODUCTION TO COMPILING 9
Compilers
- Analysis of the source program - Phases of a compiler - Cousins of the
Compiler - Grouping of Phases - Compiler construction tools - Lexical Analysis -
Role of Lexical Analyzer - Input Buffering - Specification of Tokens.
UNIT II SYNTAX ANALYSIS
9
Role
of the parser -Writing Grammars -Context-Free Grammars - Top Down parsing -
Recursive Descent Parsing - Predictive Parsing - Bottom-up parsing -
Shift Reduce Parsing - Operator Precedent Parsing - LR Parsers - SLR
Parser - Canonical LR Parser - LALR Parser.
UNIT III INTERMEDIATE CODE GENERATION 9
Intermediate
languages - Declarations - Assignment Statements - Boolean Expressions - Case
Statements - Back patching - Procedure calls.