JakuJ / mini-lang

A simple programming language compiled to .NET's CIL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

THE compiler for mini++

This repository contains the final project for the course on compilers at MiNI PW.

Disclaimer: It was part of the requirements that all the logic is in one .cs file. I've tried my best to make it readable though 👀

Requirements

  • gplex and gppg parser generators to process the .lex and .y files
  • A C# 7.3 compiler

It's probably easiest to just open the solution in an IDE like Rider or Visual Studio and build using that.

This project was exclusively developed on Mac OS – if you're using Windows, switch to the windows branch. That's where the version that works under Visual Studio 2017 resides.

Caveats

You need to to add a reference to the QUT.ShiftReduceParser.dll library – you either already have it as it came with gppg, or you need to build it from source.

You also have to generate the Scanner.cs and Parser.cs files using gplex and gppg before build. I've set it up as a build step, but the binary paths are hard-coded, so you need to either change them or do it manually.

Unit tests

The project is accompanied with a range of NUnit-based unit tests. Combined with code coverage analysis, they were incredibly useful at diagnosing bugs.

The tests are divided into three groups:

The compiler has also been repeatedly tested with the community sourced tests.

About

A simple programming language compiled to .NET's CIL


Languages

Language:C# 85.6%Language:Yacc 9.7%Language:Lex 4.7%