1 / 21

Compiler Construction Course at University of Montenegro

Compiler Construction Course at University of Montenegro. 7 th Workshop on “Software Engineering Education and Reverse Engineering”, Risan, 9 – 14. Sep. 2007. Agenda. History Module structure Workload Learning outcomes Lectures and practicals Recommended books Future. History (1).

hao
Download Presentation

Compiler Construction Course at University of Montenegro

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Agenda • History • Module structure • Workload • Learning outcomes • Lectures and practicals • Recommended books • Future

  3. History (1) • Started in 1988 – professor Ratko Orlandić • one-semester elective module for4th year students, Mathematics and Computer Science programme • 2 lectures + 2 practicals per week • From 1993 – compulsory module

  4. History (2) • 2001 – first major revision • one-semester compulsory module for 3rd year students, academic studies, Computer Science programme, Mathematics and Computer Science programme, and also applied studies • 3 lectures + 2 practicals per week • 2006 – new revision, 2 lectures + 2 practicals, 5 ECTS credits, starting in 2008

  5. 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? • 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

  6. Module structure • Number of ECTS credits: 6 • Prerequisite knowledge • Students must have a prior knowledge of programming in C • Prerequisite modules • Programming I • Programming II

  7. Taken by • academic studies, Computer Science programme • academic studies, Mathematics and Computer Science programme • applied studies, Information technologies programme

  8. Workload • Lectures: 14 x 2 hr 15 min lectures. • Practicals: 14 x 1 hr 30 min practical. • Private study: 74.5 hrs. • 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)

  9. Learning Outcomes (1) • 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 • Student will also have a solid understanding on the underlying theory of formal languages

  10. Learning Outcomes (2) • 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 be able to implement the "back end" of a compiler for a simple programming language using the techniques presented in the lectures

  11. Learning Outcomes (3) • Student assess the advantages of standard programming language features with respect to their implementation and performance costs • Student read critically a programming language specification

  12. Content – Lectures (1) • Introduction to compiling • Automata. Regular expressions. Intro to lexical analysis • Lexical analysis. Flex. Grammars and languages • Top-down parsing • Bottom-upparsing. LR(0), LR(1), and SLR(1) • LALR parsers • Syntax-directed translation

  13. Content – Lectures (2) • Semantical analysis. Type checking for imperative languages • Run-time organization • Object-oriented languages • Intermediate languages • Code generation • Program analysis and transformation • Dataflow analysis • Loop optimization. Register allocation

  14. Content – Practicals (1) • DFA and NFA • Regular expressions. Transforming regular expressions to NFA • Transforming NFA to DFA. Minimizing number of states in DFA • FLEX examples • Writing and transforming context-free grammars

  15. Content – Practicals (2) • BISON examples • Intermediate code examples • Overview of MIPS • Using SPIM • Generating MIPS from AST

  16. Homeworks • 1st HW – Automata • 2nd HW – Flex for Decaf • 3rd HW – Grammars and languages • 4th HW – Building AST for Decaf using Bison • 5th HW – Semantic analyzer for Decaf • 6th HW – MIPS Code Generation

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

  18. Teaching Materials • Notes and exercise sheets are provided • 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 (www.pmf.cg.ac.yu)

  19. Students (2006-7)

  20. 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 ...

  21. Future • 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 • www.pmf.cg.ac.yu • compilers@rc.pmf.cg.ac.yu

More Related