Compilers


News

  • The page of the same course held in Academic Year 2018/2019 can be found at this link.
  • 28 November 2019: the lecture of Thursday 05/12/2019 has been cancelled due to a commitment of the teacher out of office.
  • 7 November 2019: starting from Tuesday 19/11/2019 lectures are scheduled on Tuesdays 11am - 1pm and on Thursdays 2pm- 4pm. The list of lectures below has been updated.
  • 7 November 2019: the lecture of Wednesday 13/11/2019 has been cancelled due to the Inauguration of the Academic Year.
  • 24 October 2019: the lecture of Wednesday 30/10/2019 has been cancelled because the teacher belongs to the committee for the Degree Ceremony.
  • 10 October 2019: the lecture of Thursday 17/10/2019 has been cancelled to allow the students to participate to the event Hacktoberfest 2019.
  • 24 September 2019: the course of the Academic Year 2019/2020 will start on Wednesday 2nd October at 11am in room AB1 of Polo Lodovici.

General Information

Teacher:

ESSE3 Link

Lectures schedule:

  • Wed 11am-1pm Room AB1 Polo Lodovici, Via Madonna delle Carceri 9, Camerino, from 19/11/2019 on: Tue 11am-1pm Room AB3 Polo Lodovici, Via Madonna delle Carceri 9, Camerino
  • Thu 2pm-4pm Room AB1 Polo Lodovici, Via Madonna delle Carceri 9, Camerino

Webex Room for Lecture Streaming

Office hours:

  • Luca Tesei's office hours are specified here, look at the notices for any variation. The place is Luca Tesei's office, 1st floor, Polo Lodovici, via Madonna delle Carceri 9, Camerino.

Official Acronym:

  • The official acronym of the course is CMP1920

Course Objectives


Course Contents

The course will delve into the following topics (for students convenience chapters in the textbook are indicated within parenthesis)

  • General Introduction to Compilers construction [ALSU - Ch.1]
    • Structure of a compiler
    • Evolution of programming languages
    • Generalities on programming languages
  • Lexical Analysis [ALSU - Ch.3]
    • Lexical analysis objectives and issues
    • Tokens, patterns, and lexemes
    • Regular expressions and definitions
    • Finite Automata
      • DFA - Deterministic Finite Automata
      • NFA - Non Deterministic Finite Automata
    • From RegExp to NFA
    • From NFA to DFA
    • DFA Minimization
    • Recongnition of tokens
  • Syntax Analysis [ALSU - Ch.4]
    • Introduction to CF grammars and Push-Down automata
    • Parse tree and derivations
    • Ambiguity
    • Top-down parsing
      • Left recursion and left factoring
      • Recursive descent parsing
      • FIRST and FOLLOW sets
      • Non recursive predictive parsing
      • Error recovery in predictive parsing
    • Bottom-up parsing
      • Reductions, Handles
      • Shift-reduce parsing
      • LR(0) automaton and table
      • SLR table
      • LR(1) automaton and table
      • LALR table
      • Error recovery in LR parsing
  • Syntax-Directed Translation [ALSU - Ch.5 (section 5.5 excluded)]
    • Syntax-Directed Definitions
    • Inherited and Synthesized Attributes
    • Dependency Graphs
    • Syntax-Directed Translation Schemes
  • Intermediate Code Generation [ALSU - Ch. 6 (sections 6.7,6.8,6.9 excluded)]
    • Three-Address Code
    • Type Checking
    • Control Flow Translation schemes

Study Material

Lectures

  1. 17/10/2019 - Lecture cancelled due to Hacktoberfest 2019
  2. 30/10/2019 - Lecture cancelled due to Degree Ceremony
  3. 13/11/2019 - Lecture cancelled due to Inauguration of the Academic Year
  4. 05/12/2019 - Lecture cancelled due to a commitment of the teacher

Textbooks

Slides

Exercise Sessions with Solutions

Lexical Analysis:

Syntax Analysis:

Semantic Analysis:

Sample Past Written Tests with Solutions