Skip to main content
Skip header

Programming Languages and Compilers

* Exchange students do not have to consider this information when selecting suitable courses for an exchange stay.

Course Unit Code460-2018/03
Number of ECTS Credits Allocated4 ECTS credits
Type of Course Unit *Compulsory
Level of Course Unit *First Cycle
Year of Study *Third Year
Semester when the Course Unit is deliveredSummer Semester
Mode of DeliveryFace-to-face
Language of InstructionCzech
Prerequisites and Co-Requisites Course succeeds to compulsory courses of previous semester
Name of Lecturer(s)Personal IDName
BEH01Ing. Marek Běhálek, Ph.D.
Summary
Students get an overview of the area of programming, main programming paradigms (imperative, functional, logic) and their typical representatives. They also get some theoretical body of knowledge and practical experience of compiling methods, especially concentrated to the source code analysis and intermediate code synthesis phases. Students develop practical abilities to use compiler generators like JavaCC.
Learning Outcomes of the Course Unit
Students get an overview of the area of programming, main programming paradigms (imperative, functional, logic) and their typical representatives. They also get some theoretical body of knowledge and practical experience of compiling methods, especially concentrated to the source code analysis and intermediate code synthesis phases. Students develop practical abilities to use compiler generators like JavaCC.

After this lectures student should be able to effectively implement analyzers of a structured text data or of simple languages. Also they should understand concepts and constructions common for today's programming languages.
Course Contents
List of presentations:
1. Course introduction, introduction to compilers, compiler structure. Specification of programming languages.
2. Lexical analysis - finite automatons, regular expressions. Implementation of a lexical analyzer.
3. Syntactic analysis, top-down analysis. LL(1) grammars, computation of sets FIRST and FOLLOW.
4. Parser implementation - pushdown automaton for LL(1) languages. Recursive descent analysis. Compiler Compilers - javacc.
5. Syntax bottom – up analysis. LR(1) languages, tools: flex and Bison.
6. Internal representation of a program - intermediate program representation. Target code generating.
7. Semantic analysis, type checking
8. Run-time program structure - memory management.
9. Code optimization.
10. Advanced topics: operational semantics, syntax directed translation - attributed grammars.

List of laboratories (it is expected, that all laboratories will be in a computer laboratories)
1. Implementation of a simple interpreter of mathematical expressions (to compare it with more advanced approaches presented later).
2. Implementation of a lexical analyzer.
3. Implementation of the algorithms computing sets First and Follow.
4. Implementation of a parser using recursive descent.
5. Introduction to Compiler Compilers - javacc. Project's first phase - parser in javacc will be implemented.
6. Tool ANTLR - usage visitor design pattern.
7. Second phase in the project - implementation of a type checker in the project.
8. Introduction to target code generation for JVM
9. Implementation of a target code generator.
10. Project evaluation.
Recommended or Required Reading
Required Reading:
Torben Mogensen: Basics of Compiler Design - freely available at http://www.diku.dk/hjemmesider/ansatte/torbenm/Basics/
Beneš, M.: Překladače. Elektronická skripta.

Torben Mogensen: Basics of Compiler Design - zdarma dostupné online na http://www.diku.dk/hjemmesider/ansatte/torbenm/Basics/
Recommended Reading:
Aho, A. V., Lam M.S., Sethi, R., Ullman, J. D.: Compilers. Principles, Techniques, and Tools. Addison Wesley; 2nd edition (September 10, 2006). ISBN 0321486811.7

Pierce B.C.: Types and Programming Languages, MIT Press, 2002, ISBN: 9780262162098.
Aho, A. V., Lam M.S., Sethi, R., Ullman, J. D.: Compilers. Principles, Techniques, and Tools. Addison Wesley; 2nd edition (September 10, 2006). ISBN 0321486811.

Pierce B.C.: Types and Programming Languages, MIT Press, 2002, ISBN: 9780262162098.
Planned learning activities and teaching methods
Lectures, Tutorials, Project work
Assesment methods and criteria
Task TitleTask TypeMaximum Number of Points
(Act. for Subtasks)
Minimum Number of Points for Task Passing
Graded creditGraded credit100 (100)51
        Implementing compilerProject60 31
        Activity in laboratoriesLaboratory work40 0