Blue Flower

Course description and prerequisites

In this course, students will gain insights into designing and constructing working compilers, translating programs from a source into a destination language. The course will cover the structure of compilers, lexical, syntax and semantics analysis and intermediate code generation. As a part of the coursework students will experience using a compiler generator such as Antlr to develop a working compiler translating programs written in a given language into MsIL or ByteCode.

Motivation

Why should I learn compilers? Am I going to write a compiler?!!! How many Compilers are there?

Compilers and high-level languages are as central to the information age as semiconductor technology [ Next 50 Years.pdf ]

Teaching Assistants:

Mohammad Javad Amiri

Mostafa Khoramabadi Arani

Amir Mohammad Zade Lajevardi

Research Interests

·         Visual languages

·         Syntactic pattern recognition

·         Error recovery

Main References and Handouts

Handouts

References

1- JRefactory: A software tool for AST generation from Java

1. Compiler Writing, Alfred V. Aho. 2nd edition, 2007

2- Writing a compiler to generate bytecode, JVM

2. Modern Compiler Implementation In Java, 2003  

3- Antlr: A Compiler Generator, PPT

3. Algorithms for Compiler Design, O.G. Kakde

4. IL: Net Intermediate LanguagePPT1PPT2PPT3

 

5. Gold Parser : A compiler generator developed in Delphi

 

6. Advanced Compiler (.doc , .pdf)

 

Lectures 

References

Subject

Date

Next 50 years

Next 50 years with compilers

 

Next 50 years

Next 50 years with compilers

 

Chapter-1

Stages of a compiler

 

Chapter-2 :  1-8

Lexical Analysis : Lexical rules

 

Chapter-2 : 8-24

How to develop a Lexical Analyzer

 

Lex & yaccLex

Lex : Lexical analyzer generator

 
 

Exercises

 

Chapter-3 : 1-13

Grammars and parsers

 

Chapter-3: 1-13

Rightmost and leftmost derivations

 

Chapter-3

First and follow sets

 

Chapter-4

Top-down parsers

 
 

First Exam

 

Chapter-4

Top-down pars table

 

Chapter-4

Recursive Descent Parsers

 

Chapter-5

Bottom up  Parsers

 

Chapter-5

LR(1) Parsers

 

Chapter-5

LALR(1) Parsers

 

Chapter-5

SLR(1) Parsers

 

Chapter-5

Ambiguous Grammars

 

Lex & YaccAntlr

Parser Generators ( Yacc & Antlr )

 
 

Second Exam

 

Chapter7.pdf

Intermediate Codes

 

JRefactory, Chapter7

Abstract Syntax Trees

 

Chapter7.pdf

Three address Code

 

Chapter7.pdf

Syntax Directed Translation

 

Chapter7.pdf

Attributed Grammars

 

Chapter8.pdf

Type Checking

 

2. Jasmine & JVM,  IL

Byte Code & IL intermediate code generations