Title of article
Implementation of a Modelica compiler using JastAdd attribute grammars
Author/Authors
Johan ?kesson، نويسنده , , Torbj?rn Ekman، نويسنده , , G?rel Hedin، نويسنده ,
Issue Information
ماهنامه با شماره پیاپی سال 2010
Pages
18
From page
21
To page
38
Abstract
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.
Keywords
Compiler construction , JastAdd , Modelica , Reference attributed grammars
Journal title
Science of Computer Programming
Serial Year
2010
Journal title
Science of Computer Programming
Record number
1080096
Link To Document