Compilers

Undergraduate course (current and previous semesters)

Course Description

About compilers course

Introduction

The course is intended to teach the students the basic techniques that underlie the practice of Compiler Construction. The course will introduce the theory and tools that can be standardly employed to perform syntax-directed translation of a high-level programming language into executable code.

These techniques can also be employed in broader areas of application, whenever we need a syntax-directed analysis of symbolic expressions and languages and their translation into a lower-level description. They have multiple uses for man-machine interaction, including verification and program analysis.

Objectives

  • To learn overall compilers architecture,
  • To learn various parsing methods and techniques,
  • To learn low-level code generation and optimization,
  • And finally to learn an intellectual paradigm in system programming and testing.

Motivations

  • Compiler construction is a microcosm of computer science!
  • You dive into the heart of the system when you are building a compiler.
  • And compiler research is hot:

    • Compiler Research: The next 50 Years [pdf]

Course Materials

Common and necessary files for all semesters

Resource

  • Lecture Notes (Dr Parsa) [pdf]
  • Main Reference (Dragon Book) [Buy]
  • DFA, Lexical Analysis and FLex [pptx]
  • Convert DFA to RegExp [pdf]
  • Introduction to ANTLR [pdf]
  • Flex Manual [www]
  • Flex One Minutes Tutorials [mp4]

Tools

Students’ Websites

Sample Exams

Useful Links

Finite State Machine Designer

http://groups.csail.mit.edu/commit/

https://www.cs.cmu.edu/~mleone/language/projects.html

Reference

[Fig. The relationship between grammars]

Schedule, Syllabus and Lecture Notes

The weekly program of course in all semesters

***

Week Topic Materials Descriptions
01 Introduction Please refer to the current semester for more information.
02 Lexical Analyzer (DFAs) Please refer to formal language and automata course.
03 Lexical Analyzer (RegExps) DFA, Lexical Analysis and FLex [pptx], Sample Question[pdf] HW1
04 Syntax Analyzer (Parser)
05 Parsing Problems HW2
06 Shift-Reduce Parsers (LRs)
07 Shift-Reduce Parsers (LALRs)
08 Shift-Reduce Parsers (SLRs) HW3
09 Top-Down Parser (LLs)
10 Top-Down Parser (RDP) HW4
11 Abstract Syntax Trees
12 Three Address Codes
13 Code Optimization
14 Code Generation
15 Advanced Topics
16 Review
Final Exam Final Project

***

Current Semester (Winter 2020)

IUST Semester 1398-2

Announcements 

  • 1398-12-11: ANTLR slides and assignment was added.
  • 1398-11-05: Welcome to compilers course by Dr. Saeed Parsa!

Course Instructors

  • Dr. Saeed Parsa

Teaching Assistants

Class Time and Location

  • Semester 1398-2 (WINTER 2020)
  • Main Lecture: Saturdays and Mondays, 08:00 – 10:00
  • Location: Classroom D 1xx

Grading Policy

  • T.A. Class (Homework, Project, etc.): 5 + 1
  • Exercises: 5
  • Exams: 10
  • Sum: 21

Resources

Assignments and Project

  • Please refer to ANTLR slides PART 3.

TA Class Notes

  • All exercises are delivered at the reverse engineering lab.
  • Your homework solutions also should submit to compiler_iust@outlook.com before the deadlines.

TA Class Final Scores

  • Final Scores

FAQ

Previous Semesters

The main archived notes and files

Announcements 

  • (New!) Final project due dates: 1397-11-03 and 1397-11-06 (8-10 AM)
  • 1397-08-08: Homework 2 (hw02) released.
  • 1397-07-21: Homework 1 (hw01) released.
  • 1397-07-21: Midterm 1 sample questions are added to the course table.
  • 1397-07-05: Welcome to compilers course by Dr. Saeed Parsa!

Course Instructors

  • Dr. Saeed Parsa

Teaching Assistants

Class Time and Location

  • Semester 1397-1 (Fall 2018)
  • Main Lecture: Saturdays and Mondays, 08:00 – 10:00
  • Location: Classroom D 1–
  • T.A. Class: Saturdays, 12:00 – 13:00, Classroom D 1–

Grading Policy

  • T.A. Class (Homework, Project, etc.): 5 + 1
  • Exercises: 5
  • Exams: 10
  • Sum: 21

Homeworks

  • Homework 1 (Questions) | Due date: Saturday – 1397 – 08 – 05
  • Homework 2 (Questions) | Due date: Monday – 1397  – 08  – 28
  • Homework 3 (Dr. Parsa Questions) | Due date: Received as Hard Copy

* Note: Your homework solutions should submit to compiler_iust@outlook.com.

Project

  • Project Proposal (PDF)
  • (New!) Project Due Dates (PDF)

TA Class Notes

  • Homework 1 descriptions

TA Class Final Scores

  • Final Scores (PDF)

FAQ

  • About your attendance in TA class:
    • Your attendance in the TA class is mandatory.

Announcements 

  • 1397-02-31: Please register your groups here (Due date: 1397-03-20).
  • 1397-02-04: HW03 was published.
  • 1397-02-02: Welcome to compilers course by Dr. Saeed Parsa!

Course Instructors

  • Dr. Saeed Parsa

Teaching Assistants

Class Time and Location

  • Semester 1396-2 (Spring 2018)
  • Main Lecture: Saturdays and Mondays, 08:00 – 10:00
  • Location: Classroom D104
  • TA Class: Mondays, 12:00 – 13:00, Classroom D104

Grading Policy

  • TA Class (Homework, Project, etc): 5 + 1
  • Exercises: 5
  • Exams: 10
  • Sum: 21

Homeworks

  • Homework 1 (Questions | Solutions: In classroom) | Due date: 1397-01-19 / end.
  • Homework 2 (Questions | Solutions: In classroom) | Due date: 1397-01-19 / end.
  • Homework 3 (Questions | Solutions: In classroom) | Due date: 1397-02-20 / end.
  • Homework 4 (Questions | Solutions) | Due date: 1397-03-20

* Note: Your homework solutions should submit to compiler_iust@outlook.com.

Project

  • Project Proposal (coming soon)

TA Class Notes

  • Homework 1 descriptions

FAQ

  • ?

Announcements 

  • 1396-1

Course Instructors

  • Dr. Saeed Parsa

Teaching Assistants

Class Time and Location

  • Semester 1396-2 (Spring 2018)
  • Main Lecture: Saturdays and Mondays, 08:00 – 10:00
  • Location: Classroom D104
  • TA Class: Mondays, 12:00 – 13:00, Classroom D104

Grading Policy

  • Comming soon . . .

Homeworks

  • HW01 / Solutions
  • HW02
  • HW03
  • HW04

Project

  • Project Proposal

TA Class Notes

  • HW1 descriptions

FAQ

  • ?

Nothing available.

Nothing available.