CS8602 Compiler Design Anna University Syllabus Regulation 17

CS8602 Compiler Design Anna University Syllabus Regulation 17

CS8602   COMPILER DESIGN  L T P C 3 0 2 4 

OBJECTIVES:  To learn the various phases of compiler.   To learn the various parsing techniques.  To understand intermediate code generation and run-time environment.  To learn to implement front-end of the compiler.  To learn to implement code generator.

UNIT I            INTRODUCTION TO COMPILERS                                                                   9 Structure of a compiler – Lexical Analysis – Role of Lexical Analyzer – Input Buffering – Specification of Tokens – Recognition of Tokens – Lex – Finite Automata – Regular Expressions to Automata – Minimizing DFA.

UNIT II           SYNTAX ANALYSIS                                                                                             12 Role of Parser – Grammars – Error Handling – Context-free grammars – Writing a grammar – Top Down Parsing - General Strategies Recursive Descent Parser Predictive Parser-LL(1) Parser-Shift Reduce Parser-LR Parser-LR (0)Item Construction of SLR Parsing Table Introduction to LALR Parser - Error Handling and Recovery in Syntax Analyzer-YACC.

UNIT III          INTERMEDIATE CODE GENERATION                                                           8 Syntax Directed Definitions, Evaluation Orders for Syntax Directed Definitions, Intermediate Languages: Syntax Tree, Three Address Code, Types and Declarations, Translation of Expressions, Type Checking. 

UNIT IV         RUN-TIME ENVIRONMENT AND CODE GENERATION                              8  Storage Organization, Stack Allocation Space, Access to Non-local Data on the Stack, Heap Management - Issues in Code Generation - Design of a simple Code Generator.

UNIT V          CODE OPTIMIZATION                                                                                           8 Principal Sources of Optimization – Peep-hole optimization - DAG- Optimization of Basic BlocksGlobal Data Flow Analysis - Efficient Data Flow Algorithm.

LIST OF EXPERIMENTS:
1. Develop a lexical analyzer to recognize a few patterns in C. (Ex. identifiers, constants, comments, operators etc.). Create a symbol table,  while recognizing identifiers.
2. Implement a Lexical Analyzer using  Lex Tool
3. Implement an Arithmetic Calculator using LEX and YACC
4. Generate three address code for a simple program using LEX and YACC.
5. Implement simple code optimization techniques (Constant folding, Strength reduction and Algebraic transformation)
6. Implement back-end of the compiler for which the three address code is given as input and the 8086 assembly language code is produced as output.

PRACTICALS 30  PERIODS  
THEORY 45 PERIODS  
TOTAL : 75 PERIODS 
OUTCOMES: On Completion of the course, the students should be able to:  Understand the different phases of compiler.       Design a lexical analyzer for a sample language.       Apply different parsing algorithms to develop the parsers for a given grammar.  Understand syntax-directed translation and run-time environment.  Learn to implement code optimization techniques and  a simple code generator.  Design and implement a scanner and a parser using LEX and YACC tools.

TEXT BOOK: 
1.  Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman, Compilers: Principles, Techniques and Tools‖, Second Edition, Pearson Education, 2009.

REFERENCES 
1.  Randy Allen, Ken Kennedy, Optimizing Compilers for Modern Architectures: A Dependence based Approach, Morgan Kaufmann Publishers, 2002.
2.  Steven S. Muchnick, Advanced Compiler Design and Implementation‖, Morgan Kaufmann Publishers - Elsevier Science, India, Indian Reprint 2003.
3.  Keith D Cooper and Linda Torczon, Engineering a Compiler‖, Morgan Kaufmann Publishers Elsevier Science, 2004.
4.  V. Raghavan, Principles of Compiler Design‖, Tata McGraw Hill Education Publishers, 2010.
5.  Allen I. Holub, Compiler Design in C‖, Prentice-Hall Software Series, 1993.

Anna University Syllabus Regulation 17 (CSE Sem-6) Mobile Computing

Anna University Syllabus Regulation 17 (CSE Sem-6) Artificial Intelligence

Anna University Syllabus Regulation 17 (CSE Sem-6) Internet Programming


Do You want International Scholarship? To Know more about the scholarship : Click Here

Are you a fresher and looking for Job? To know more about the Job Openings: Click Here


Click to Download Other ECE Materials: CLICK HERE

Click to Download Other CSE Materials: CLICK HERE


Click to Download MECH Materials: CLICK HERE

Other Syllabus



Comments