Nothing Special   »   [go: up one dir, main page]

CSE18R274 Syllabus

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

L T P Credit

CSE18R274 COMPILER DESIGN


3 1 0 4

Pre-requisite: CSE18R252 / Formal Course Category : Program Core


Language and automata Course Type : Integrated Course

COURSE OUTCOMES :

CO1:  Understand the different phases of compilation


CO2:   Apply context free grammars to parsing and compare different parsing
           technique
CO3:  Develop skills on lexical analysis and parsing which are helpful to a broad range
          of computer science application areas.
CO4:  Design the various code generation schemes.
CO5:  Analyze optimization techniques to reduce the code size

MAPPING OF COURSE OUTCOMES WITH PO, PSO:

Pos PSOs
1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4
CO1 S M S
CO2 S M S M M L L L M M S L L
CO3 S M S M M L L L M M S L L
CO4 S M S M M S
CO5 S M S M M L L L M M S L L

UNIT I INTRODUCTION

Introduction to Compiler – The structure of a compiler- Compiler- Lexical Analysis –


Role of the lexical analysis – Input Buffering – Specification of tokens- Recognition of
tokens – Lexical analyzer generator

UNIT II LEXICAL ANALYSIS

Finite Automata – Regular Expression to an NFA - Optimization of DFA based pattern


matchers- The Role of the Parser - Context-Free Grammars - Writing a Grammar -Top-
Down Parsing - Recursive Descent Parsing – Predictive Parsing - Bottom-Up Parsing -
Shift Reduce Parsing - Operator-Precedence Parsing

UNIT III SYNTAX ANALYSIS


Introduction to LR parsing - SLR Parser – Canonical LR Parser – LALR Parser
Generators - Intermediate Languages – Declarations – Control Flow -Boolean
Expressions –Switch Statements - Back patching .

UNIT IV INTERMEDIATE CODE GENERATION

Issues in the Design of a Code Generator - The Target Language - Addresses in the
target code - Basic Blocks and Flow Graphs - A Simple Code Generator - DAG
Representation of Basic Blocks

UNIT V CODE OPTIMIZATION AND RUN TIME ENVIRONMENTS

The Principal Sources of Optimization - Optimization of Basic Blocks - Peephole


optimization- Loops in Flow Graphs –Runtime environments –Storage organizations-
stack allocation of space – Access to nonlocal data on the stack

LIST OF EXPERIMENTS:                                                                          


1. Implementation of Lexical Analyzer
2. Construction of Symbol Table
3. Construction of a NFA from a regular expression
4. Computation of FIRST and FOLLOW for a given grammar
5. Implementation of operator precedence parsing Algorithm
6. Implementation of shift reduce parsing Algorithm
7. Generation of a code for a given intermediate code
8. Use LEX tool to implement a lexical analyzer
9. Use YACC tool to implement a desktop calculator
10. Use YACC tool to implement a parser

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

REFERENCE BOOKS
1. Allen I. Holub, Compiler Design in C, Prentice Hall of India, 2003
2. Bennet J.P., Introduction to Compiler Techniques, Tata McGraw-Hill, 2nd Edition,
2003
3. Henk Alblas and Albert Nymeyer,, Practice and Principles of Compiler Building
with C, PHI, 2001.

You might also like