Webbläsaren som du använder stöds inte av denna webbplats. Alla versioner av Internet Explorer stöds inte längre, av oss eller Microsoft (läs mer här: * https://www.microsoft.com/en-us/microsoft-365/windows/end-of-ie-support).

Var god och använd en modern webbläsare för att ta del av denna webbplats, som t.ex. nyaste versioner av Edge, Chrome, Firefox eller Safari osv.

Implementation of a Modelica compiler using JastAdd attribute grammars

Författare

Summary, in English

We have implemented a compiler for key parts of Modelica, an object-oriented language supporting equation-based modeling and simulation of complex physical systems. The compiler is extensible, to support experiments with emerging tools for physical models. To achieve extensibility, the implementation is done declaratively in JastAdd, a metacompilation system supporting modern attribute grammar mechanisms such as reference attributes and nonterminal attributes. This paper reports on experiences from this implementation. For name and type analyses, we illustrate how declarative design strategies, originally developed for a Java compiler, could be reused to support Modelica's advanced features of multiple inheritance and structural subtyping. Furthermore, we present new general design strategies for declarative generation of target ASTs from source ASTs. We illustrate how these strategies are used to resolve a generics-like feature of Modelica called modifications, and to support flattening, a fundamental part of Modelica compilation. To validate that the approach is practical, we have compared the execution speed of our compiler to two existing Modelica compilers.

Publiceringsår

2010

Språk

Engelska

Sidor

21-38

Publikation/Tidskrift/Serie

Science of Computer Programming

Volym

75

Issue

1-2

Dokumenttyp

Artikel i tidskrift

Förlag

Elsevier

Ämne

  • Computer Science
  • Control Engineering

Status

Published

Projekt

  • Embedded Applications Software Engineering

Forskningsgrupp

  • LCCC

ISBN/ISSN/Övrigt

  • ISSN: 0167-6423