Compiler Design Lecture notes , PPT Slides


The following are powerpoint slides (and associated code) from the lectures.

Lecture 1

Lecture 2

Lecture 3

  • Answers to Assignment #2. Review pattern matching, recursion, and use of let for local variables. Librearies,  References, While Loops, Accumulating parameter functions.  Regular Expressions as programs. RE to NFA
  • Power Point Slides
  • Code from the notes

Lecture 4

Lecture 5

Lecture 6

Lecture 7

  • Grammars, Top down parsing, Transition Diagrams, Ambiguity, Left recursion, Refactoring by adding levels, Recursive descent parsing, Predictive Parsers, First and Follow, Parsing tables.
  • Power Point Slides
  • Code from the notes

Lecture 8

  •  Shift-reduce parsing, Shift-reduce and reduce-reduce conflicts, Precedence parsing,  LR parser , LR parsers and FSAs,               LR parsing Tables, Sets of Items construction.
  • Power Point Slides

Lecture 9

Lecture 10

  • Modified sets of item construction,  Rules for building LR parse tables,  The Action rules, The GOTO rules, Conflicts and ambiguity, Shift-reduce and reduce-reduce conflicts, Parser generators and ambiguity, Ambiguous expression grammar, Ambiguous if-then-else grammar, Ml-yacc.
  • Power Point Slides
  • A directory of Ambiguous Examples in ml-yacc.

Lecture 11

  • ml-Yacc, Actions when reducing, Making ml-yacc work with ml-lex, Boiler plate.
  • Power Point Slides

Lecture 12

  • Basic Types, Constructed Types, Representing types as data,  Describing type systems as rules, Type rules for ML, Type equality,Type coercions, Sub typing. Purpose of type systems, Kinds of type systems, Primitive types, Constructed types, Type checking, Attribute grammars, Inherited attributes, Synthesized attributes, Adding attributes to trees, Programs for computing attribute computations.
  • Power Point Slides

Lecture 13

Lecture 14 (Guest Lecturer by Jim Hook, Feb 28, 2007)

  •   Writing type-checkers in ML, Role of type rules,  Representing types, Representing programs, Handling errors,                Guessing types, Declarations, Let expressions .
  • Power Point Slides
  • Code from the notes.

Lecture 15

  • Judgments for mini-Java,   Multiple type environments,  Class Hierarchy, Setting up an ML typechecker for mini-Java,               Subtyping, Rules for Java, Declarations as functions over environments.
  • Power Point Slides

Lecture 16

Lecture 17

  • Procedure Abstraction,   Name Spaces, Scoping Rules,  Activation Records, Object Oriented Languages, Parameter Passing,      Returning Values.
  • Power Point Slides

Lecture 18

  • Syntax directed translations,  Meanings of programs,  Rules for writing a compiler, Intermediate code Pascal-like language               Run-time environments Calling sequence Variable references.
  • Power Point Slides
  • Code from the notes.

  • Additional notes to be posted here as lectures are given.

Lecture 19

Lecture 13

    Power Point Slides

      Lecture 18

      Lecture 20

      • Displays, Memory Layout, Heap Allocation, Garbage Collection, Translating Mini Java.
      • Power Point Slides