Lund University →
Faculty of Engineering →
Department of Computer Science
Week by week
Links will work after the corresponding lecture. Before that, they may give a Not Found or 404 error. Meanwhile, if you would like to take a look at last year's slides, etc., they are available here.
Go to:
Week 1,
Week 2,
Week 3,
Week 4,
Week 5,
Week 6,
Week 7,
Week 8,
Exam,
Week 1
Lecture 1: Introduction. Mon 13-15, August 28, 2017, MA:1
- Read the Course Program and sign up on Moodle (for quizzes) and Piazza (the Q&A forum).
- Slides
- Moodle Quiz
- Appel Book: Ch 1-1.2 (See the course program for how to access the on-line book)
Sign up for lab sessions
- Deadline: Thursday, August 31, 2017
- Sign up via the SAM system
Assignment 0. Java, Unix, and Gradle.
- Do this assignment on your own. Includes basic skills you need in the other assignments.
- Downloads: A0.pdf, A0-JavaGradleProject.zip.
- Estimated typical effort: 0-4 hours, depending on your current proficiency.
Lecture 2: Regular Expressions, Scanning. Tue 10-12. August 29. MA:7
Assignment 1. Scanning and simple parsing.
- Deadline: the Lab session week 2.
- Covers: Lectures 2 and 3.
- Downloads: A1.pdf, A1-CalcParse.zip.
- Estimated typical effort: 5 hours.
Week 2
Lecture 3: Context-free grammars. Recursive-descent parsing. Mon 13-15.
- Slides
- Moodle Quiz
- Appel Book: Parts of Ch 3 (38-47). (Intro to Parsing 3, Context-free grammars 3.1, intro to Predictive parsing 3.2.)
- Appel Exercises: 3.1-3.2. (No solutions provided)
Lecture 4: Ambiguities. LL problems. Tue 10-12.
Assignment 2. LR parsing and AST building
Lab session. Thu/Fri
- For approving and getting help with Assignment 1.
Week 3
Lecture 5: LL parsing. Abstract Syntax Trees. Mon 13-15.
Lecture 6: LR parsing. Visitors. Tue 10-12.
- Slides 6A,
Slides 6B
- Moodle Quiz 6A
- Appel Book: Ch 3.3 and 3.4 (55-76). (LR parsing and Using parser generators)
- For the visitor pattern, see the course book from OMD course (R. Martin: Agile Software Development), on its chapter on visitors (525-541), or the wikipedia article on Visitors.
- Appel Exercises: 3.4-3.6 and 3.8-3.10 (No solutions provided)
Assignment 3. Visitors, Aspects, and Attribute Grammars.
Lab session. Thu/Fri
- For approving and getting help with Assignment 2.
Week 4
Lecture 7: Aspects. Attribute Grammars. Mon 13-15.
Lecture 8: Reference attributes, Semantic Analysis. Tue 10-12.
- Slides
- Appel Book: Ch 5 (103-115). Semantic Analysis. However, you may skip the section on EFFICIENT FUNCTIONAL SYMBOL TABLES (107-108).
- An Introductory Tutorial on JastAdd Attribute Grammars, Springer, LNCS 6491, 2011, preprint, published version, sections 1-5. (To access the published version, you need to be on the University network. But the difference is only typographic.)
- Exercises: Do exercises 3-4, 6-9, 14 in the above paper. There are solutions in the back of the paper, but try to solve the problems on your own before looking at them.
- Exercises: There are also exercises in the slides for this lecture.
Assignment 4. Semantic analysis using reference attribute grammars.
Lab session. Thu/Fri
- For approving and getting help with Assignment 3.
Week 5
Lecture 9: Guest lecture by Jesper Öqvist. Mon 13-15.
Lecture 10: Runtime Systems for Procedural Languages. Tue 10-12.
- Slides
- Appel Book: Ch 6-6.1 on procedural run-time systems (116-126).
Focus on
Introduction, STACK FRAMES, THE
FRAME POINTER, REGISTERS, STATIC LINKS.
- Skim through HIGHER-ORDER
FUNCTIONS, PARAMETER PASSING, RETURN ADDRESSES.
Skip FRAME-RESIDENT VARIABLES
Assignment 5. Interpreter and static analysis
- Deadline: the Lab session week 6.
- Covers: Lectures 9, 10.
- Downloads: A5.pdf.
- Estimated typical effort: 15 hours.
Lab session. Thu/Fri
- For approving and getting help with Assignment 4.
Week 6
Lecture 11: Code generation. Mon 13-15.
- Slides
- Appel Book: Ch 7. Translation to Intermediate Code (only the Introduction on page 136. Skip 7.1 and
onwards)
Lecture 12: Hour 1: More on code generation. Hour 2: Guest lecture Tue 10-12.
- Slides for first hour
- The second hour will be a guest lecture:
GPU Compiler Construction at Arm (slides)
Erik Hogeman and Karl Hylen, Arm, Lund
Abstract: The topic of this guest lecture will be what it's like to work as a compiler engineer at Arm, developing compilers for Graphics Processing Units (GPUs). The presentation will give a general introduction to GPU compilers and graphics programming languages, and give some insight into the day-to-day challenges you have working with compilers in a competitive industry. Finally, some opportunities for students at Arm are presented.
Assignment 6. Code generation
- Deadline: the Lab session week 7.
- Covers: Lectures 10, 11, 12.
- Downloads: A6.pdf, A6-CalcASM.zip.
- Estimated typical effort: 12 hours.
Lab session. Thu/Fri
- For approving and getting help with Assignment 5.
Week 7
Lecture 13: Object-oriented languages, Runtime Optimization. Mon 13-15.
- Slides
- Appel Book: Ch 14-14.2 (283-286).
- Two papers for the interested (will not be on the exam):
Lecture 14: Course review before exam. Tue 10-12.
Catch-up lab session.
- Tuesday, Oct 10, 15-17, E:Varg.
Lab session. Thu/Fri
- For approving and getting help with Assignment 6.
Sign up for exam.
You need to sign up in advance for the exam. The deadline is Monday Oct 16. See info in Swedish or English.
Week 8
Catch-up lab session.
- Tuesday, Oct 17, 15-17, E:Gamma.
Catch-up lab session.
- Friday, Oct 20, 13-15, E:Gamma.
Study old exams
Exam
At the exam, you may use the following documents. Copies of them will be available at the exam. You do not need to bring your own.
You may also use a dictionary from English to your native language.
Ordinary exam
- Will be held on Wednesday, October 25, 2017, 14-19, in MA:10.
- You need to have finished all lab/assignments to be allowed to take the exam.
- You need to sign up for the exam by Oct 16. See info in Swedish or English.
- The exam and the solution are now available: 171025.pdf,
sol171025.pdf
- The corrected exams are available from Wednesday Nov 22, 2017, for inspection at Lena Ohlsson's office, E:2179, 09:30-11:30, 12:45-13:30 (except Fridays).
- Tentavisning: If you would like to discuss your exam, there will be possibility for that on Thursday Nov 23, 2017, 16:45-17:15, E:4130 (4th floor, south part of the E-house).
Reexam
- Will be held on Tuesday, April 10, 2018, 08-13, in MA 8B
- You need to sign up for the reexam. See info in Swedish or English.
- The reexam is now corrected (April 19, 2018) and can be inspected at Lena Ohlsson's office, E:2179, 09:30-11:30, 12:45-13:30 (except Fridays).