Skip to main content
Skip header

Programming Languages and Compilers

Type of study Bachelor
Language of instruction Czech
Code 460-2018/03
Abbreviation PJP
Course title Programming Languages and Compilers
Credits 4
Coordinating department Department of Computer Science
Course coordinator Ing. Marek Běhálek, Ph.D.

Subject syllabus

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.

E-learning

Basic materials are available on the educator's website: http://behalek.cs.vsb.cz/wiki/index.php/Programming_Languages_and_Compilers
Consultation through MS Teams.

Literature

Torben Mogensen: Basics of Compiler Design - freely available at http://www.diku.dk/hjemmesider/ansatte/torbenm/Basics/

Advised literature

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.