Bachelorthesis: Interpretation of Expressions containing Tuple-, Intersection-, and Union-Types in MontiCore

Note: This topic (in an extended form) can be taken as master thesis as well.

The language workbench MontiCore offers language components to support the creation of expression languages and languages containing expressions, statements, etc. While code generation is supported, it is not ideal for every use case, as it requires recompilation on every change. This is not feasible for programs that allow entering new expressions during runtime, e.g., spreadsheet programs; The user can insert a calculation in a cell, press enter, and the result is calculated and displayed immediately.

To support this kind of software, MontiCore offers an interpreter; First, the entered expression is parsed and checked for errors. Afterwards, the interpreter traverses the Abstract Syntax Tree (AST), calculating values in the process. The final value can then be used for further calculations, displaying, etc.

MontiCore’s grammar components offer support for tuple-, intersection, and union-types.

// tuples are ordered sequences of values
(String, int) tuple = ("Hello", 3);
// intersection types represent values of multiple types
Car & Ship amphibiousVehicle = // ...;
amphibiousVehicle.driveOnRoad(); // Method of class Car
// union types represent values of one out of multiple types
Error | double result = sqrt(-5);

Within this thesis, the aim is to develop an interpreter extension to interpret expressions with regard to tuple-, intersection-, and union-types. These calculations have to be compatible with all other kinds of values already supported.

Optionally, different kinds can be selected as focus of the thesis;

  • SI Units
  • Classes that are defined in Class Diagrams

Tasks of this thesis

  • Design and implement Value classes for the selected value kinds.
  • Extend the interpreter implementation to support the selected value kinds.
  • Create test data.
  • Evaluate the approach.

Desirable Skills

  • Interest in compiler design and type systems
  • Lecture SLE
  • Prior knowledge regarding interpreters

Contact

For more information please sent your application documents to Flo Drux.

Prof. Dr. Bernhard Rumpe
Lehrstuhl Software Engineering
Ahornstr. 55
52074 Aachen