CS 527 : Compiler Design

Cr : 3
L - T - P    :    2 - 0 - 2

Syllabus

Course Plan

No of lectures per week : 2
Total no of lectures : 30

Lecture Plan :

Sl.No. Topic No.of
Lectures
1 Characteristics of HLL, overview of a compiler's task, phases of compilation task 2
2 Lexical Analysis (refer to coverage in CS502) 1
3 An operator precedence parsing scheme without considering a grammar, advantages and limitations.
Exercise: Implement a desk calculator using operator precedence parsing.
1
4 CFG description of programming languages; parse trees, derivation sequences, ambiguity, top-down and bottom-up parsing 3
5 Automatic creation of an operator precedence table from a CFG Exercise: Implement algorithms for computing LEADING and TRAILING sets, and construction of operator precedence table 1
6 Top down Parsing: Recursive descent parser; predictive parser;
construction of a LL(1) parsing table; LL(K) grammar
Exercise: Implement the FIRST and FOLLOW algorithms required for LL(1) parsing table construction
3
7 Bottom-up parsing: LR parsing; SLR parsing table creation; CLR and LALR parsing table creation
Exercise: Implement the SLR parsing table creation method.
6
8 Intermediate code generation: Syntax directed translation;
Intermediate code formats;
2
9 Storage allocation and Symbol table 2
10 Code optimization: Basic block, flow-graphs, loop detection,
loop optimization, data flow analysis
4
11 Code generation: Efficient use of registers, instructions 2

Evaluation Plan:

Class Assignments 10
Home Assignments 15
Mid Term 50
Lab Assignments 25
End Term Theory 100
End Term Lab 30

Question Bank:

(Click)

Books/References:

  1. Aho, A V Shethi and Ullman J D : Compiler Design
  2. A C Holub, Compiler Design in C: PHI 1993