Goran Šuković, University of Montenegro 1/21 Compiler Construction Course at University of Montenegro 7 th Workshop on “Software Engineering Education.

Slides:



Advertisements
Similar presentations
Introduction to Compiler Construction
Advertisements

Compiler Construction by Muhammad Bilal Zafar (AP)
4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 About the structure of a compiler construction course.
Goran Šuković, University of Montenegro 1/18 Faculty of Sciences Podgorica University of Montenegro 7 th Workshop on “Software Engineering Education and.
Lecture 01 - Introduction Eran Yahav 1. 2 Who? Eran Yahav Taub 734 Tel: Monday 13:30-14:30
OV-1.1 CSE4100 CSE4100 Programming Language Translation Prof. Steven A. Demurjian, Sr. Computer Science & Engineering Department The University of Connecticut.
Greg MorrisettFall  Compilers.  (duh)  Translating one programming language into another.  Also interpreters.  Translating and running a language.
Cpeg421-08S/final-review1 Course Review Tom St. John.
1 Semantic Processing. 2 Contents Introduction Introduction A Simple Compiler A Simple Compiler Scanning – Theory and Practice Scanning – Theory and Practice.
January 12, Compiler Design Hongwei Xi Comp. Sci. Dept. Boston University.
FE.1 CSE4100 Final Exam Advice and Hints Prof. Steven A. Demurjian, Sr. Computer Science & Engineering Department The University of Connecticut 191 Auditorium.
January 19, Compiler Design Hongwei Xi Comp. Sci. Dept. Boston University.
College of Computer Science & Technology Compiler Construction Principles & Implementation Techniques -1- Compiler Construction Principles & Implementation.
Compiler Construction
BİL744 Derleyici Gerçekleştirimi (Compiler Design)1.
Summer 02-03Programming Language Concepts1 Programming Language Concepts (CS 360) Lecture 1: Overview, Grammars, and Little Languages Jeremy R. Johnson.
COP4020/CGS5426 Programming languages Syllabus. Instructor Xin Yuan Office: 168 LOV Office hours: T, H 10:00am – 11:30am Class website:
September 7, September 7, 2015September 7, 2015September 7, 2015 Azusa, CA Sheldon X. Liang Ph. D. Computer Science at Azusa Pacific University.
OPERATING SYSTEMS AND LANGUAGE TRANSLATORS CIS 2380 TERM 2 – LANGUAGE TRANSLATORS Lee McCluskey – 23/09/20151.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Parser-Driven Games Tool programming © Allan C. Milne Abertay University v
Introduction to Compiler Construction Robert van Engelen COP5621 Compiler Construction Copyright Robert.
Compiler course 1. Introduction. Outline Scope of the course Disciplines involved in it Abstract view for a compiler Front-end and back-end tasks Modules.
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style COMPILER DESIGN Review Joey Paquet,
Some issues in teaching compiler course in Polytechnic University Tirana Prof.Asoc.Dr Elinda Kajo Mece Polytechnic University of Tirana.
Programming Languages & Translators (CE 359) Fall 2013 Prof. Dr: Ahmed El Nahass Lecture 1 1 FACULTY OF ENGINEERING COMPUTER ENGINEERING Prof.Dr Ahmed.
Goran Šuković, University of Montenegro 1/24 Experiences with Diploma Projects at University of Montenegro 10 th Workshop on “Software Engineering Education.
Joey Paquet, Lecture 12 Review. Joey Paquet, Course Review Compiler architecture –Lexical analysis, syntactic analysis, semantic.
May 31, May 31, 2016May 31, 2016May 31, 2016 Azusa, CA Sheldon X. Liang Ph. D. Computer Science at Azusa Pacific University Azusa Pacific University,
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Compiler design Lecture 1: Compiler Overview Sulaimany University 2 Oct
Introduction to Compiling
COMPILER CONSTRUCTION Lesson 1 – TDDD16 TDDB44 Compiler Construction 2010 Kristian Stavåker (Erik Hansson.
Compiler Construction (CS-636)
Compiler Introduction 1 Kavita Patel. Outlines 2  1.1 What Do Compilers Do?  1.2 The Structure of a Compiler  1.3 Compilation Process  1.4 Phases.
Chapter 1: Introduction 1 Compiler Designs and Constructions Chapter 1: Introduction Objectives: Course Objectives Introduction Dr. Mohsen Chitsaz.
Course Overview for Compilers J. H. Wang Sep. 14, 2015.
Boris Milašinović Faculty of Electrical Engineering and Computing University of Zagreb, Croatia 15th Workshop on "Software Engineering Education and Reverse.
Introduction. Introduction Traditional view of a compiler tool to translate high-level (imperative) code into optimized machine code large, complicated.
1 CS308 Compiler Theory. 2 Course Information Instructor : –Prof. Minyi Guo –Yao Shen Course.
Compilers: Prelim/0 1 Compiler Structures Objective – –to give some background on the course , Semester 1, Who I am: Andrew Davison.
Course Overview for Compilers J. H. Wang Sep. 20, 2011.
ICS312 Introduction to Compilers Set 23. What is a Compiler? A compiler is software (a program) that translates a high-level programming language to machine.
1 Compiler Construction Vana Doufexi office CS dept.
Presented by : A best website designer company. Chapter 1 Introduction Prof Chung. 1.
CS416 Compiler Design1. 2 Course Information Instructor : Dr. Ilyas Cicekli –Office: EA504, –Phone: , – Course Web.
Review 1.Structure of the course Lexical Analysis Syntax Analysis Grammar & Language RG & DFA Top-down LL(1) Parsing Bottom-Up LR Layered Automation Semantic.
2016/7/9Page 1 Lecture 11: Semester Review COMP3100 Dept. Computer Science and Technology United International College.
CS140 – Computer Programming 1 Course Overview First Semester – Fall /1438 – 2016/2017 CS140 - Computer Programming 11.
COMP Compilers Lecture 1: Introduction
COP 5621 Compiler Construction
Chapter 1 Introduction.
CMPUT Compiler Design and Optimization
Chapter 1 Introduction.
课程名 编译原理 Compiling Techniques
Compiler Lecture 1 CS510.
CS416 Compiler Design lec00-outline September 19, 2018
Introduction to Compiler Construction
Lecture 2: General Structure of a Compiler
Introduction CI612 Compiler Design CI612 Compiler Design.
CPSC 388 – Compiler Design and Construction
COMP Compilers Lecture 1: Introduction
Subject: Language Processor
Compiler Structures 0. Preliminaries
CS416 Compiler Design lec00-outline February 23, 2019
Introduction to Compiler Construction
Compiler Construction
Lec00-outline May 18, 2019 Compiler Design CS416 Compiler Design.
Introduction to Compiler Construction
Review for the Midterm. Overview (Chapter 1):
Presentation transcript:

Goran Šuković, University of Montenegro 1/21 Compiler Construction Course at University of Montenegro 7 th Workshop on “Software Engineering Education and Reverse Engineering”, Risan, 9 – 14. Sep

Goran Šuković, University of Montenegro 2/21 Agenda History History Module structure Module structure Workload Workload Learning outcomes Learning outcomes Lectures and practicals Lectures and practicals Recommended books Recommended books Future Future

Goran Šuković, University of Montenegro 3/21 History (1) Started in 1988 – professor Ratko Orlandić Started in 1988 – professor Ratko Orlandić one-semester elective module for 4th year students, Mathematics and Computer Science programme one-semester elective module for 4th year students, Mathematics and Computer Science programme 2 lectures + 2 practicals per week 2 lectures + 2 practicals per week From 1993 – compulsory module From 1993 – compulsory module

Goran Šuković, University of Montenegro 4/21 History (2) 2001 – first major revision 2001 – first major revision one-semester compulsory module for 3 rd year students, academic studies, Computer Science programme, Mathematics and Computer Science programme, and also applied studies one-semester compulsory module for 3 rd year students, academic studies, Computer Science programme, Mathematics and Computer Science programme, and also applied studies 3 lectures + 2 practicals per week 3 lectures + 2 practicals per week 2006 – new revision, 2 lectures + 2 practicals, 5 ECTS credits, starting in – new revision, 2 lectures + 2 practicals, 5 ECTS credits, starting in 2008

Goran Šuković, University of Montenegro 5/21 Why to study compilers? The number of people who write compilers is small, so why is a module about compiler construction a compulsory part of a computer science course? The number of people who write compilers is small, so why is a module about compiler construction a compulsory part of a computer science course? One reason is that, though few graduates of the course will end up writing compilers, all will have to use them One reason is that, though few graduates of the course will end up writing compilers, all will have to use them Many of the techniques used in compilers have application in other areas such as dialogue and human-computer interface design Many of the techniques used in compilers have application in other areas such as dialogue and human-computer interface design

Goran Šuković, University of Montenegro 6/21 Module structure Number of ECTS credits: 6 Number of ECTS credits: 6 Prerequisite knowledge Prerequisite knowledge –Students must have a prior knowledge of programming in C Prerequisite modules Prerequisite modules –Programming I –Programming II

Goran Šuković, University of Montenegro 7/21 Taken by academic studies, Computer Science programme academic studies, Computer Science programme academic studies, Mathematics and Computer Science programme academic studies, Mathematics and Computer Science programme applied studies, Information technologies programme applied studies, Information technologies programme

Goran Šuković, University of Montenegro 8/21 Workload Lectures: 14 x 2 hr 15 min lectures. Lectures: 14 x 2 hr 15 min lectures. Practicals: 14 x 1 hr 30 min practical. Practicals: 14 x 1 hr 30 min practical. Private study: 74.5 hrs. Private study: 74.5 hrs. Assessment: Assessment: –Midterm – 3 hours written exam (worth 35 marks) –Final – 3 hours written exam (worth 35 marks) –Homeworks – 6 HW (worth 4 marks each) –Quizzes – 3 quizzes (worth 2 marks each)

Goran Šuković, University of Montenegro 9/21 Learning Outcomes (1) The aim of this module is to introduce the student to the theory and practice of programming language compilation The aim of this module is to introduce the student to the theory and practice of programming language compilation It works through the “front end” of compilation: lexical and syntax analysis. By the middle of the module the student will be in a position to write a lexical scanner and a parser for a context-free language, including the use of compiler tools It works through the “front end” of compilation: lexical and syntax analysis. By the middle of the module the student will be in a position to write a lexical scanner and a parser for a context-free language, including the use of compiler tools Student will also have a solid understanding on the underlying theory of formal languages Student will also have a solid understanding on the underlying theory of formal languages

Goran Šuković, University of Montenegro 10/21 Learning Outcomes (2) Student should have a better appreciation of good programming practice in terms of program compilation Student should have a better appreciation of good programming practice in terms of program compilation Student should be able to describe compiler construction methods and algorithms, and especially apply them to examples Student should be able to describe compiler construction methods and algorithms, and especially apply them to examples Student be able to implement the "back end" of a compiler for a simple programming language using the techniques presented in the lectures Student be able to implement the "back end" of a compiler for a simple programming language using the techniques presented in the lectures

Goran Šuković, University of Montenegro 11/21 Learning Outcomes (3) Student assess the advantages of standard programming language features with respect to their implementation and performance costs Student assess the advantages of standard programming language features with respect to their implementation and performance costs Student read critically a programming language specification Student read critically a programming language specification

Goran Šuković, University of Montenegro 12/21 Content – Lectures (1) Introduction to compiling Introduction to compiling Automata. Regular expressions. Intro to lexical analysis Automata. Regular expressions. Intro to lexical analysis Lexical analysis. Flex. Grammars and languages Lexical analysis. Flex. Grammars and languages Top-down parsing Top-down parsing Bottom-up parsing. LR(0), LR(1), and SLR(1) Bottom-up parsing. LR(0), LR(1), and SLR(1) LALR parsers LALR parsers Syntax-directed translation Syntax-directed translation

Goran Šuković, University of Montenegro 13/21 Content – Lectures (2) Semantical analysis. Type checking for imperative languages Semantical analysis. Type checking for imperative languages Run-time organization Run-time organization Object-oriented languages Object-oriented languages Intermediate languages Intermediate languages Code generation Code generation Program analysis and transformation Program analysis and transformation Dataflow analysis Dataflow analysis Loop optimization. Register allocation Loop optimization. Register allocation

Goran Šuković, University of Montenegro 14/21 Content – Practicals (1) DFA and NFA DFA and NFA Regular expressions. Transforming regular expressions to NFA Regular expressions. Transforming regular expressions to NFA Transforming NFA to DFA. Minimizing number of states in DFA Transforming NFA to DFA. Minimizing number of states in DFA FLEX examples FLEX examples Writing and transforming context-free grammars Writing and transforming context-free grammars

Goran Šuković, University of Montenegro 15/21 Content – Practicals (2) BISON examples BISON examples Intermediate code examples Intermediate code examples Overview of MIPS Overview of MIPS Using SPIM Using SPIM Generating MIPS from AST Generating MIPS from AST

Goran Šuković, University of Montenegro 16/21 Homeworks 1 st HW – Automata 1 st HW – Automata 2 nd HW – Flex for Decaf 2 nd HW – Flex for Decaf 3 rd HW – Grammars and languages 3 rd HW – Grammars and languages 4 th HW – Building AST for Decaf using Bison 4 th HW – Building AST for Decaf using Bison 5 th HW – Semantic analyzer for Decaf 5 th HW – Semantic analyzer for Decaf 6 th HW – MIPS Code Generation 6 th HW – MIPS Code Generation

Goran Šuković, University of Montenegro 17/21 Recommended Books Torczon, Cooper - Engineering a Compiler, Morgan Kaufmann 2002 Torczon, Cooper - Engineering a Compiler, Morgan Kaufmann 2002 Aho A.V. et al. - Compilers: Principles, Techniques and Tools, 2 nd Edition, Addison Wesley 2006 Aho A.V. et al. - Compilers: Principles, Techniques and Tools, 2 nd Edition, Addison Wesley 2006 Andrew W. Appel - Modern Compiler Implementation in C/Java/ML, Cambridge University Press 1998/2002 Andrew W. Appel - Modern Compiler Implementation in C/Java/ML, Cambridge University Press 1998/2002 D Grune et al. - Modern Compiler Design, Wiley 2000 D Grune et al. - Modern Compiler Design, Wiley 2000

Goran Šuković, University of Montenegro 18/21 Teaching Materials Notes and exercise sheets are provided Notes and exercise sheets are provided Copies of slides and examples used in lectures can be downloaded from the module web page Copies of slides and examples used in lectures can be downloaded from the module web page Information and feedback are posted on the module web pages ( Information and feedback are posted on the module web pages (

Goran Šuković, University of Montenegro 19/21 Students (2006-7) Bologna students Non Bologna 20 students, 14 passed, A – 0 B – 3 C – 3 D – 2 E – 6 F – 6 26 students, 12 passed 10 – 0 9 – 0 8 – 1 7 – 6 6 – 5 5 – 14

Goran Šuković, University of Montenegro 20/21 Student' remarks Practicals/exams/lecturer are too demanding Programming in C is very hard I need more time for homeworks I don't know how to use pointers in C... read data from files... start Flex...

Goran Šuković, University of Montenegro 21/21 Future From 2008 From 2008 –Substantial reduction of lectures –Less demanding homeworks –Using Java instead C –Using JLex and JBison instead Flex and Bison –MIPS or x86 or... More information More information –