Modelica Incremental Modules (Modim)

Christoph Höger
christoph.hoeger@tu-berlin.de
Technische Universität Berlin
13.02.2013

Agenda

  1. Modim overview

    A short overview of what is implemented inside Modim

  2. Modim's Modelica Frontend

    Parsing, Abstract Syntax & Type-Evaluation

  3. How To

    How to do things with modim today.

  4. Questions

    Room for your questions.

Modim: Overview

A few facts and figures

Modim (Modelica Incremental Modules) is a toolchain for the separate compilation of Modelica models

Modim

Modim (Modelica Incremental Modules) is a toolchain for the separate compilation of Modelica models

Current Modules

Frontend Abstract Syntax

Modim contains an abstract syntax tree written as case-classes

Frontend Abstract Syntax

There are 32 syntactic groups

Parser Performance


/

#

FrontEnd: Type Evaluation

Modelica contains rather complicated type-expressions:

In particular, there is no specific order of type evaluation specified in Modelica.

FrontEnd: Lazy Types

Modim evaluates types lazily

A NamedType can be evaluated into one of 10 basic types.

Modim: Howto

Obtaining Modim

Version 0.4.0 will be released soon under https://mlcontrol.uebb.tu-berlin.de/redmine/projects/modim

Parse a Modelica source file (scala)


  Some(Unit(Some(List(Modelica)),
    List(TypeDef(Electrical,Package,Composition(List(),List(),List(),
    List(Extend(TProj(TProj(TIde(Modelica),Icons),Package),Public,None)),List(),List(),
    Behavior(List(),List(),List(),List(),None)),None,
    TypeDefOptions(false,false,false,false),
    Comment(...)

Parse a Modelica source file (scala)


  Some(Unit(Some(List(Modelica)),
    List(TypeDef(Electrical,Package,Composition(List(),List(),List(),
    List(Extend(TProj(TProj(TIde(Modelica),Icons),Package),Public,None)),List(),List(),
    Behavior(List(),List(),List(),List(),None)),None,
    TypeDefOptions(false,false,false,false),
    Comment(...)

Thank you for your attention!

Questions?