A medium-size academic project about an interpreter of a small Python subset written in C++20, presented for the course of Theoretical Informatics at the University of Genoa. The project is divided in three great fields: Tokenization (lexical analysis), Parsing (syntactic analysis) and Interpreting (semantic analysis). Tokenization uses a standard iterative maximal munching approach, parsing was done transformating the grammar into an equivalent LL(1) one, mostly founded on the Dragon compiler book by computing the FIRST and FOLLOW sets for each token and do recursive calls, however this approach was deprecated for binary expressions when facing associativity ambiguities, for which an iterative approach was chosen. At last, interpreting is a standard approach, and covers dynamic type handling for integers, boolean and lists, and provides an (unused, but remains for future projects) scope system.
The UML diagram of the project is
Source code comments explain approaches on doing the tasks; ideas and solutions of problems when encountered throughout the project development. The grade received for the project was 11 out of 10 (A+).