Navigation
Page categories
Outline:
Last modification
2025-09-04
This is smol web. If you don't like it, fix your browser.

Infopage about the C++ lab of NPRG041.

Groups:

Reading material:

Lab requirements#

To get the credit, you have to attend the course reasonably (at least accordingly to your knowledge of the topic), do the homework (see below) and finish an individual project (also below).

You will be assigned several points for finishing the homework. These will be added to the points from the final test, therefore improving your final grade for the whole course. Details are available in the main course slides.

Depending on many factors, students from Erasmus programs may need a completely different set of rules to fit into different time limits. If you are an ERASMUS student, contact us!

Homework#

There are two homework assignments. Please refer to ReCodex.

Project#

Each student has to create an individual project and submit it to get the credit. Topics of the projects may vary wildly, but you should discuss your topic before the end of November so that it is agreed upon. Size of the project is not an issue and largely depends on the topic, around 500 lines of (neat) C++ code is a good guideline (on the other hand, packing the same functionality into a smaller program using e.g. advanced language features is even better).

Bad topics:

Good topics:

Deadlines:

Submission:

You must develop and submit the project using git in the corresponding MFF Gitlab group. The submission process is simplified — you just notify me that the project is ready there. Registration to Gitlab is open for all students with valid CAS UK credentials. After you register, let me know to assign you to the group.

Submission guidelines:

Lab timeline#

Source code from the labs will be available here.

1 October 2nd#

Slight introduction into C, basic data types and a bit of pointers.

2 October 9th#

Manual memory management, linked lists, more pointers. A look on what’s happening during the compilation.

3 October 16th#

C++ introduction — references and const references, overloading, templates.

4 October 23th#

C++ objects are resources, working with strings.

Danger: the source code produced in the lab contains some mistakes (esp. regarding the empty strings as null pointers). I have added comments in several places I noticed that are obviously missing the null check. Also, you will find

5 October 30th#

Fun with STL and containers.

6 November 6th#

More STL, more iterators.

7 November 13th#

Run-time polymorphism and virtual methods; a zoological example with animals.

8 November 20th#

Using small proxy classes as helpers for creating various functionality that is not directly supported in C++, namely properties and safe references.

9 November 27th#

Parsing volume 1: Tokenization + a parser of a small language. Languages and ASTs are a nice practice for working with smart pointers and classes behind a virtual interface.

The parser we used is a recursive descent parser, which is not a very good choice for C++, but it is the simplest type of the “generic” parsers. Other choices with less straightforward representation of the grammar include e.g. Earley parser, CYK, LL or shift-reduce parsers that are used for most programming languages.

10 December 4th#

Parsing volume 2.

Bonus material#