This subject taught an
important concepts and techniques in programming language implementation; to
develop a general appreciation of the constraints imposed on programming
languages by implementation considerations; and to understand the basic ideas
behind implementation of the programming language paradigms: imperative,
object-oriented, functional and logic programming. Topics covered include
compilers and interpreters: compiler structures; intermediate representations of
programs; and global tables, run-time structures, lexical analysis, parsing,
semantic analysis, code generation, optimisation. Both project were being
done by 3 students.
Project 1: Pretty printer
In this project the student
are given task to build a compiler's front end, which includes lexical analyser,
syntax analyser and pretty printer for a toy language called kevin07. I
was responsible for developing the lexical and syntax analyser.
Language & Tools: C, lex/flex and yacc/bison
project spec source code
Project 2: Code generator
This project is built on top
of the previous project where student should develop a complete compiler. In
this phase the student are given task to build a compiler's back end, which
includes semantic analyser, symbol table generator and code generator. I was
responsible for developing the code generator.
Language & Tools: C
project spec source code