Yet another mc Compiler

This repository holds the code-base from UIBK compiler construction course group 5.

Authors

  • Andreas Peintner (1515339)
  • Josef Gugglberger (1518418)
  • Tobias Kupek (11828471)

Prerequisites

  • Meson in a recent version (0.44.0) (you may want to install it via pip3 install --user meson)
  • Ninja
  • time, typically located at /usr/bin/time, do not confuse this with the Bash built-in
  • flex for generating the lexer
  • bison for generating the parser
  • A compiler supporting C11 — typically GCC or Clang

Build Instructions

First, generate the build directory.

$ meson builddir
$ cd builddir

Meson creates Ninja build files. Let's build.

$ ninja

Unit tests can be run directly with Ninja (or Meson).

$ ninja test

For integration testing we try to compile .mc programs and compare their output for a given input.

$ ../scripts/run_integration_tests

Taken from the Meson Documentation:

If you enable coverage measurements by giving Meson the command line flag -Db_coverage=true, you can generate coverage reports. Meson will autodetect what coverage generator tools you have installed and will generate the corresponding targets. These targets are coverage-xml and coverage-text which are both provided by Gcovr and coverage-html, which requires Lcov and GenHTML or Gcovr with html support.

Known Issues

  • String size of blocks in CFG is fixed, thus the stack smashes on large blocks (around 1700 chars).
  • -f flag to limit scope to a function is only working on simple functions without function calls.
  • -q quiet flag does not work for scanning and parsing errors

Milestones

All milestones are explained in more detail here: