Presentation is loading. Please wait.

Presentation is loading. Please wait.

4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 About the structure of a compiler construction course.

Similar presentations


Presentation on theme: "4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 About the structure of a compiler construction course."— Presentation transcript:

1 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 About the structure of a compiler construction course Dragan Bojić ETF Belgrade With credits to Zoran Budimac

2 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Summary of Answers to the Questionnaire – Ber, NS, Bg Relation to the corresponding course: 2: Already teach the corresponding course 1: Do not teach, but willing to participate in creation of joint course materials

3 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Summary of Answers... Lecturer’s availability and willingness: to CREATE joint teaching materials –2 very good –1 fair to USE joint teaching materials –3 very good

4 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Summary of Answers... Place of the course in the curriculum BER: 3rd semester, 60 + 30 hours, ~150 students NS: 7&8 semester, 60 + ? Hours BG: 7&8 semester, 70 + 56 hours, ~90 students

5 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Summary of Answers... Methodology, exams, and grade BER: students required to finish a practical project NS: before: written & oral exam now: pass if regular practical work, otherwise oral exam BG: obligatory practical homework (one time) + written & oral exam

6 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Summary…Teaching Materials Sources of the course contents and materials 1 - almost completely my own 1 - partly my own and partly taken from several sources 1 - almost completely rely on the specific literature Availability of teaching materials 3 – electronic form (in German or in Serbian)

7 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Summary…Topics Note: NS and BER have basically the same curriculum and are using the case study to drive the course. Other topics (independent of the case study) are also covered (other methods of Syntax analysis, for example). On the other hand, Bg curriculum is mostly theoretical and covers more concepts.

8 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Summary…Topics NS and B Overview: Fundamentals, subtasks of a compiler, pass structures Elements of automata theory and formal language theory, incl. grammars Introduction to the prog. language used in case study Lexical analysis Syntax analysis: LL(1), Recursive descent, LL(K), LR(K) Semantic analysis (and symbol tables) Definition of the target language (virtual machine) and code interpretation Code generation Elements of code optimization

9 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Summary…Topics Belgrade Lexical analysis Finite state automata. Regular expressions. Deterministic and non-deterministic automata. Minimization of automata. Automata implementation techniques. Keyword recognition techniques. Lexical analyzer generators. Context free grammars. Formal languages and grammars. Grammar transformations. Ambiguous grammars. Regular and right-linear grammars. Pushdown automata. Translation. Cycling.

10 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Summary…Topics Belgrade (…) Syntax directed translation. attributive-translation grammars. Top-down analysis. Parser construction for S, Q and LL(1) grammars. Error recovery. Recursive descent method. Parser construction for L attributive translation grammars. Bottom-up analysis. Shift-identify parsers. Shift-reduce parsers. Error recovery. LR i SLR grammars. Processing of S attributive translation grammars.

11 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Summary…Topics Belgrade (…) Run time environment. Memory allocation strategies. Activation records. Static scope with and without procedure nesting. Access links and Displays. Dynamic scope. Parameter passing mechanisms. Construction of symbol tables. Equivalence trees. Code generation. Selection of instructions Register allocation. Basic blocks and flow graphs. Basic block transformations. Simple code generator.

12 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Summary…Case Studies BER: Pascal to P Code Compiler written in C (2500 LOC). There is also Java implementation with visual components. NS: Pascal compiler written in Modula 2 (translation of the original Pascal implementation from [Hansen]) BG: Small parts of Ada/CS compiler written in ADA from [LeBlanc]. Small parts of sampleC compiler written in C from [Schreiner et al]. Small parts of Basic Interpreter from [Lewis et al].

13 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Summary…Recommended Literature BER: ? NS: 1. B. Hansen: “On Pascal Compilers”, Prentice-Hall, 1985. 2. J.P.Tremblay, P.G.Sorenson: “ The Theory and Practice of Compiler Writing”, John Wiley & Sons, 1985. BG: 1.P.M. Lewis, D. J. Rosenkrantz, R.E. Stearns, Compiler Design Theory, Addison-Wesley, 1976. 2.A. R. Sethi, J.D. Ullman, Compilers/Principles, Techniques and Tools, Addison-Wesley, 1986 3.C. Fischer, R. LeBlanc, Crafting a Compiler, Benjaming-Cummings 1988 4.A. Schreiner, H.G. Friedman, Introduction to Compiler Construction with UNIX, Prentice-Hall, 1985

14 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Summary…Improvements BER: New topics: translation of OO constructs, optimizations New case study (input language should not be Pascal) NS: To add more theory New case study (Java as an implementation language) To make course more interesting to students BG: To add a complete case study To omit some topics, to add new about OO constructs To make course more interesting to students (“pure theoretical” approach not very attractive)

15 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Possible path to the Joint Course JCCC should be based on particular compiler as case study (% of lectures) and other theoretical parts not related to the case study Transition path for BER and NS to JCCC: –Change of case study –Introduction of some new theoretical topics Transition path for BG to JCCC: –Introduction of complete case study –Less theory, more practical approach

16 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Candidates for a new Case Study + = desirable Real life input languages and educational languages (+) Object-orientation in the input language (+), and/or OO in compiler implementation Contemporary implementation language (+)

17 4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 Candidates for a new Case Study KJC/Kopi and IBM Jikes: open source full (-) java compilers and VM written in java/C++ Tiger – edu, nonOO (-)target language, impl in Java, good book(+), funct. Style (-) Microsoft Rotor – ‘edu” C# compiler and.NET runtime written in C# (complex -) microJava: prof. Mössenböck, Univ. of Linz, subset of java, VM, written in java – very interesting alternative, no(?) book, but there is 20page specification of language syntax and VM.


Download ppt "4 th Workshop “Software Engineering Education and Reverse Engineering” Zagreb 5 – 12 September 2004 About the structure of a compiler construction course."

Similar presentations


Ads by Google